etNetworkTest.h 760 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef ETNETWORKTEST_H
  2. #define ETNETWORKTEST_H
  3. #include <QWidget>
  4. #include <thread>
  5. #include <mutex>
  6. #include "CHttpBll.h"
  7. namespace Ui {
  8. class etNetworkTest;
  9. }
  10. class etNetworkTest : public QWidget
  11. {
  12. Q_OBJECT
  13. signals:
  14. void checkInfo(QString speed, QString sTime);
  15. public:
  16. explicit etNetworkTest(QWidget *parent = nullptr);
  17. ~etNetworkTest();
  18. int setUI(const int nLeft, const int nTop, const int nWidth);
  19. int widgetHeight();
  20. int getCheckStatus();//0:false 1:true 2:未检测
  21. private:
  22. void threadProc();
  23. Ui::etNetworkTest *ui;
  24. std::thread m_thread;
  25. bool m_bIsRun;
  26. bool bSpeedPass;
  27. bool bDelayPass;
  28. const QString sAudioUrl = "https://ecs-static.qmth.com.cn/check-audio.mp3";
  29. };
  30. #endif // ETNETWORKTEST_H