1

I inherited an old app developed in C++/Qt. When run on Windows machines with modern high-resolution screens, it gets displayed incorrectly (due to scaling). I figured out I can create a qt.conf file with the following contents and place it in executable directory:

[Platforms]
WindowsArguments = dpiawareness=0

The problem with this solution is that the config seems to get applied only for the first run. So when I place the qt.conf file in the bin folder and start the app for the first time, it gets displayed correctly. When I close the app and start it again, it gets displayed in scaled mode - seems like the config file is not getting applied any more. What's interesting, thought, if I rename the executable, once again the config gets applied on first run and discarded on another runs.

Any hints?

1 Answers1

0

I have not found any reason why is the qt.conf applied only for the first execution.

Anyway, since I have access to the source, following this thread I set the QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling) attribute and rebuilt the app. Works like a charm.