From d482a92858f181c76229dc977ee9c159ba36515f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 17 Sep 2015 15:56:30 +0200 Subject: Polish the HTTP example. - Remove unneeded member variables. - Use new connection syntax. - Streamline code. - Add a QCheckBox for launching the file after download and make the default file name and download directory configureable. - Make status messages more verbose. - Set Password echo mode on authentication dialog. - Extract the progress dialog to a separate class that is directly connected to the QNetworkReply, which is created on demand. Set set minimum and duration on it. This fixes a crash that currently occurs when clicking "Abort" on the SSL error dialog and "Cancel" on the progress dialog that is then re-shown due to its internal force timer/minimum duration handling. - Resize according to screen size. Task-number: QTBUG-48332 Change-Id: Ia2611e63fe96d6f49e4cdd06049a206ddb2c2864 Reviewed-by: David Faure --- examples/network/http/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/network/http/main.cpp') diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp index 5857af265cc..b4960008ec2 100644 --- a/examples/network/http/main.cpp +++ b/examples/network/http/main.cpp @@ -39,6 +39,7 @@ ****************************************************************************/ #include +#include #include #include "httpwindow.h" @@ -47,8 +48,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - HttpWindow httpWin; + const QRect availableSize = QApplication::desktop()->availableGeometry(&httpWin); + httpWin.resize(availableSize.width() / 5, availableSize.height() / 5); + httpWin.move((availableSize.width() - httpWin.width()) / 2, (availableSize.height() - httpWin.height()) / 2); httpWin.show(); return app.exec(); -- cgit v1.2.3