2#include "RabbitCommonDir.h"
4#include <QLoggingCategory>
6static Q_LOGGING_CATEGORY(log,
"Client.Parameter")
13 CParameter* p = qobject_cast<CParameter*>(parent);
19CParameter::~CParameter()
22QString CParameter::GetPrefix()
const
27int CParameter::SetPrefix(
const QString& szName)
36 szFile = RabbitCommon::CDir::Instance()->GetFileUserConfigure();
37 if(szFile.isEmpty())
return -1;
38 QSettings set(szFile, QSettings::IniFormat);
48 szFile = RabbitCommon::CDir::Instance()->GetFileUserConfigure();
49 if(szFile.isEmpty())
return -1;
50 QSettings set(szFile, QSettings::IniFormat);
60 if(!GetPrefix().isEmpty())
61 set.beginGroup(GetPrefix());
72 if(!GetPrefix().isEmpty())
82 if(!GetPrefix().isEmpty())
83 set.beginGroup(GetPrefix());
94 if(!GetPrefix().isEmpty())
113 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.