logthread.h 439 B

12345678910111213141516171819202122232425262728
  1. #ifndef LOGTHREAD_H
  2. #define LOGTHREAD_H
  3. #include <QThread>
  4. #include <QStringList>
  5. #include <QDate>
  6. #include <QDir>
  7. #include <QFile>
  8. class LogThread : public QThread
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit LogThread(QObject *parent = nullptr);
  13. void appendData(QString data);
  14. void run();
  15. void stop();
  16. signals:
  17. public slots:
  18. private:
  19. QFile *file;
  20. QStringList dataList;
  21. int day;
  22. bool keep;
  23. };
  24. #endif // LOGTHREAD_H