[Interest] Changes in Qt 5.6 on Windows HiDPI

Julius Bullinger Julius.Bullinger at asctec.de
Fri Nov 13 10:00:07 CET 2015


Hello Adam,

do you use the new environment variables QT_AUTO_SCREEN_SCALE_FACTOR=1 ?
Additionally, make sure to unset the deprecated  QT_DEVICE_PIXEL_RATIO.

You can do this in your shell for testing, and programmatically with qputenv [1].

Best regards,
Julius


Von: Interest [mailto:interest-bounces at qt-project.org] Im Auftrag von Adam Light
Gesendet: Freitag, 13. November 2015 00:49 Uhr
An: Interest at qt-project.org
Betreff: [Interest] Changes in Qt 5.6 on Windows HiDPI

We've just started testing our application using Qt 5.6 (self built from Nov. 10 git checkout).

It appears that the behavior of QDesktopWidget::logicalDpiX (and Y) has changed since Qt 5.5.

We bought a Dell Inspiron 15 laptop with a High DPI display. If I open Control Panel, choose Display, and click the "set a custom scaling level" link, the scaling factor was set to 250% out of the box. When we run our application and call QApplication::desktop()->logicalDpiX(), the value returned is 80. Using Qt 5.5, that would have returned 240 (2.5 * 96).

Is this change intentional? This change breaks a lot of the drawing code in our application, and so I'd like to know whether we need to adapt our application or if I should report this as a bug.

Additionally, I notice that if I call QApplication::desktop()->devicePixelRatioF(), the returned value is 3. I would expect that 2.5 is returned.

I see the note at https://doc-snapshots.qt.io/qt5-5.6/highdpi.html that says:
Note: Non-integer scale factors may cause significant scaling/painting artifacts.

That's unfortunate, as I suspect that non-integer scale factors will be relatively common. I can change the scale factor to 200%, but when I do that everything is a little too small, and I'm relatively young and have good eyesight. Requiring our users to use integer scale factors is something we'd rather not do.

Thanks
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151113/10fff3c2/attachment.html>


More information about the Interest mailing list