filedownloader.h 595 B

1234567891011121314151617181920212223242526272829
  1. #ifndef INCLUDEILEDOWNLOADER_H
  2. #define INCLUDEILEDOWNLOADER_H
  3. #include <QObject>
  4. #include <QByteArray>
  5. #include <QNetworkAccessManager>
  6. #include <QNetworkRequest>
  7. #include <QNetworkReply>
  8. class FileDownloader : public QObject
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit FileDownloader(QUrl url, QObject *parent = 0);
  13. virtual ~FileDownloader();
  14. QByteArray DownloadedData() const;
  15. signals:
  16. void downloaded();
  17. private slots:
  18. void FileDownloaded(QNetworkReply* pReply);
  19. private:
  20. QNetworkAccessManager m_WebCtrl;
  21. QByteArray m_DownloadedData;
  22. };
  23. #endif // INCLUDEILEDOWNLOADER_H