Rabbit Remote Control 0.0.37
Loading...
Searching...
No Matches
Parameter.h
1// Author: Kang Lin <kl222@126.com>
2
3#pragma once
4
5#include <QSettings>
6#include <QString>
7#include <QVector>
8#include "plugin_export.h"
9
208class PLUGIN_EXPORT CParameter : public QObject
209{
210 Q_OBJECT
211 Q_PROPERTY(bool Modified READ GetModified WRITE SetModified FINAL)
212
213public:
231 explicit CParameter(QObject *parent = nullptr,
232 const QString& szPrefix = QString());
233 virtual ~CParameter();
234
236 virtual int Load(QString szFile = QString());
238 virtual int Save(QString szFile = QString(), bool bForce = true);
239
241 virtual int Load(QSettings &set);
243 virtual int Save(QSettings &set, bool bForce = true);
244
264 virtual bool CheckValidity();
265
266Q_SIGNALS:
276
277protected:
278 virtual int OnLoad(QSettings &set) = 0;
279 virtual int OnSave(QSettings &set) = 0;
293 virtual bool OnCheckValidity();
294
303 int SetModified(bool bModified = true);
313 bool GetModified();
314
315private:
321 int AddCategory(CParameter* p);
322 QString GetPrefix() const;
323 int SetPrefix(const QString& szPrefix);
324
325private:
326 QString m_szPrefix;
327
335
340 QVector<CParameter*> m_Category;
341};
Parameter interface.
Definition Parameter.h:209
QVector< CParameter * > m_Category
Category.
Definition Parameter.h:340
bool m_bModified
If false, then don't save when save.
Definition Parameter.h:334
void sigChanged()
emit when the parameter changes Usually if required, the corresponding parameter corresponds to a cha...
CParameter(QObject *parent=nullptr, const QString &szPrefix=QString())