17#include "moc_qgsfiledownloaderdialog.cpp"
23 : mOutputFileName( outputFileName ),
26 setWindowTitle( tr(
"Download" ) );
27 setLabelText( tr(
"Downloading %1." ).arg( outputFileName ) );
43void QgsFileDownloaderDialog::onError(
const QStringList &errors )
45 QMessageBox::warning(
nullptr, tr(
"Download File" ), errors.join( QLatin1String(
"<br>" ) ) );
48void QgsFileDownloaderDialog::onDownloadProgress( qint64 bytesReceived, qint64 bytesTotal )
50 setMaximum( bytesTotal );
51 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.