QGIS API Documentation
3.6.0-Noosa (5873452)
|
QgsFileDownloader is a utility class for downloading files. More...
#include <qgsfiledownloader.h>
Public Slots | |
void | cancelDownload () |
Call to abort the download and delete this object after the cancelation has been processed. More... | |
void | startDownload () |
Called to start the download. More... | |
Signals | |
void | downloadCanceled () |
Emitted when the download was canceled by the user. More... | |
void | downloadCompleted () |
Emitted when the download has completed successfully. More... | |
void | downloadError (QStringList errorMessages) |
Emitted when an error makes the download fail. More... | |
void | downloadExited () |
Emitted always when the downloader exits. More... | |
void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
Emitted when data are ready to be processed. More... | |
Public Member Functions | |
QgsFileDownloader (const QUrl &url, const QString &outputFileName, const QString &authcfg=QString(), bool delayStart=false) | |
QgsFileDownloader. More... | |
Protected Member Functions | |
~QgsFileDownloader () override | |
QgsFileDownloader is a utility class for downloading files.
To use this class, it is necessary to pass the URL and an output file name as arguments to the constructor, the download will start immediately.
The download is asynchronous.
The object will destroy itself when the request completes, errors or is canceled. An optional authentication configuration can be specified.
Definition at line 43 of file qgsfiledownloader.h.
QgsFileDownloader::QgsFileDownloader | ( | const QUrl & | url, |
const QString & | outputFileName, | ||
const QString & | authcfg = QString() , |
||
bool | delayStart = false |
||
) |
url | the download url |
outputFileName | file name where the downloaded content will be stored |
authcfg | optionally apply this authentication configuration |
delayStart | if true, the download will not be commenced immediately and must be triggered by a later call to startDownload(). This can be useful if connections need to be made to the downloader and there's a chance the download will emit signals before these connections have been made. |
Definition at line 28 of file qgsfiledownloader.cpp.
|
overrideprotected |
Definition at line 39 of file qgsfiledownloader.cpp.
|
slot |
Call to abort the download and delete this object after the cancelation has been processed.
Definition at line 84 of file qgsfiledownloader.cpp.
|
signal |
Emitted when the download was canceled by the user.
|
signal |
Emitted when the download has completed successfully.
|
signal |
Emitted when an error makes the download fail.
|
signal |
Emitted always when the downloader exits.
|
signal |
Emitted when data are ready to be processed.
|
slot |
Called to start the download.
Definition at line 49 of file qgsfiledownloader.cpp.