diff --git a/sources/main.cpp b/sources/main.cpp index d9fc1bcc4..7440e0099 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -31,8 +31,14 @@ int main(int argc, char **argv) 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()); }