datasender.h 699 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef DATASENDER_H
  2. #define DATASENDER_H
  3. #include <QObject>
  4. #include <QUrl>
  5. #include <QNetworkAccessManager>
  6. #include <QNetworkRequest>
  7. #include <QNetworkReply>
  8. #include <QTimer>
  9. #include <json-c/json.h>
  10. #include "../ytCore/yt_unit_shm.h"
  11. #include "QReplyTimeout.h"
  12. class DataSender : public QObject
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit DataSender(QObject *parent = 0,QString serverPath="", QString id="");
  17. signals:
  18. public slots:
  19. void time_out();
  20. void query_finishedSlot(QNetworkReply *reply);
  21. void reply_timeout();
  22. private:
  23. bool waitting;
  24. QString ServerPath;
  25. QString SelfId;
  26. QTimer *timer;
  27. QNetworkAccessManager *queryManager;
  28. };
  29. #endif // DATASENDER_H