Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
+73
@@ -0,0 +1,73 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QMap>
|
||||
#include <LtsUtilsSettings/ltsutilssettings_export.h>
|
||||
|
||||
class QJsonObject;
|
||||
|
||||
namespace LtsUtils
|
||||
{
|
||||
|
||||
class LTSUTILSSETTINGS_EXPORT Settings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
~Settings() = default;
|
||||
|
||||
|
||||
|
||||
void setValue(const QString &group, const QString &identifier, const QVariant &value);
|
||||
|
||||
|
||||
|
||||
void removeValue(const QString &group, const QString &identifier);
|
||||
|
||||
|
||||
|
||||
QVariant value(const QString &group, const QString &identifier, const QVariant &defaultValue = QVariant()) const;
|
||||
|
||||
|
||||
|
||||
QStringList identifiers(const QString &group) const;
|
||||
|
||||
void init(const QByteArray &settings);
|
||||
QByteArray exportSettings() const;
|
||||
void clear();
|
||||
|
||||
void dump();
|
||||
|
||||
protected:
|
||||
Settings() = default;
|
||||
|
||||
signals:
|
||||
void valueChanged(const QString &group, const QString &identifier, const QVariant &value);
|
||||
void valueRemoved(const QString &group, const QString &identifier);
|
||||
|
||||
protected:
|
||||
QHash<QString, QVariant> m_data;
|
||||
|
||||
};
|
||||
|
||||
class LTSUTILSSETTINGS_EXPORT OperatorSettings : public Settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static OperatorSettings *getInstance();
|
||||
};
|
||||
|
||||
class LTSUTILSSETTINGS_EXPORT ProjectSettings : public Settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static ProjectSettings *getInstance();
|
||||
|
||||
static bool initFromFile(const QString &filename);
|
||||
static bool isFunctionEnabled(const QString &group, const QString &function);
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user