[qet] qet/qet: [4962] Set HDPI scaling to disable |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4962
Author: scorpio810
Date: 2017-05-18 02:24:42 +0200 (Thu, 18 May 2017)
Log Message:
-----------
Set HDPI scaling to disable
Modified Paths:
--------------
trunk/sources/main.cpp
Modified: trunk/sources/main.cpp
===================================================================
--- trunk/sources/main.cpp 2017-05-17 14:21:52 UTC (rev 4961)
+++ trunk/sources/main.cpp 2017-05-18 00:24:42 UTC (rev 4962)
@@ -31,8 +31,14 @@
QCoreApplication::setOrganizationDomain("qelectrotech.org");
QCoreApplication::setApplicationName("QElectroTech");
//Creation and execution of the application
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
-QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-#endif
+#ifdef Q_OS_WIN
+ SetProcessDPIAware(); // call before the main event loop
+#endif // Q_OS_WIN
+
+#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
+ QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
+#else
+ qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("1"));
+#endif // QT_VERSION
return(QETApp(argc, argv).exec());
}