Avoiding DPI awareness in QtApplication for Windows

I have a QtWebKit application and I want to avoid understanding DPI. I tried to add the manifest as described on MSDN , but it only worked on Windows 8.1 (not on Windows 8 and lower versions.)

Checking the Qt source code (4.7) I found the qapplication_win.cppfollowing snippet inside the file :

// Notify Vista and Windows 7 that we support highter DPI settings
ptrSetProcessDPIAware = (PtrSetProcessDPIAware)
    QLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware");
if (ptrSetProcessDPIAware)
    ptrSetProcessDPIAware();

See Commit for more information.

However, I really don’t know why it works in Windows 8.1 and, more importantly, how can I disable this Qt function ... any Macro / Qt API that I should use?

+4
source share

Source: https://habr.com/ru/post/1533624/


All Articles