1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/network/qgsfiledownloader.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsFileDownloader : QObject
{
%Docstring(signature="appended")
:py:class:`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.
.. note::
This class was part of the GUI library from QGIS 2.18.1 until QGIS 3.0
%End
%TypeHeaderCode
#include "qgsfiledownloader.h"
%End
public:
QgsFileDownloader( const QUrl &url, const QString &outputFileName, const QString &authcfg = QString(), bool delayStart = false, Qgis::HttpMethod httpMethod = Qgis::HttpMethod::Get, const QByteArray &data = QByteArray() );
%Docstring
QgsFileDownloader
:param url: the download URL
:param outputFileName: file name where the downloaded content will be
stored
:param authcfg: optionally apply this authentication configuration
:param delayStart: if ``True``, the download will not be commenced
immediately and must be triggered by a later call to
:py:func:`~QgsFileDownloader.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.
:param httpMethod: Method for the HTTP request : GET or POST, since QGIS
3.22
:param data: If the request is POST, some data can be added, since QGIS
3.22
%End
signals:
void downloadCompleted( const QUrl &url );
%Docstring
Emitted when the download has completed successfully
%End
void downloadExited();
%Docstring
Emitted always when the downloader exits
%End
void downloadCanceled();
%Docstring
Emitted when the download was canceled by the user.
.. seealso:: :py:func:`cancelDownload`
%End
void downloadError( QStringList errorMessages );
%Docstring
Emitted when an error makes the download fail
%End
void downloadProgress( qint64 bytesReceived, qint64 bytesTotal );
%Docstring
Emitted when data are ready to be processed
%End
public slots:
void cancelDownload();
%Docstring
Call to abort the download and delete this object after the cancellation
has been processed.
.. seealso:: :py:func:`downloadCanceled`
%End
void startDownload();
%Docstring
Called to start the download
%End
protected:
~QgsFileDownloader();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/network/qgsfiledownloader.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|