38 lines
713 B
C
38 lines
713 B
C
|
#ifndef SCSTWQMLSETTING_H
|
||
|
#define SCSTWQMLSETTING_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QVariant>
|
||
|
|
||
|
class ScStwSetting : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
Q_PROPERTY(QVariant value READ getValue WRITE setValue NOTIFY valueChanged)
|
||
|
|
||
|
protected:
|
||
|
explicit ScStwSetting(QObject *parent = nullptr);
|
||
|
|
||
|
int key;
|
||
|
int keyLevel;
|
||
|
bool hasToReload;
|
||
|
|
||
|
virtual bool writeSetting(int, int, QVariant) = 0;
|
||
|
virtual QVariant readSetting(int, int) = 0;
|
||
|
|
||
|
private:
|
||
|
QVariant valueCache;
|
||
|
|
||
|
public slots:
|
||
|
QVariant getValue();
|
||
|
void setValue(QVariant value);
|
||
|
|
||
|
protected slots:
|
||
|
void handleSettingChange(int key, int keyLevel, QVariant value);
|
||
|
|
||
|
signals:
|
||
|
void valueChanged();
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // SCSTWQMLSETTING_H
|