QuasarAppLib/settings.h

50 lines
998 B
C
Raw Normal View History

2018-09-29 15:56:04 +03:00
/*
2022-03-03 19:00:49 +03:00
* Copyright (C) 2021-2022 QuasarApp.
2018-09-29 15:56:04 +03:00
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
2018-09-29 15:56:04 +03:00
#ifndef SETTINGS_H
#define SETTINGS_H
#include "quasarapp_global.h"
#include "isettings.h"
2018-09-29 15:56:04 +03:00
namespace QuasarAppUtils {
2022-02-22 17:01:53 +03:00
/**
* @brief The Settings class This is wraper of the QSettings object.
*
* Example of initialisation :
*
* ```
* auto settingsInstance = Setting::init();
* ```
*
* @see Settings::init
*/
class QUASARAPPSHARED_EXPORT Settings: public ISettings
2018-09-29 15:56:04 +03:00
{
Q_OBJECT
2018-09-29 15:56:04 +03:00
public:
Settings();
2018-09-29 15:56:04 +03:00
// ISettings interface
protected:
2022-02-22 17:01:53 +03:00
void syncImplementation();
QVariant getValueImplementation(const QString &key, const QVariant &def);
void setValueImplementation(const QString key, const QVariant &value);
2019-09-28 16:41:43 +03:00
2022-06-24 00:29:23 +03:00
void setGroup(const QString&);
2018-09-29 15:56:04 +03:00
private:
QSettings *_settings = nullptr;
2018-09-29 15:56:04 +03:00
};
}
2018-09-29 15:56:04 +03:00
#endif // SETTINGS_H