34 Q_PROPERTY(QString
name READ
name WRITE setName)
45 Q_INVOKABLE
bool setValue(
const QVariantMap &map);
53 Q_INVOKABLE QVariant
value(
const QVariantMap &map);
59 Q_INVOKABLE
bool contains(
const QString &key);
65 Q_INVOKABLE
bool remove(
const QString &key);
70 Q_INVOKABLE
bool sync();
73 QSettings *m_settings =
nullptr;
74 QString m_settingsPath;
78 void setName(
const QString &
name);
79 void createSettings();
The class exposing Settings API to QML.
Q_INVOKABLE bool contains(const QString &key)
Checks if a given key exists.
QString name
name of the folder in which settings.ini file is located on the standard extension path.
Q_INVOKABLE bool setValue(const QVariantMap &map)
Sets the value for a given key.
Q_INVOKABLE bool sync()
syncs the settings
QmlSettings(QObject *parent=nullptr)
Q_INVOKABLE QVariant value(const QVariantMap &map)
Gets the value for a given key.
Q_INVOKABLE bool remove(const QString &key)
Removes the given key-value from the settings.