Refactoring. Add additional constructor for class QSettings.

This commit is contained in:
Roman Telezhynskyi 2020-03-07 10:58:18 +02:00
parent f978db470d
commit 4ce51e2662
4 changed files with 14 additions and 0 deletions

View File

@ -238,6 +238,11 @@ VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &orga
:QSettings(format, scope, organization, application, parent) :QSettings(format, scope, organization, application, parent)
{} {}
//---------------------------------------------------------------------------------------------------------------------
VCommonSettings::VCommonSettings(const QString &fileName, QSettings::Format format, QObject *parent)
:QSettings(fileName, format, parent)
{}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::SharePath(const QString &shareItem) QString VCommonSettings::SharePath(const QString &shareItem)
{ {

View File

@ -44,6 +44,7 @@ class VCommonSettings : public QSettings
public: public:
VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(), VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(),
QObject *parent = nullptr); QObject *parent = nullptr);
VCommonSettings(const QString &fileName, Format format, QObject *parent = nullptr);
static QString SharePath(const QString &shareItem); static QString SharePath(const QString &shareItem);
static QString MultisizeTablesPath(); static QString MultisizeTablesPath();

View File

@ -137,6 +137,13 @@ VSettings::VSettings(Format format, Scope scope, const QString &organization, co
qRegisterMetaTypeStreamOperators<QMarginsF>("QMarginsF"); qRegisterMetaTypeStreamOperators<QMarginsF>("QMarginsF");
} }
//---------------------------------------------------------------------------------------------------------------------
VSettings::VSettings(const QString &fileName, QSettings::Format format, QObject *parent)
:VCommonSettings(fileName, format, parent)
{
qRegisterMetaTypeStreamOperators<QMarginsF>("QMarginsF");
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <class T> template <class T>
inline T VSettings::ValueOrDef(const QString &setting, const T &defValue) const inline T VSettings::ValueOrDef(const QString &setting, const T &defValue) const

View File

@ -45,6 +45,7 @@ class VSettings : public VCommonSettings
public: public:
VSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(), VSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(),
QObject *parent = nullptr); QObject *parent = nullptr);
VSettings(const QString &fileName, Format format, QObject *parent = nullptr);
QString GetLabelLanguage() const; QString GetLabelLanguage() const;
void SetLabelLanguage(const QString &value); void SetLabelLanguage(const QString &value);