summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-04 11:11:49 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-04 13:43:39 +0000
commit50bda9e2aca69f67da6722e481ce4e9c1a21471b (patch)
treed9dc468aceea4d55f6211f37cc7523a6e002423d /src/plugins/platforms/windows
parent3dbdc367ffa50b1482d037c956336c809e53a0e6 (diff)
Windows: Use logical DPI to activate High DPI scaling.
High DPI should be disabled when the user chooses small fonts on a High DPI monitor, resulting in lower logical DPI. The auto-algorithm should then be equivalent to that of the device pixel ratio scaling of Qt 5.5. Task-number: QTBUG-49195 Change-Id: I756770ec7251b5b9b901253ded82e829aa50d38b Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index c603b2bd09..de4ef79b81 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -280,8 +280,11 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags)
qreal QWindowsScreen::pixelDensity() const
{
- const qreal physicalDpi = m_data.geometry.width() / m_data.physicalSizeMM.width() * qreal(25.4);
- return qRound(physicalDpi / 96);
+ // QTBUG-49195: Use logical DPI instead of physical DPI to calculate
+ // the pixel density since it is reflects the Windows UI scaling.
+ // High DPI auto scaling should be disabled when the user chooses
+ // small fonts on a High DPI monitor, resulting in lower logical DPI.
+ return qRound(logicalDpi().first / 96);
}
/*!