Qt 5.10 Book Examples
Downloader.h
Go to the documentation of this file.
1 // ======================================================================
2 // Downloader.h
3 // ======================================================================
4 // This file is a part of the book
5 // "Qt 5.10 Professional programming with C++"
6 // http://qt-book.com
7 // ======================================================================
8 // Copyright (c) 2017 by Max Schlee
9 // ======================================================================
10 
11 #pragma once
12 
13 #include <QObject>
14 #include <QUrl>
15 
16 class QNetworkAccessManager;
17 class QNetworkReply;
18 
19 // ======================================================================
20 class Downloader : public QObject {
21 Q_OBJECT
22 
23 private:
24  QNetworkAccessManager* m_pnam;
25 
26 public:
27  Downloader(QObject* pobj = 0);
28 
29  void download(const QUrl&);
30 
31 signals:
32  void downloadProgress(qint64, qint64 );
33  void done (const QUrl&, const QByteArray&);
34  void error ( );
35 
36 private slots:
37  void slotFinished(QNetworkReply*);
38 };
39 
void downloadProgress(qint64, qint64)
void download(const QUrl &)
Definition: Downloader.cpp:24
Downloader(QObject *pobj=0)
Definition: Downloader.cpp:15
void done(const QUrl &, const QByteArray &)
void error()