databaseeventthread.h 567 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef DATABASEEVENTTHREAD_H
  2. #define DATABASEEVENTTHREAD_H
  3. #include <QThread>
  4. #include <QDateTime>
  5. #include <QSqlDatabase>
  6. #include <QSqlQuery>
  7. #include <QVariant>
  8. #include <QStringList>
  9. class DatabaseEventThread : public QThread
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit DatabaseEventThread(QObject *parent = nullptr);
  14. void run();
  15. void stop();
  16. void appendSql(QString sql);
  17. signals:
  18. void dbdata_log(QString log);
  19. public slots:
  20. private:
  21. int hour;
  22. bool keep;
  23. QSqlDatabase db;
  24. QStringList sqlList;
  25. };
  26. #endif // DATABASEEVENTTHREAD_H