QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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
23
36class GUI_EXPORT QgsFileDownloaderDialog : public QProgressDialog
37{
38 Q_OBJECT
39 public:
40
47 QgsFileDownloaderDialog( const QUrl &url, const QString &outputFileName, const QString &authcfg = QString() );
48
49 signals:
57 void downloadError( QStringList errorMessages );
59 void downloadProgress( qint64 bytesReceived, qint64 bytesTotal );
60
61 private slots:
62
63 void onError( const QStringList &errors );
64 void onDownloadProgress( qint64 bytesReceived, qint64 bytesTotal );
65
66 private:
67
68 QString mOutputFileName;
69 QgsFileDownloader *mDownloader = nullptr;
70
71};
72
73#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.