Another rendering error at 125% scaling
A previous issue #2 (closed) worked around a rendering issue when QT_SCREEN_SCALE_FACTORS
is set to 1, but X11 DPI is set to 120.
I used to set them exactly like the above, and qpwgraph has been working well.
However, recently, I read that KDE plans to remove the DPI setting in Plasma 6 (See https://pointieststick.com/2023/07/26/what-we-plan-to-remove-in-plasma-6/). So I switched to a different setting. I don't set "Force Font DPI" any more, and set QT_SCREEN_SCALE_FACTORS
to 1.25. More concretely, the environment variable of my system is:
QT_SCREEN_SCALE_FACTORS=HDMI-0=1.25;DP-0=1.25;DP-1=1.25;DP-2=1.25;DP1=1.25;DP2=1.25;HDMI1=1.25;HDMI2=1.25;VIRTUAL1=1.25;
Most Qt5 and Qt6 applications, such as kate (Qt5), kcalc (Qt5), qmmp (Qt6), strawberry (Qt6) and QJackCtl (Qt6), work well. But in qpwgraph, the text and icon sizes are extra big. See the screenshot below. Other applications are running on the same screen so that you can compare the sizes.
I found the problem can be fixed by removing the following lines from the main
function.
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor);
#endif
I think we should remove those lines because we don't need this workaround in the future.