Rabbit Remote Control 0.1.0-bate10
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
219class PLUGIN_EXPORT CParameter : public QObject
220{
221 Q_OBJECT
222 Q_PROPERTY(bool Modified READ GetModified WRITE SetModified FINAL)
223
224public:
242 explicit CParameter(QObject *parent,
243 const QString& szPrefix = QString());
244 virtual ~CParameter();
245
247 virtual int Load(QString szFile = QString());
249 virtual int Save(QString szFile = QString(), bool bForce = true);
250
252 virtual int Load(QSettings &set);
254 virtual int Save(QSettings &set, bool bForce = true);
255
275 virtual bool CheckValidity();
276
277Q_SIGNALS:
287
288protected:
289 virtual int OnLoad(QSettings &set) = 0;
290 virtual int OnSave(QSettings &set) = 0;
304 virtual bool OnCheckValidity();
305
314 int SetModified(bool bModified = true);
324 bool GetModified();
325
326private:
332 int AddCategory(CParameter* p);
333 QString GetPrefix() const;
334 int SetPrefix(const QString& szPrefix);
335
336private:
337 QString m_szPrefix;
338
346
351 QVector<CParameter*> m_Category;
352};
Parameter interface.
Definition Parameter.h:220
QVector< CParameter * > m_Category
Category.
Definition Parameter.h:351
bool m_bModified
If false, then don't save when save.
Definition Parameter.h:345
CParameter(QObject *parent, const QString &szPrefix=QString())
void sigChanged()
emit when the parameter changes Usually if required, the corresponding parameter corresponds to a cha...