summaryrefslogtreecommitdiffstats
path: root/examples/network/http/httpwindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/http/httpwindow.h')
-rw-r--r--examples/network/http/httpwindow.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index f1dc2e1f80..cc632e5bab 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -41,39 +41,46 @@
#ifndef HTTPWINDOW_H
#define HTTPWINDOW_H
-#include <QDialog>
+#include <QProgressDialog>
#include <QNetworkAccessManager>
#include <QUrl>
QT_BEGIN_NAMESPACE
-class QDialogButtonBox;
class QFile;
class QLabel;
class QLineEdit;
-class QProgressDialog;
class QPushButton;
class QSslError;
class QAuthenticator;
class QNetworkReply;
-
+class QCheckBox;
QT_END_NAMESPACE
+class ProgressDialog : public QProgressDialog {
+ Q_OBJECT
+
+public:
+ explicit ProgressDialog(const QUrl &url, QWidget *parent = Q_NULLPTR);
+
+public slots:
+ void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
+};
+
class HttpWindow : public QDialog
{
Q_OBJECT
public:
- HttpWindow(QWidget *parent = 0);
+ explicit HttpWindow(QWidget *parent = Q_NULLPTR);
- void startRequest(QUrl url);
+ void startRequest(const QUrl &requestedUrl);
private slots:
void downloadFile();
void cancelDownload();
void httpFinished();
void httpReadyRead();
- void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
void enableDownloadButton();
void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
#ifndef QT_NO_SSL
@@ -81,19 +88,19 @@ private slots:
#endif
private:
+ QFile *openFileForWrite(const QString &fileName);
+
QLabel *statusLabel;
- QLabel *urlLabel;
QLineEdit *urlLineEdit;
- QProgressDialog *progressDialog;
QPushButton *downloadButton;
- QPushButton *quitButton;
- QDialogButtonBox *buttonBox;
+ QCheckBox *launchCheckBox;
+ QLineEdit *defaultFileLineEdit;
+ QLineEdit *downloadDirectoryLineEdit;
QUrl url;
QNetworkAccessManager qnam;
QNetworkReply *reply;
QFile *file;
- int httpGetId;
bool httpRequestAborted;
};