trying to wrap qsettings in rust
This commit is contained in:
parent
137ba3d4f6
commit
f1def0bce9
2 changed files with 58 additions and 0 deletions
24
src/cpp/qsettingscxx.h
Normal file
24
src/cpp/qsettingscxx.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
#include "rust/cxx.h"
|
||||
|
||||
class QSettingsCXX : public QSettings
|
||||
{
|
||||
public:
|
||||
explicit QSettingsCXX(QObject* parent = nullptr)
|
||||
: QSettings(parent)
|
||||
{
|
||||
}
|
||||
|
||||
// Can't define in CXX as they are protected
|
||||
// so crate public methods that are proxied
|
||||
void setValue(QString key, QString value)
|
||||
{
|
||||
QSettings::setValue(key, value);
|
||||
}
|
||||
|
||||
void sync() { QSettings::sync(); }
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue