summaryrefslogtreecommitdiffstats
path: root/examples/network/http/httpwindow.h
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-03 15:26:34 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-03 15:51:20 +0200
commit5591e821358b9111c79336a66eac4d04bb5811ba (patch)
tree4b4c1da4f5ccaead1cf4f487622de1d0b242b0b9 /examples/network/http/httpwindow.h
parente4079eca49adce16e31dac2a18d49d7a55817891 (diff)
parentca0c9f82cbf7c8c37acdcbdfdc3fa0c5fc138059 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'examples/network/http/httpwindow.h')
-rw-r--r--examples/network/http/httpwindow.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index 20ad2bb4da..f7bd0047de 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -55,6 +55,8 @@
#include <QNetworkAccessManager>
#include <QUrl>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QFile;
class QLabel;
@@ -72,6 +74,7 @@ class ProgressDialog : public QProgressDialog {
public:
explicit ProgressDialog(const QUrl &url, QWidget *parent = nullptr);
+ ~ProgressDialog();
public slots:
void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
@@ -83,6 +86,7 @@ class HttpWindow : public QDialog
public:
explicit HttpWindow(QWidget *parent = nullptr);
+ ~HttpWindow();
void startRequest(const QUrl &requestedUrl);
@@ -98,7 +102,7 @@ private slots:
#endif
private:
- QFile *openFileForWrite(const QString &fileName);
+ std::unique_ptr<QFile> openFileForWrite(const QString &fileName);
QLabel *statusLabel;
QLineEdit *urlLineEdit;
@@ -110,7 +114,7 @@ private:
QUrl url;
QNetworkAccessManager qnam;
QNetworkReply *reply;
- QFile *file;
+ std::unique_ptr<QFile> file;
bool httpRequestAborted;
};