28 lines
668 B
C
28 lines
668 B
C
|
|
#ifndef CONFIGINTERFACE_H
|
||
|
|
#define CONFIGINTERFACE_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QQmlEngine>
|
||
|
|
#include <QJsonDocument>
|
||
|
|
#include <QJsonArray>
|
||
|
|
#include <QJsonObject>
|
||
|
|
|
||
|
|
class ConfigInterface : public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
QML_ELEMENT
|
||
|
|
Q_PROPERTY(QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged FINAL)
|
||
|
|
public:
|
||
|
|
explicit ConfigInterface(QObject *parent = nullptr);
|
||
|
|
QString fileName() const;
|
||
|
|
void setFileName(const QString &newFileName);
|
||
|
|
signals:
|
||
|
|
void config(QJsonObject config);
|
||
|
|
void fileNameChanged();
|
||
|
|
public slots:
|
||
|
|
void saveConfig(QJsonObject config);
|
||
|
|
private:
|
||
|
|
QString m_fileName;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // CONFIGINTERFACE_H
|