Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.15.2, 6.1.2, 6.2.0 Beta3
-
Fix Version/s: None
-
Component/s: GUI: High-DPI
-
Labels:None
-
Environment:Broken: Arch Linux, KDE X11, Qt 6.1.2 from Arch, and Qt 6.2.0 beta3 from web installer
Working: Windows 10 x64, Qt 6.2.0 beta3 from web installer
-
Platform/s:
Description
On Linux (Arch Linux KDE X11 with global fractional scaling enabled), calling QGuiApplication::setHighDpiScaleFactorRoundingPolicy() with a rounding mode fails to change the actual DPI rounding policy. QImage/QPixmap is still painted with non-uniform pixel sizes, and QWidget::devicePixelRatio() is still a non-integer. Fetching the policy using QGuiApplication::highDpiScaleFactorRoundingPolicy() still returns the rounding mode you set, but it doesn't change the app's behavior.
On Windows, this function works as expected.
Test app at https://github.com/nyanpasu64/qt6-dpi-fail/tree/device-pixel-ratio (note, not master branch). It calls QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor) and clicking the button prints the current rounding policy and devicePixelRatio. On Windows it's "RoundPreferFloor -> 1", and on Linux it's "RoundPreferFloor -> 1.25".
EDIT: This issue occurs on any environment where the scale factor is set through QScreen's "_q_scaleFactor" property or the QT_SCREEN_SCALE_FACTORS environment variable, and not on environments where the platform plugin supplies the scale factor.
Attachments
Issue Links
- relates to
-
QTBUG-99546 QT_SCREEN_SCALE_FACTORS doesn't follow rounding policy
-
- Reported
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-95930 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
412296,3 | Apply ScaleFactorRoundingPolicy to QT_SCREEN_SCALE_FACTORS | dev | qt/qtbase | Status: NEW | +1 | 0 |