Rabbit Remote Control
0.1.0-bate14
Toggle main menu visibility
Loading...
Searching...
No Matches
Src
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
68
113
219
class
PLUGIN_EXPORT
CParameter
:
public
QObject
220
{
221
Q_OBJECT
222
Q_PROPERTY(
bool
Modified READ
GetModified
WRITE
SetModified
FINAL)
223
224
public
:
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
277
Q_SIGNALS:
286
void
sigChanged
();
287
288
protected
:
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
326
private
:
332
int
AddCategory
(
CParameter
* p);
333
QString GetPrefix()
const
;
334
int
SetPrefix(
const
QString& szPrefix);
335
336
private
:
337
QString m_szPrefix;
338
345
bool
m_bModified
;
346
351
QVector<CParameter*>
m_Category
;
352
};
CParameter::m_Category
QVector< CParameter * > m_Category
Category.
Definition
Parameter.h:351
CParameter::SetModified
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.
Definition
Parameter.cpp:126
CParameter::m_bModified
bool m_bModified
If false, then don't save when save.
Definition
Parameter.h:345
CParameter::CheckValidity
virtual bool CheckValidity()
Check whether the parameter is valid to decide whether to use or save the parameter.
Definition
Parameter.cpp:103
CParameter::AddCategory
int AddCategory(CParameter *p)
Instances of this class and its derived classes are members of the instance.
Definition
Parameter.cpp:134
CParameter::Save
virtual int Save(QString szFile=QString(), bool bForce=true)
Save to file.
Definition
Parameter.cpp:47
CParameter::CParameter
CParameter(QObject *parent, const QString &szPrefix=QString())
CParameter::GetModified
bool GetModified()
Whether the parameters have been modified.
Definition
Parameter.cpp:121
CParameter::sigChanged
void sigChanged()
emit when the parameter changes Usually if required, the corresponding parameter corresponds to a cha...
CParameter::OnCheckValidity
virtual bool OnCheckValidity()
Check validity.
Definition
Parameter.cpp:115
CParameter::Load
virtual int Load(QString szFile=QString())
Load from file.
Definition
Parameter.cpp:35
Author: Kang Lin (kl222@126.com)
Copyright (c) Kang Lin Studios All Rights Reserved