Set HDPI scaling to disable

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4962 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2017-05-18 00:24:42 +00:00
parent 1dd8b2a4db
commit e02aaab4a7

View File

@@ -31,8 +31,14 @@ int main(int argc, char **argv)
QCoreApplication::setOrganizationDomain("qelectrotech.org"); QCoreApplication::setOrganizationDomain("qelectrotech.org");
QCoreApplication::setApplicationName("QElectroTech"); QCoreApplication::setApplicationName("QElectroTech");
//Creation and execution of the application //Creation and execution of the application
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) #ifdef Q_OS_WIN
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); SetProcessDPIAware(); // call before the main event loop
#endif #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()); return(QETApp(argc, argv).exec());
} }