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

Thiago Macieira thiago.macieira at intel.com
Mon Nov 29 17:41:48 CET 2021


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?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Development mailing list