Skip to content

Class Settings

ClassList > Settings

Inherits the following classes: QSettings

Inherited by the following classes: PositioningSettings

Public Signals

Type Name
signal void settingChanged (const QString & key)

Public Functions

Type Name
Settings (QObject * parent=nullptr)
Q_INVOKABLE void remove (const QString & key)
Q_INVOKABLE void setValue (const QString & key, const QVariant & value)
Q_INVOKABLE void sync ()
Q_INVOKABLE QVariant value (const QString & key, const QVariant & defaultValue)
Q_INVOKABLE bool valueBool (const QString & key, bool defaultValue)
Q_INVOKABLE int valueInt (const QString & key, int defaultValue)

Public Signals Documentation

signal settingChanged

void Settings::settingChanged;

Public Functions Documentation

function Settings

explicit Settings::Settings (
    QObject * parent=nullptr
) 

function remove

Q_INVOKABLE void Settings::remove (
    const QString & key
) 

Removes the given key from settings.


function setValue

Q_INVOKABLE void Settings::setValue (
    const QString & key,
    const QVariant & value
) 

function sync

Q_INVOKABLE void Settings::sync () 

Writes any unsaved changes to permanent storage, and reloads the settings.


function value

Q_INVOKABLE QVariant Settings::value (
    const QString & key,
    const QVariant & defaultValue
) 

function valueBool

Q_INVOKABLE bool Settings::valueBool (
    const QString & key,
    bool defaultValue
) 

Properly evaluates the returned value to be boolean. If the normal value() is used instead, a string "true" or "false" will be returned which will be evaluated to true either way by JS.


function valueInt

Q_INVOKABLE int Settings::valueInt (
    const QString & key,
    int defaultValue
) 

Properly evaluates the returned value to be int. If the normal value() is used instead, a string "1" or "-456" will be returned.



The documentation for this class was generated from the following file src/core/settings.h