#ifndef DATABASETHREAD_H
#define DATABASETHREAD_H

#include <QThread>
#include <QDateTime>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QVariant>
#include <QStringList>


class DatabaseThread : public QThread
{
    Q_OBJECT
public:
    explicit DatabaseThread(QObject *parent = nullptr);
    void run();
    void stop();
    void appendSql(QString sql);
    void appendAlarm(QString sql);


signals:
    void mqtt_conf(QString ip,QString port,QString username,QString password);
    void dbdata_log(QString log);

public slots:

private:
    int hour;
    bool keep;

    QSqlDatabase db;
    QStringList sqlList,alarmList;

};

#endif // DATABASETHREAD_H
