QGIS API Documentation  3.6.0-Noosa (5873452)
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:
52  void downloadCompleted();
54  void downloadExited();
56  void downloadCanceled();
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
QgsFileDownloader is a utility class for downloading files.
QgsFileDownloaderDialog is a QProgressDialog subclass which handles file downloads and user feedback...