Files
qt-creator/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp
Alessandro Portale 8c3bd61594 Qt Quick Application wizards: Qt::AA_EnableHighDpiScaling only on WIN
Setting Qt::AA_EnableHighDpiScaling causes a few graphics backends to
malfunction. This patch reduced the setting of the flag to happen only
on Windows (it is automatically set on macOS with retina).

Task-number: QTBUG-64815
Change-Id: I08fa5d1bd2c93e7a39c23487b684bd3f7b358783
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
2017-11-28 13:36:29 +00:00

27 lines
714 B
C++

%{Cpp:LicenseTemplate}\
%{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)
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();
}