diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2017-12-01 15:26:27 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2017-12-11 10:16:25 +0000 |
commit | a53df3892a70f99910cfd085f2f2feca9e17d081 (patch) | |
tree | 7889c47e3e85989bcce35f472fe2992e8e717f6a | |
parent | 7df3bff07ad07913744f0dcf4bddf3905bb3d9ba (diff) |
Qt Quick Application wizards: No AA_EnableHighDpiScaling on Simulator
Avoid setting Qt::AA_EnableHighDpiScaling when running in the simulator.
Simulator detection is done by testing whether environment variable
QTGLESSTREAM_DISPLAY is set.
This amends 8c3bd6159436d099127bd9cbb8271be8e18f95a5 where all platforms
except Windows were excluded from setting the flag.
Task-number: QTBUG-64815
Change-Id: I8ab7ba9f24217915dc1d01e1f2eb5c37923c5504
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
-rw-r--r-- | share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp b/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp index 500db3de63..986dcd606f 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp @@ -2,18 +2,20 @@ %{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])} int main(int argc, char *argv[]) { -@if %{SetQPAPhysicalSize} - qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); - qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); - -@endif @if %{UseVirtualKeyboard} qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); @endif -#if defined(Q_OS_WIN) +@if %{SetQPAPhysicalSize} + if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { + qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); + qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); + + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + } +@else QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#endif +@endif QGuiApplication app(argc, argv); |