[Interest] High DPI support in 5.6 (Windows)

Pavlo Dyachenko ppaveld at yahoo.ie
Fri Oct 16 17:59:47 CEST 2015


I might as well answer my own question. I didn't notice at first but I could, in theory, use QT_SCREEN_SCALE_FACTORS which does exactly what I want, but it would have still been nicer if QT_AUTO_SCREEN_SCALE_FACTOR was doing the work. Plus I'm not sure what I'll do if a monitor is plugged/unplugged or a more common use case is when a user plugs in/out a projector for presenting.
Pavlo

     On Friday, 16 October 2015, 15:45:00, Pavlo Dyachenko <ppaveld at yahoo.ie> wrote:
   

 Hi, my question if a follow up on my previous question regarding high DPI support on Windows. So starting from 5.6 we going to be able to scale up the entire application by a fraction using QT_SCALE_FACTOR environment variable, therefore scale factors of 125, 150% will be supported, which is great (in <5.6 only integer values were supported).
However it feels that the handling of the font size is not as expected. For example I have my Windows settings set to 150% scaling, so I want my app's fonts AND windows/widgets sizes to be 1.5 times bigger. I could use QT_SCALE_FACTOR for that, the documentation https://doc-snapshots.qt.io/qt5-5.6/highdpi.html says "QT_SCALE_FACTOR [numeric] defines a global scale factor for the whole application, including point sized fonts.", but if I set it to 1.5 it will make the fonts 1.5 times bigger as well, but the font's are already 150% scaled by OS (because of the OS setting), so the result I get is 1.5 bigger app. window and 2.25 bigger fonts.
I could use QT_AUTO_SCREEN_SCALE_FACTOR, in which case QT will calculate a scaling factor automatically based on monitor's physical pixel density. I have a 4K monitor so the scaling factor it comes up with is 2.0 and it doesn't change the font's sizes, but remember my Windows DPI setting is 150% (recommend setting), so now I get 2.0 application window and 1.5 fonts, which is still wrong.
Things would have work just fine if QT_AUTO_SCREEN_SCALE_FACTOR was using Window's DPI setting to determine a scaling ration. After all a user may set any DPI setting due to low visibility even on a small monitor.
I hope there is some way to hack it around without changing the source so it works as expected.
Thanks in advance,Pavlo Dyachenko
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151016/3d9500b4/attachment.html>


More information about the Interest mailing list