[Development] High-DPI on Win

Friedemann Kleint Friedemann.Kleint at theqtcompany.com
Mon Jan 4 13:45:21 CET 2016


 >(3) Don't calculate the scale from the display resolution 
(QPlatformScreen::pixelDensity()). >In QT5.5 the devicePixelRatio is 
obviously set to either 1.0 or 2.0 depending on the >resolution of the 
display. I'm not sure for Qt5.6, but it seems to be alike here. However, 
in Win the >user can set a scaling such as 100%, 125%, 150%, 200%, and 
250%, and the user >can do so - and may want to do so - for whatever 
display she/he is using (anyone with ailing eyes is >happy to use 125% 
on regular screens, or 250% on HDPI screens ;)). So - IMHO - >the 
devicePixelRatio should actually be set to exactly this value, 
independent on any display resolution.

The Windows setting is not related to any scaling done by Qt. It only 
changes the return values of the metrics functions (logical DPI, font + 
icon sizes, etc); no devicePixelRatio scaling is done there.

 >Sadly, I must agree with you that Qt does indeed not handle high-dpi 
windows very well L   I have Qt applications that I cannot use on my 
system, and have resorted to qt.conf to >turn off DPI-awareness for 
them; fuzzy scaling was preferable to not being able to use the application.

There is a restriction currently in that the Windows styles are not 
suitable for scaling. We recommend using Fusion style for High DPI.


Friedemann Kleint | The Qt Company

More information about the Development mailing list