forked from qt-creator/qt-creator
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>
29 lines
837 B
C++
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();
|
|
}
|