Disable DPI scaling in QT 6?
-
Greetings,
Is there any way to disable DPI scaling in QT 6?
Thank you,
-
Yes, it's possible, using environment variables.
Not sure about other platforms, but on Windows, setting following environment variables before launching your program works fine:
set QT_ENABLE_HIGHDPI_SCALING=0 set QT_FONT_DPI=96
The first variable disables DPI scaling: i.e. widgets and
QPainter
will not do any scaling - 1 px line will be one physical pixel wide on the screen.The second variable disables scaling of fonts.
-
Yes, it's possible, using environment variables.
Not sure about other platforms, but on Windows, setting following environment variables before launching your program works fine:
set QT_ENABLE_HIGHDPI_SCALING=0 set QT_FONT_DPI=96
The first variable disables DPI scaling: i.e. widgets and
QPainter
will not do any scaling - 1 px line will be one physical pixel wide on the screen.The second variable disables scaling of fonts.
@martin_ky That's what I've been doing for the app I'm developing, can this cause any problems for non resizable apps?