19 #include <QMessageBox> 22 : mOutputFileName( outputFileName ),
25 setWindowTitle( tr(
"Download" ) );
26 setLabelText( tr(
"Downloading %1." ).arg( outputFileName ) );
42 void QgsFileDownloaderDialog::onError(
const QStringList &errors )
44 QMessageBox::warning(
nullptr, tr(
"Download File" ), errors.join( QStringLiteral(
"<br>" ) ) );
47 void QgsFileDownloaderDialog::onDownloadProgress( qint64 bytesReceived, qint64 bytesTotal )
49 setMaximum( bytesTotal );
50 setValue( bytesReceived );
void startDownload()
Called to start the download.
static QString representFileSize(qint64 bytes)
Returns the human size from bytes.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Emitted when data are ready to be processed.
QgsFileDownloaderDialog(const QUrl &url, const QString &outputFileName, const QString &authcfg=QString())
QgsFileDownloader.
QgsFileDownloader is a utility class for downloading files.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Emitted when data are ready to be processed.
void downloadExited()
Emitted always when the downloader exits.
void downloadCanceled()
Emitted when the download was canceled by the user.
void downloadCompleted()
Emitted when the download has completed successfully.
void downloadError(QStringList errorMessages)
Emitted when an error makes the download fail.
void downloadCompleted()
Emitted when the download has completed successfully.
void downloadCanceled()
Emitted when the download was canceled by the user.
void downloadError(QStringList errorMessages)
Emitted when an error makes the download fail.
void cancelDownload()
Call to abort the download and delete this object after the cancelation has been processed.
void downloadExited()
Emitted always when the downloader exits.