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 | |
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')
-rw-r--r-- | tools/testcon/main.cpp | 4 | ||||
-rw-r--r-- | tools/testcon/mainwindow.ui | 8 |
2 files changed, 4 insertions, 8 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();; diff --git a/tools/testcon/mainwindow.ui b/tools/testcon/mainwindow.ui index da39df5..979092d 100644 --- a/tools/testcon/mainwindow.ui +++ b/tools/testcon/mainwindow.ui @@ -38,14 +38,6 @@ <property name="objectName" > <string notr="true" >MainWindow</string> </property> - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>929</width> - <height>620</height> - </rect> - </property> <property name="windowTitle" > <string>ActiveX Control Test Container</string> </property> |