httpthread.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef HTTPTHREAD_H
  2. #define HTTPTHREAD_H
  3. #include <QObject>
  4. #include <QDateTime>
  5. #include <QTimer>
  6. #include <QNetworkAccessManager>
  7. #include <QNetworkRequest>
  8. #include <QNetworkReply>
  9. #include <QSslConfiguration>
  10. #include <QJsonDocument>
  11. #include <QJsonArray>
  12. #include <QJsonObject>
  13. #include <QJsonValue>
  14. #include <QJsonParseError>
  15. #include "../QReplyTimeout.h"
  16. class HttpThread : public QObject
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit HttpThread(QObject *parent = nullptr);
  21. void run();
  22. void stop();
  23. signals:
  24. void dataLog(QString log);
  25. void mqttData(QString mqtt_msg);
  26. void mqttEvent(QString mqtt_event);
  27. void appendSql(QString sql);
  28. public slots:
  29. void time_out();
  30. void finishedSlot(QNetworkReply *reply);
  31. void finishedSlot1(QNetworkReply *reply);
  32. void reply_timeout();
  33. void reply_timeout1();
  34. private:
  35. bool isWaiting,isWaiting1;
  36. bool keep;
  37. int minute,hour,minute1;
  38. QList<QString> roomList;
  39. QString startTime;
  40. QString endTime;
  41. QNetworkAccessManager *networkManager,*networkManager1;
  42. QSslConfiguration config;
  43. QTimer *timer;
  44. };
  45. #endif // HTTPTHREAD_H