[Interest] How is QT_AUTO_SCREEN_SCALE_FACTOR supposed to work?

Johan kungjohan at gmail.com
Tue Nov 3 09:58:40 CET 2015


>Try looking at QHighDpiScaling::initHighDpiScaling() and
QHighDpiScaling::updateHighDpiScaling(). The latter should eventually make
a call to QWindowsScreen:: pixelDensity() which I would expect to return 2
in your case.

Debugging this I can see that pixelDensity returns 1.0.
qwindowscreen.cpp L281:
    const qreal physicalDpi = m_data.geometry.width() /
m_data.physicalSizeMM.width() * qreal(25.4);

My data:
m_data.geometry.width() = 3840
m_data.physicalSizeMM.width() = 1355

This seems strange if I should intrepret this as physical MM since my
monitor is about 530mm Wide. It seems like the ratio is about 25.4 between
the value and the actual width....

So if m_data.physicalSizeMM.width actually contained the width of my
monitor in MM pixelDensity would return 2. Perhaps there is some strange
going on here?

Best regards
Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151103/e1022b13/attachment.html>


More information about the Interest mailing list