61 lines
1.2 KiB
C++
61 lines
1.2 KiB
C++
#ifndef CONFIG_H
|
|
#define CONFIG_H
|
|
|
|
#include <QObject>
|
|
#include "QDir"
|
|
#include "QJsonArray"
|
|
#include "QJsonDocument"
|
|
#include "QJsonObject"
|
|
#include "QJsonParseError"
|
|
|
|
#include "QDebug"
|
|
|
|
class Config : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Config(QObject *parent = nullptr);
|
|
~Config();
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
QJsonObject getJsonObject(QString key);
|
|
void setJsonObject(QString key,QJsonValue value);
|
|
|
|
|
|
QString getCommandFile();
|
|
void setCommandFile(QString file);
|
|
|
|
|
|
void getConnet(QString key, QVariant *type,
|
|
QVariant *iauto,
|
|
QVariant *par1, QVariant *par2,
|
|
QVariant *par3, QVariant *par4,
|
|
QVariant *par5);
|
|
|
|
void setConnet(QString key,QVariant type,
|
|
QVariant iauto,
|
|
QVariant par1,QVariant par2,
|
|
QVariant par3,QVariant par4,
|
|
QVariant par5);
|
|
|
|
|
|
private slots:
|
|
|
|
void loadJson(const QString& jsonFilename);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString ConfigFile = "./config/config.json";
|
|
|
|
QJsonObject ConfigJson;
|
|
|
|
|
|
};
|
|
|
|
#endif // CONFIG_H
|