Revert "GH-3666 Fix multi-monitor dpi scaling on windows"

This reverts commit 34bf688479.
This commit is contained in:
Petr Mrázek 2021-03-28 19:46:01 +02:00
parent 5400d4e613
commit 43cf647642

View File

@ -4,10 +4,6 @@
#include <InstanceList.h> #include <InstanceList.h>
#include <QDebug> #include <QDebug>
#ifdef Q_OS_WIN
#include<windows.h>
#endif
// #define BREAK_INFINITE_LOOP // #define BREAK_INFINITE_LOOP
// #define BREAK_EXCEPTION // #define BREAK_EXCEPTION
// #define BREAK_RETURN // #define BREAK_RETURN
@ -33,19 +29,7 @@ int main(int argc, char *argv[])
#endif #endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
#ifdef Q_OS_WIN QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
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); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif #endif