QuasarAppLib/settings.h
EndrII 85185d2430 Revert "added the template service class"
This reverts commit 803870ea08adcea3a94e57e64a496447c05d55e0.
2022-06-21 19:14:59 +03:00

56 lines
1.1 KiB
C++

/*
* Copyright (C) 2021-2022 QuasarApp.
* 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.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include "quasarapp_global.h"
#include "isettings.h"
namespace QuasarAppUtils {
/**
* @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
{
public:
Settings();
/**
* @brief init This is simple wrapper of the Settings::init method for convenient access to initialisation.
* @return instance of the setting.
*/
static ISettings* init();
// ISettings interface
protected:
void syncImplementation();
QVariant getValueImplementation(const QString &key, const QVariant &def);
void setValueImplementation(const QString key, const QVariant &value);
private:
QSettings *_settings = nullptr;
};
}
#endif // SETTINGS_H