[Development] Qt 6 not seeing the same DPI as Qt 5
Tor Arne Vestbø
Tor.arne.Vestbo at qt.io
Mon Nov 29 22:20:58 CET 2021
On 29 Nov 2021, at 19:05, Thiago Macieira <thiago.macieira at intel.com<mailto:thiago.macieira at intel.com>> wrote:
On Monday, 29 November 2021 09:09:16 PST Tor Arne Vestbø wrote:
What's changed between 5 and 6?
https://doc-snapshots.qt.io/qt6-dev/highdpi.html#configuring-x11
Thanks, Tor Arne. I see in the link that the RandR physical DPI is marked "Qt
5 only". Why did we remove this?
It wasn’t removed per se, but we no longer pick it up by default.
The rationale for that was that physical DPI is not the same as logical DPI, plus that physical DPI reporter by RandR may sometimes be wildly inaccurate, giving surprising results for users if we picked it up.
If you know that the physical DPI being reported is correct you can use QT_USE_PHYSICAL_DPI to override the behavior as documented.
Sadly X doesn’t expose any per-monitor logical DPI. Some desktop environments solve it pretending like everything is rendered at 2x, with an Xft.dpi that matches, and then downscaling to the target monitor.
We tried to open a discussion about how to treat the various X DPI settings, logical or physical, in https://lists.x.org/archives/xorg-devel/2020-September/058612.html, but sadly I got pulled in to other stuff and wasn’t able to follow up, and there wasn’t any reply from the X core developers, so it stalled.
If we change things in Qt I would prefer to align how Qt behaves in this regard with a clear authoritative guideline from the X people on how to interpret each setting, and preferably this would be aligned across toolkits as well.
Cheers,
Tor Arne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20211129/e0a8825a/attachment.html>
More information about the Development
mailing list