From 70a893e9bee7c1b8994a1218038a302e406d0aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 2 Jun 2016 09:52:21 +0200 Subject: Move QT_FONT_DPI to cross-platform code This makes it possible to test the effects of setting Qt::AA_HighDpiScaling/QT_AUTO_SCREEN_SCALE_FACTOR, with different DPI values on all platforms. This also makes it possible to access the actual DPI values reported by the OS/WS via the QPlatformScreen API. A drawback is that there is no single place to check the environment variable; currently done in three places. This may be further simplified later on. Done-with: Friedemann Kleint Task-number: QTBUG-53022 Change-Id: Idd6463219d3ae58fe0ab72c17686cce2eb9dbadd Reviewed-by: Friedemann Kleint --- src/gui/kernel/qwindowsysteminterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qwindowsysteminterface.cpp') diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 4b8cb3646a..40a298226a 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -857,8 +857,8 @@ void QWindowSystemInterface::handleScreenGeometryChange(QScreen *screen, const Q void QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal dpiX, qreal dpiY) { - QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e = - new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, dpiX, dpiY); // ### tja + const QDpi effectiveDpi = QPlatformScreen::overrideDpi(QDpi{dpiX, dpiY}); + auto e = new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, effectiveDpi.first, effectiveDpi.second); QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } -- cgit v1.2.3