[Development] Qt 6 not seeing the same DPI as Qt 5

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Mon Nov 29 18:09:16 CET 2021


Cheers,
Tor Arne

On 29 Nov 2021, at 17:41, Thiago Macieira <thiago.macieira at intel.com<mailto:thiago.macieira at intel.com>> wrote:

I'll probably have to report this as a bug, but just in case someone has seen
it before:

$ diff -u qtdiag5 qtdiag6
[...]
  Geometry: 1920x1200+0+0 (native: 3840x2400+0+0) Available: 1920x1200+0+0
  Virtual geometry: 5760x1200+0+0 Available: 5760x1200+0+0
  2 virtual siblings
-  Physical size: 288x180 mm  Refresh: 59.9939 Hz Power state: 0
-  Physical DPI: 169.333,169.333 Logical DPI: 120.118,120 (native:
240.236,240) Subpixel_None
+  Physical size: 406x228.6 mm  Refresh: 29.9806 Hz Power state: 0
+  Physical DPI: 120.118,120 Logical DPI: 96,96 Subpixel_None
  High DPI scaling factor: 2 DevicePixelRatio: 2

Qt 5 agrees with xrandr:
$ xrandr | grep eDP-1
eDP-1 connected primary 3840x2400+0+0 (normal left inverted right x axis y
axis) 288mm x 180mm

I start X with the "-dpi 240" setting, which gives me the best font size to
work on either display. Qt 5 obeys it just fine, dividing it by 2 because of
the scale factor, so my desktop looks fine. However, the one Qt 6 application
I use (Qt Creator) does not and has tiny fonts. I can override it with
QT_FONT_DPI=240 in the environment, but shouldn't have to.

That logical DPI of 96 makes zero sense. It's not physically correct and is
not part of the X config. Where is it coming from?

What's changed between 5 and 6?

https://doc-snapshots.qt.io/qt6-dev/highdpi.html#configuring-x11

Cheers,
Tor Arne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20211129/a53fd934/attachment.html>


More information about the Development mailing list