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( QLatin1String(
"<br>" ) ) );
47 void QgsFileDownloaderDialog::onDownloadProgress( qint64 bytesReceived, qint64 bytesTotal )
49 setMaximum( bytesTotal );
50 setValue( bytesReceived );
void downloadCompleted()
Emitted when the download has completed successfully.
QgsFileDownloaderDialog(const QUrl &url, const QString &outputFileName, const QString &authcfg=QString())
QgsFileDownloader.
void downloadExited()
Emitted always when the downloader exits.
void downloadError(QStringList errorMessages)
Emitted when an error makes the download fail.
void downloadCanceled()
Emitted when the download was canceled by the user.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Emitted when data are ready to be processed.
QgsFileDownloader is a utility class for downloading files.
void cancelDownload()
Call to abort the download and delete this object after the cancellation has been processed.
void downloadExited()
Emitted always when the downloader exits.
void downloadCanceled()
Emitted when the download was canceled by the user.
void downloadError(QStringList errorMessages)
Emitted when an error makes the download fail.
void startDownload()
Called to start the download.
void downloadCompleted(const QUrl &url)
Emitted when the download has completed successfully.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Emitted when data are ready to be processed.
static QString representFileSize(qint64 bytes)
Returns the human size from bytes.