52 lines
1.3 KiB
C++
52 lines
1.3 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(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);
|
|
|
|
signals:
|
|
void configData(QString max, QString min, QString alert, bool flipbits);
|
|
void alertChanged();
|
|
void maxChanged();
|
|
void minChanged();
|
|
|
|
void flipBitsChanged();
|
|
|
|
public slots:
|
|
void saveConfig(QString max, QString min, QString alert, bool flipbits);
|
|
private:
|
|
QString m_alert;
|
|
QString m_max;
|
|
QString m_min;
|
|
bool m_flipBits;
|
|
};
|
|
|
|
#endif // CONFIGINTERFACE_H
|