first commit
This commit is contained in:
commit
9bfa1e11fe
1 changed files with 1751 additions and 0 deletions
45
configinterface.h
Normal file
45
configinterface.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#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)
|
||||
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);
|
||||
|
||||
signals:
|
||||
void configData(QString max, QString min, QString alert);
|
||||
void alertChanged();
|
||||
void maxChanged();
|
||||
void minChanged();
|
||||
|
||||
public slots:
|
||||
void saveConfig(QString max, QString min, QString alert);
|
||||
private:
|
||||
QString m_alert;
|
||||
QString m_max;
|
||||
QString m_min;
|
||||
};
|
||||
|
||||
#endif // CONFIGINTERFACE_H
|
||||
Loading…
Reference in a new issue