Files
gcs-nf/App/Config/Config.h
T

61 lines
1.2 KiB
C++
Raw Normal View History

2020-09-29 15:14:56 +08:00
#ifndef CONFIG_H
#define CONFIG_H
#include <QObject>
#include "QDir"
#include "QJsonArray"
#include "QJsonDocument"
#include "QJsonObject"
#include "QJsonParseError"
2020-09-30 13:52:57 +08:00
#include "QDebug"
2020-09-29 15:14:56 +08:00
2020-10-06 09:34:04 +08:00
class Config : public QObject
2020-09-29 15:14:56 +08:00
{
Q_OBJECT
public:
explicit Config(QObject *parent = nullptr);
~Config();
2020-10-07 21:53:36 +08:00
public slots:
QJsonObject getJsonObject(QString key);
void setJsonObject(QString key,QJsonValue value);
QString getCommandFile();
void setCommandFile(QString file);
2020-10-13 18:41:23 +08:00
void getConnet(QString key, QVariant *type,
2020-10-07 21:53:36 +08:00
QVariant *iauto,
QVariant *par1, QVariant *par2,
QVariant *par3, QVariant *par4,
QVariant *par5);
2020-10-13 18:41:23 +08:00
void setConnet(QString key,QVariant type,
2020-10-07 21:53:36 +08:00
QVariant iauto,
QVariant par1,QVariant par2,
QVariant par3,QVariant par4,
QVariant par5);
2020-09-29 15:14:56 +08:00
2020-10-06 09:34:04 +08:00
private slots:
2020-09-30 13:52:57 +08:00
void loadJson(const QString& jsonFilename);
2020-10-06 09:34:04 +08:00
2020-09-30 13:52:57 +08:00
private:
2020-10-07 21:53:36 +08:00
QString ConfigFile = "./config/config.json";
QJsonObject ConfigJson;
2020-09-30 13:52:57 +08:00
2020-09-29 15:14:56 +08:00
};
#endif // CONFIG_H