[Development] Updated high-DPI support for Qt 5.14

Morten Sørvig Morten.Sorvig at qt.io
Fri Sep 27 19:51:00 CEST 2019



> On 27 Sep 2019, at 17:04, Thiago Macieira <thiago.macieira at intel.com> wrote:
> 
> On Friday, 27 September 2019 03:56:44 PDT Morten Sørvig wrote:
>> Configuring Windows is a good example here: you set the slider to one of
>> 100% - 125% - 150% - 175% - 200% depending on monitor pixel density and
>> viewing distance. There’s then a single value to configure.
> 
> Well, that's a good example: setting a factor, not the absolute value.

Yes, agreed. A factor is better UI than an absolute value. We are talking
about DPI at lest partly for historical reasons: the windows percentage setting
has always been reported as logical DPI by QPlatformScreen::logicalDpi(), and
that has not changed. 

> 
>>> Moreover, I can have two different monitors connected to the same output
>>> (at different times, of course). Since they have different DPI, the
>>> multiplicative factor allows me to set it once for both, but if I set a
>>> DPI setting, it'll likely be wrong for at least one of them.
>> 
>> Yes, we need per-monitor settings (DPI or scale).
> 
> The problem on that one is that you're forcing me to keep a value per each 
> individual monitor I connect to regularly. With the laptop's display panel, 
> that's 4 or 5. Since they are different actual monitors, each has their own 
> DPI value, which is obtained by Qt. And some monitors report wildly incorrect 
> DPI values, like a 27" monitor saying it's 160x90mm in size. So what's the 
> policy for a brand new monitor we connect to (say, a projector in a conference 
> room)? Does it: 
> a) keep the physical one from the monitor? 
> b) use 96x96? 
> c) use one of the other monitor's settings? 
> (hint: a, b and c are wrong)
> 
> Right now, I need exactly two values: the display panel's multiplicative 
> factor of 2 and the external output's multiplicative factor of 2.

Right, I think I see what you are doing now (maybe). But what about non-Qt apps? Do
you configure them manually as well?

If this logic could be contained within the XCB platform plugin, and the result
reported to QtGui via QPlatformScreen::logicalDpi(), then I would be happy. (And,
setHighDpiScaleFactorRoundingPolicy could work as documented, too).

Morten

> 
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel System Software Products
> 
> 
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development



More information about the Development mailing list