diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-01-05 16:47:57 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-01-05 15:57:06 +0000 |
commit | b5fe909571aff02bbd3d6cba8865c8eef36de9c7 (patch) | |
tree | f9b0b4ca795c5b9fd003d0e6ce717df214d46953 /tools/testcon/main.cpp | |
parent | e19cea07c1b98eeff3d77cf13abe3a6a482f2cf3 (diff) |
testcon: Better adapt to High DPI screens.
Resize main window and select dialog according to
available screen size.
Task-number: QTBUG-50206
Change-Id: I66fa527dceb19fab87ac84ee3063f5b84e487fb4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools/testcon/main.cpp')
-rw-r--r-- | tools/testcon/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testcon/main.cpp b/tools/testcon/main.cpp index dd6dc82..863a9e4 100644 --- a/tools/testcon/main.cpp +++ b/tools/testcon/main.cpp @@ -38,6 +38,7 @@ #include <QCommandLineParser> #include <QCommandLineOption> #include <QDebug> +#include <QDesktopWidget> QAXFACTORY_DEFAULT(MainWindow, QLatin1String("{5f5ce700-48a8-47b1-9b06-3b7f79e41d7c}"), @@ -87,6 +88,9 @@ int main( int argc, char **argv ) } if (parser.isSet(scriptOption)) mw.loadScript(parser.value(scriptOption)); + + const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mw); + mw.resize(availableGeometry.size() * 2 / 3); mw.show(); return app.exec();; |