63 Q_INVOKABLE QVariant
getValue(
const QString &key,
const QVariant& def = {});
73 Q_INVOKABLE QString
getStrValue(
const QString &key,
const QString& def = {});
127 static bool initService(std::unique_ptr<ISettings> obj);
135 void setValue(
const QString &key,
const QVariant& value);
142 void setStrValue(
const QString& key,
const QString& value);
224 QHash<QString, QVariant> _cache;
225 QHash<QString, QVariant> *_defaultConfig =
nullptr;
virtual bool ignoreToRest(const QString &key) const
ignoreToRest This method should be returns true if the key setting is not be reset on the resetToDefa...
static bool initService(std::unique_ptr< ISettings > obj)
initService This method initialize the global settings object.
void sync()
sync This method save all settings data on a hard disk;
void valueStrChanged(QString key, QString value)
valueStrChanged some as valueChanged(QString key, QVariant value) but value has ben converted to the ...
QHash< QString, QVariant > & settingsMap()
settingsMap This method returns initialized settings map. Settings map contains pairs with settings k...
static ISettings * instance()
instance This method returns pointer to current settings object.
virtual void syncImplementation()=0
syncImplementation This method should save all configuration data to the hard drive;
void setValue(const QString &key, const QVariant &value)
setValue This slot sets new value for a key setting
void valueChanged(QString key, QVariant value)
valueChanged This signal when value of the key settings changed
virtual QVariant getValueImplementation(const QString &key, const QVariant &def)=0
getValueImplementation This method will return the value of the settings.
virtual void setValueImplementation(const QString key, const QVariant &value)=0
setValueImplementation This slot will set a new value for the key parameter.
Q_INVOKABLE QString getStrValue(const QString &key, const QString &def={})
getStrValue some as getValue but convert result object to QString type.
void clearCache()
clearCache This method clear all data from cache.
ISettings(SettingsSaveMode mode=SettingsSaveMode::Auto)
Q_INVOKABLE void resetToDefault()
resetToDefault This method reset all settings to default values.
void forceReloadCache()
forceReloadCache This method force reload settings data from disk.
void setMode(const SettingsSaveMode &mode)
setMode This method sets a new value of the settings mode.
Q_INVOKABLE QVariant getValue(const QString &key, const QVariant &def={})
getValue This method return the value of the settings.
SettingsSaveMode getMode() const
getMode This method return the current mode of the settings.
virtual QHash< QString, QVariant > defaultSettings()=0
defaultSettings This method must be return default map of the settings and them values....
void setStrValue(const QString &key, const QString &value)
setStrValue This is some as setValue but working with the QString type.
The QuasarAppUtils namespace contains the base functions for all applications of the QuasarApp group....
SettingsSaveMode
The SettingsSaveMode enum.
@ Auto
a settings will be saved on hard disk when called the Settings::setValue method.
@ Manual
a settings will be saved on hard disk when called the Settings::Sync method.
#define QUASARAPPSHARED_EXPORT