qtdownload.h 497 B

123456789101112131415161718192021222324252627
  1. #include <QObject>
  2. #include <QString>
  3. #include <QtNetwork/QNetworkAccessManager>
  4. #include <QtNetwork/QNetworkReply>
  5. class QtDownload : public QObject {
  6. Q_OBJECT
  7. public:
  8. explicit QtDownload();
  9. ~QtDownload();
  10. void setTarget(const QString& t);
  11. private:
  12. QNetworkAccessManager manager;
  13. QString target;
  14. signals:
  15. void done();
  16. public slots:
  17. void download();
  18. void downloadFinished(QNetworkReply* data);
  19. void downloadProgress(qint64 recieved, qint64 total);
  20. };