QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgsfiledownloaderdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfiledownloaderdialog.h
3  --------------------------------------
4  Date : November 2016
5  Copyright : (C) 2016 by Alessandro Pasotti
6  Email : apasotti at boundlessgeo dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSFILEDOWNLOADERDIALOG_H
17 #define QGSFILEDOWNLOADERDIALOG_H
18 
19 #include <QProgressDialog>
20 #include "qgis_gui.h"
21 
22 class QgsFileDownloader;
23 
37 class GUI_EXPORT QgsFileDownloaderDialog : public QProgressDialog
38 {
39  Q_OBJECT
40  public:
41 
48  QgsFileDownloaderDialog( const QUrl &url, const QString &outputFileName, const QString &authcfg = QString() );
49 
50  signals:
58  void downloadError( QStringList errorMessages );
60  void downloadProgress( qint64 bytesReceived, qint64 bytesTotal );
61 
62  private slots:
63 
64  void onError( const QStringList &errors );
65  void onDownloadProgress( qint64 bytesReceived, qint64 bytesTotal );
66 
67  private:
68 
69  QString mOutputFileName;
70  QgsFileDownloader *mDownloader = nullptr;
71 
72 };
73 
74 #endif // QGSFILEDOWNLOADERDIALOG_H
QgsFileDownloaderDialog is a QProgressDialog subclass which handles file downloads and user feedback.
void downloadCompleted()
Emitted when the download has completed successfully.
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.