diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-09-12 10:22:14 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-08-28 13:00:17 +0200 |
commit | 89e1289b2aa33efd0c44eee0528a5634833ea723 (patch) | |
tree | 36d4dd9624bffc751784bd93ef3a7e67a075e249 /src/gui/kernel/qguiapplication.cpp | |
parent | 080a8285eb64119d1261be7d1d9eca883bf45826 (diff) |
High-DPI: Don’t round scale factors in Qt 6
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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<QWindow> QGuiApplicationPrivate::currentDragWindow; |