[Interest] High DPI support in QT (Windows)
coroberti at gmail.com
Tue Sep 22 11:26:37 CEST 2015
Some pointers that may be helpful:
Set in your Qt application: Qt::AA_UseHighDpiPixmaps
Further use a Poor Man's Test:
But keep in mind the below procedure,
To return back from Hi-DPI on a regular screen
where you cannot see the below part of the DPI Scaling Screen,
As long as you can get to the DPI Scaling Screen,
you can use TAB to navigate the selection.
First of all click on the “Default scale (96 DPI)”.
Here is the fun part. Press Shift key and then Tab key.
This would position you to the “How do I know which DPI to choose?” button.
Then you press Tab key 3 times. This would take you to the invisible
Then a screen would pop up to ask you to restart your Windows.
Press Enter to reboot your Windows.
On Fri, Sep 18, 2015 at 11:38 AM, Pavlo Dyachenko <upavlo at gmail.com> wrote:
> Hi QT team, I posted a question on the forum about high DPI support but then
> was recommended this mailing list instead:
> According to documentation here http://doc.qt.io/qt-5/highdpi.html QT 5.4+
> introduces high DPI support. However, either I’m missing something
> fundamental or the current support is still in very early stages. I’m
> writing a brand new application so I have a chance to do it right from the
> ground up. I understand that I would have to use layouts instead of fixed
> positioning etc, but there always going to be cases in which I would have to
> specify, for example a minimum/maximum size of a control. I can specify them
> in the editor, but these are device pixels. So if I change my Windows
> settings to use 150% DPI then min/max values in the editor would be too
> small. Of course I can obtain that ratio and adjust all the required values
> in code, but then what kind of high DPI support does QT give for me if I
> have to do everything by hand? I mean how is it different to pre QT 5.4?
> Then an interesting one is QT_DEVICE_PIXEL_RATIO environment variable. It
> does exactly what I need, it multiplies all pixels set in editor by a
> factor. But why is it an environment variable and not a per application
> setting? Why does it only support integer values of 2, 3 etc, since we know
> that Windows has settings like 125, 150% etc. and why couldn’t it
> automatically read the Windows setting and set itself to that value?
> Thanks in advance.
> Interest mailing list
> Interest at qt-project.org
More information about the Interest