filedownload.h 658 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef FILEDOWNLOAD_H
  2. #define FILEDOWNLOAD_H
  3. #include <QtCore>
  4. #include <QtNetwork>
  5. #include <QNetworkAccessManager>
  6. #include <QEventLoop>
  7. #include "configparser.h"
  8. #include "SNCCore_global.h"
  9. QT_BEGIN_NAMESPACE
  10. class QNetworkReply;
  11. QT_END_NAMESPACE
  12. #include <QThread>
  13. class SNCCORESHARED_EXPORT FileDownLoad : public QThread
  14. {
  15. Q_OBJECT
  16. public:
  17. explicit FileDownLoad(QString url);
  18. protected:
  19. void run();
  20. signals:
  21. void downloadFinished(QString content);
  22. public slots:
  23. void replyFinished(QNetworkReply *reply);
  24. private:
  25. QString url;
  26. QString file_content;
  27. bool stop;
  28. };
  29. #endif // FILEDOWNLOAD_H