From 89e1289b2aa33efd0c44eee0528a5634833ea723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 12 Sep 2019 10:22:14 +0200 Subject: =?UTF-8?q?High-DPI:=20Don=E2=80=99t=20round=20scale=20factors=20i?= =?UTF-8?q?n=20Qt=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set HighDpiScaleFactorRoundingPolicy to PassThough by default. This makes Qt track the system UI setting accurately, and is overall the least confusing option. Historically, Qt has rounded the scale factor (for example, Windows 175% -> DPR 2) due to faulty handling of fractional scale factors in Qt Widgets and with the native Windows style. Other areas of Qt such as Qt Quick have had few issues with fractional scale factors and support this well. Qt has never rounded the scale factor on the Android platform. Support for fractional scale factors in Qt Widgets and the windows style has improved, which makes changing the default for Qt 6 viable. Task-number: QTBUG-83068 Change-Id: I38b60f621f95be8ebb6cb84a07d3370fec19ab92 Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qguiapplication.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c5c6420d13..81ee315c0d 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -149,13 +149,8 @@ QString QGuiApplicationPrivate::styleOverride; Qt::ApplicationState QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive; Qt::HighDpiScaleFactorRoundingPolicy QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy = -#ifdef Q_OS_ANDROID - // On Android, Qt has newer rounded the scale factor. Preserve - // that behavior by disabling rounding by default. Qt::HighDpiScaleFactorRoundingPolicy::PassThrough; -#else - Qt::HighDpiScaleFactorRoundingPolicy::Round; -#endif + bool QGuiApplicationPrivate::highDpiScalingUpdated = false; QPointer QGuiApplicationPrivate::currentDragWindow; -- cgit v1.2.3