trying to wrap qsettings in rust

This commit is contained in:
Chris Cochrun 2023-01-27 09:58:16 -06:00
parent 137ba3d4f6
commit f1def0bce9
2 changed files with 58 additions and 0 deletions

24
src/cpp/qsettingscxx.h Normal file
View 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(); }
};