2#include "RabbitCommonDir.h"
4#include <QLoggingCategory>
6static Q_LOGGING_CATEGORY(log,
"Client.Parameter")
13 CParameter* p = qobject_cast<CParameter*>(parent);
16 bool check = connect(
this, SIGNAL(sigChanged()), p, SIGNAL(sigChanged()));
21CParameter::~CParameter()
24QString CParameter::GetPrefix()
const
29int CParameter::SetPrefix(
const QString& szName)
38 szFile = RabbitCommon::CDir::Instance()->GetFileUserConfigure();
39 if(szFile.isEmpty())
return -1;
40 QSettings set(szFile, QSettings::IniFormat);
50 szFile = RabbitCommon::CDir::Instance()->GetFileUserConfigure();
51 if(szFile.isEmpty())
return -1;
52 QSettings set(szFile, QSettings::IniFormat);
62 if(!GetPrefix().isEmpty())
63 set.beginGroup(GetPrefix());
74 if(!GetPrefix().isEmpty())
84 if(!GetPrefix().isEmpty())
85 set.beginGroup(GetPrefix());
96 if(!GetPrefix().isEmpty())
115 qDebug(log) <<
" Not implemented CParameter::onCheckValidity()";
QVector< CParameter * > m_Category
Category.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.
bool m_bModified
If false, then don't save when save.
virtual bool CheckValidity()
Check whether the parameter is valid to decide whether to use or save the parameter.
int AddCategory(CParameter *p)
Instances of this class and its derived classes are members of the instance.
virtual int Save(QString szFile=QString(), bool bForce=true)
Save to file.
bool GetModified()
Whether the parameters have been modified.
virtual bool OnCheckValidity()
Check validity.
virtual int Load(QString szFile=QString())
Load from file.