Files
qt-creator/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp
Alessandro Portale a53df3892a 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 8c3bd61594 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>
2017-12-11 10:16:25 +00:00

29 lines
837 B
C++

%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
int main(int argc, char *argv[])
{
@if %{UseVirtualKeyboard}
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
@endif
@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
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}