The Settings class manages the application settings.
More...
#include "framework/global/internal/Settings.h"
|
| void | addKey (QString moduleName, QString keyName, QString key, QVariant defaultValue) override |
| |
| Q_INVOKABLE void | setValue (QString moduleName, QString keyName, QVariant value) override |
| |
| void | setValue (Key key, QVariant value) override |
| |
| Q_INVOKABLE QVariant | getValue (QString moduleName, QString keyName) override |
| |
| QVariant | getValue (Key key) override |
| |
| Q_INVOKABLE bool | containsKey (QString moduleName, QString keyName) override |
| |
| bool | containsKey (Key key) override |
| |
| Q_INVOKABLE void | freeze (void) override |
| |
| Q_INVOKABLE void | saveChanges (void) override |
| |
| Q_INVOKABLE void | discardChanges (void) override |
| |
| Q_INVOKABLE bool | isFrozen (void) override |
| |
|
| static QVariant | get (QString key, QVariant defaultValue) |
| |
| static bool | contains (QString key) |
| |
| static void | set (QString key, QVariant value) |
| |
|
| static void | copySettings (QSettings *source, QSettings *target) |
| |
|
|
static std::shared_ptr< Settings > | m_instance = std::make_shared<Settings>() |
| |
|
static QSettings * | settingsInstance = nullptr |
| |
|
static QSettings * | mainSettingsInstance = nullptr |
| |
|
static bool | frozen = false |
| |
|
static QMap< QPair< QString, QString >, Key > | m_keys |
| |
|
|
void | stateChanged () |
| |
|
void | saved () |
| |
|
void | discarded () |
| |
The Settings class manages the application settings.
◆ addKey()
| void Settings::addKey |
( |
QString |
moduleName, |
|
|
QString |
keyName, |
|
|
QString |
key, |
|
|
QVariant |
defaultValue |
|
) |
| |
|
overridevirtual |
◆ contains()
| bool Settings::contains |
( |
QString |
key | ) |
|
|
staticprotected |
Returns true if the given key exists.
◆ containsKey() [1/2]
| bool Settings::containsKey |
( |
Key |
key | ) |
|
|
overridevirtual |
Returns true if the given key is defined (module name and key name are stored in the Key object).
Implements ISettings.
◆ containsKey() [2/2]
| bool Settings::containsKey |
( |
QString |
moduleName, |
|
|
QString |
keyName |
|
) |
| |
|
overridevirtual |
Returns true if the given key is defined.
Implements ISettings.
◆ copySettings()
| void Settings::copySettings |
( |
QSettings * |
source, |
|
|
QSettings * |
target |
|
) |
| |
|
staticprivate |
Copies values from source settings to target settings.
◆ discardChanges()
| void Settings::discardChanges |
( |
void |
| ) |
|
|
overridevirtual |
Discards changes and switches back to real settings.
- See also
- freeze()
Implements ISettings.
◆ freeze()
| void Settings::freeze |
( |
void |
| ) |
|
|
overridevirtual |
◆ get()
| QVariant Settings::get |
( |
QString |
key, |
|
|
QVariant |
defaultValue |
|
) |
| |
|
staticprotected |
Returns the value of the given key.
◆ getValue() [1/2]
| QVariant Settings::getValue |
( |
Key |
key | ) |
|
|
overridevirtual |
Returns the value of the given key (module name and key name are stored in the Key object).
Implements ISettings.
◆ getValue() [2/2]
| QVariant Settings::getValue |
( |
QString |
moduleName, |
|
|
QString |
keyName |
|
) |
| |
|
overridevirtual |
Returns the value of the given key.
Implements ISettings.
◆ init()
| void Settings::init |
( |
void |
| ) |
|
|
static |
◆ instance()
| std::shared_ptr< Settings > Settings::instance |
( |
| ) |
|
|
static |
Returns the static instance of Settings.
◆ isFrozen()
| bool Settings::isFrozen |
( |
void |
| ) |
|
|
overridevirtual |
◆ saveChanges()
| void Settings::saveChanges |
( |
void |
| ) |
|
|
overridevirtual |
Saves changes to real settings and switches back to them.
- See also
- freeze()
Implements ISettings.
◆ set()
| void Settings::set |
( |
QString |
key, |
|
|
QVariant |
value |
|
) |
| |
|
staticprotected |
◆ setValue() [1/2]
| void Settings::setValue |
( |
Key |
key, |
|
|
QVariant |
value |
|
) |
| |
|
overridevirtual |
Sets the key value (module name and key name are stored in the Key object).
Implements ISettings.
◆ setValue() [2/2]
| void Settings::setValue |
( |
QString |
moduleName, |
|
|
QString |
keyName, |
|
|
QVariant |
value |
|
) |
| |
|
overridevirtual |
The documentation for this class was generated from the following files:
- src/framework/global/internal/Settings.h
- src/framework/global/internal/Settings.cpp