diff --git a/application/main.cpp b/application/main.cpp index b0360c7e4..e29f34532 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -4,6 +4,10 @@ #include #include +#ifdef Q_OS_WIN + #include +#endif + // #define BREAK_INFINITE_LOOP // #define BREAK_EXCEPTION // #define BREAK_RETURN @@ -29,7 +33,19 @@ int main(int argc, char *argv[]) #endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #ifdef Q_OS_WIN + BOOL (__stdcall *pFn)(void); + HINSTANCE hInstance=LoadLibrary("user32.dll"); + if(hInstance) { + pFn = (BOOL (__stdcall*)(void))GetProcAddress(hInstance, "SetProcessDPIAware"); + if(pFn) + pFn(); + FreeLibrary(hInstance); + } + QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + #else + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #endif QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif