63 lines
1.7 KiB
C++
63 lines
1.7 KiB
C++
#ifndef CONFIGINTERFACE_H
|
|
#define CONFIGINTERFACE_H
|
|
|
|
#include <QObject>
|
|
#include <QQmlEngine>
|
|
#include <QFile>
|
|
#include <QDir>
|
|
#include <QStandardPaths>
|
|
#include <QJsonObject>
|
|
#include <QJsonValue>
|
|
#include <QJsonDocument>
|
|
|
|
class ConfigInterface : public QObject
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
Q_PROPERTY(QString min READ min WRITE setMin NOTIFY minChanged FINAL)
|
|
Q_PROPERTY(QString max READ max WRITE setMax NOTIFY maxChanged FINAL)
|
|
Q_PROPERTY(QString alert READ alert WRITE setAlert NOTIFY alertChanged FINAL)
|
|
Q_PROPERTY(QString mode READ mode WRITE setMode NOTIFY modeChanged FINAL)
|
|
Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged FINAL)
|
|
Q_PROPERTY(bool flipBits READ flipBits WRITE setFlipBits NOTIFY flipBitsChanged FINAL)
|
|
public:
|
|
explicit ConfigInterface(QObject *parent = nullptr);
|
|
QString alert() const;
|
|
void setAlert(const QString &newAlert);
|
|
|
|
QString max() const;
|
|
void setMax(const QString &newMax);
|
|
|
|
QString min() const;
|
|
void setMin(const QString &newMin);
|
|
|
|
bool flipBits() const;
|
|
void setFlipBits(bool newFlipBits);
|
|
|
|
QString mode() const;
|
|
void setMode(const QString &newMode);
|
|
|
|
QString url() const;
|
|
void setUrl(const QString &newUrl);
|
|
|
|
signals:
|
|
void configData(QString max, QString min, QString alert, bool flipbits, QString mode, QString url);
|
|
void alertChanged();
|
|
void maxChanged();
|
|
void minChanged();
|
|
void flipBitsChanged();
|
|
void modeChanged();
|
|
void urlChanged();
|
|
|
|
public slots:
|
|
void saveConfig(QString max, QString min, QString alert, bool flipbits, QString mode, QString url);
|
|
private:
|
|
QString m_alert;
|
|
QString m_max;
|
|
QString m_min;
|
|
bool m_flipBits;
|
|
QString m_mode;
|
|
QString m_url;
|
|
};
|
|
|
|
#endif // CONFIGINTERFACE_H
|