[Development] Bringing Qt's high-dpi support to more platforms

Ziller Eike Eike.Ziller at digia.com
Mon May 26 07:59:03 CEST 2014


On May 23, 2014, at 6:03 PM, md at rpzdesign.com wrote:

> Sorvig:
> 
>> From the latest new front:
> 
> http://bgr.com/2014/03/18/nexus-9-specs-details/
> 
> Digitimes on Tuesday cited its own research arm in reporting that Google
> will launch two new Nexus tablets in 2014. In addition to an updated
> Nexus 7, Google is reportedly prepping a new 8.9-inch Nexus tablet that
> will feature a Retina-busting screen with better-than-2K resolution.
> 
> So will your HIGH DPI modification support the coming high res Android
> stuff too?

The retina support that currently is in Qt/Mac (which would be extended to the other platforms) supports any float scale factor for HiDPI.

> Cheers,
> 
> md
> 
> 
> On 5/23/2014 3:20 AM, Sorvig Morten wrote:
>> Over the past year-and-a-half we’ve implemented high-dpi scaling for Qt on Mac OS  X and iOS. Now we have an excellent opportunity to bring this support to other platforms.
>> 
>> A quick recap for those unfamiliar: This high-dpi mode is an alternative to the traditional DPI scaling. In the traditional approach the application is presented with an DPI value used to multiply font sizes, layouts etc. In the new mode the operating system provides Qt with a scale factor which is used to scale graphics output: allocate larger buffers and set a scaling transform.
>> 
>> The advantage of this approach is that that vector graphics and fonts scale automatically and existing applications tend to work unmodified. Raster content handling is a neutral point - the app author needs to provide high-resolution artwork but this is manageable. A typical disadvantage is confusion caused by the existence of two coordinate systems: “Are these style hints in device independent or device pixels?" 
>> 
>> Looking at other platforms:
>> 
>> - WinRT: Already uses high-dpi scaling as of change aeea02ff10 .
>> 
>> - Wayland: Version 1.2 added wl_output::scale, which we can use. This change implements high-dpi scaling for the backing store:
>> 
>> https:/codereview.qt-project.org/#change,63600
>> 
>> -  Platform independent support: We can bring high-dpi support to any platform by adding a coordinate translation layer to QWindow and QWindowSystemInterface and making minor modifications to the platform plugins.  See the following changes:
>> 
>> https://codereview.qt-project.org/#change,86107
>> https://codereview.qt-project.org/#change,86108
>> 
>> Some preliminary testing has been done with the XCB platform plugin:
>> * KDE Frameworks 5: http://imgur.com/a/JhXSX#sUGYZmB
>> * Qt Creator: http://i.imgur.com/EEwdPTD.png
>> 
>> This also allows testing any scale factor on any hardware by setting an environment variable.
>> 
>> 
>> Adding support to QtWayland looks like a win to me. Do we want to add platform-indepent support to Qt?

Yes! :)

-- 
Eike Ziller, Senior Software Engineer - Digia, Qt
 
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B




More information about the Development mailing list