123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef HTTPTHREAD_H
- #define HTTPTHREAD_H
- #include <QObject>
- #include <QDateTime>
- #include <QTimer>
- #include <QNetworkAccessManager>
- #include <QNetworkRequest>
- #include <QNetworkReply>
- #include <QSslConfiguration>
- #include <QJsonDocument>
- #include <QJsonArray>
- #include <QJsonObject>
- #include <QJsonValue>
- #include <QJsonParseError>
- #include "../QReplyTimeout.h"
- class HttpThread : public QObject
- {
- Q_OBJECT
- public:
- explicit HttpThread(QObject *parent = nullptr);
- void run();
- void stop();
- void app_info(QString url,QString key,QString signature);
- signals:
- void dataLog(QString log);
- void mqttData(QString mqtt_msg);
- public slots:
- void time_out();
- void finishedSlot(QNetworkReply *reply);
- void reply_timeout();
- private:
- bool isWaiting;
- bool keep;
- int minute,hour;
- QNetworkAccessManager *networkManager;
- QSslConfiguration config;
- QTimer *timer;
- QString url, key, signature;
- };
- #endif // HTTPTHREAD_H
|