[Development] [HiDPI] Rethinking the scaling algorithm

Morten Sorvig Morten.Sorvig at qt.io
Thu Nov 10 10:43:08 CET 2016


> On 9 Nov 2016, at 23:25, Allan Sandfeld Jensen <kde at carewolf.com> wrote:
> 
> 
> Since most of the common configuration of HiDPI screens are following Mac 
> standards, they have been designed to work at 2x scaling with 72DPI. We can 
> not ignore all the Apple style screens out there like 4k 27" screen for 
> instance. Which are specifically designed for 2x scaling. 144DPI must cause 2x 
> scaling to follow what most HiDPI hardware have been designed for.
> 
> What we need is a better tool and configuration for high-DPI tablets, phones 
> and hybrids where the ideal virtual DPI is not 72 or 96 DPI.

On the other hand, Windows 200% must also result in 2x scaling. And windows
will return 2 * 96 DPI for that case.

What I have in my patches is API where the platform plugin reports the base DPI
in addition to the current DPI. So in the Windows case the values would be 96
and 192, respectively. See https://codereview.qt-project.org/#/c/157174 .

In theory, a platform like Android could then return its base DPI of 160 along 
with the current DPI, and we would apply the correct scale factor according
to the device class. (In practice I think the Android platform plugin currently
normalizes the base DPI to 96)

Would this allow enough configurability to handle your 4K 27” case? We have user
API for setting the DPI (QT_FONT_DPI) as well, but this is currently a global
setter and not that useful for multi-screen setups.


Morten



More information about the Development mailing list