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>
bb10
Friedemann Kleint 2015-11-04 11:11:49 +01:00
parent 3dbdc367ff
commit 50bda9e2ac
1 changed files with 5 additions and 2 deletions

View File

@ -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);
}
/*!