diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2016-04-25 11:31:34 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-08-23 03:40:35 +0200 |
commit | 900f2cb6f7070b4d426f3b83787ac489b8a2e827 (patch) | |
tree | 48f5a9fb87a01c3e5be8c9f436d0607602d24956 /src/plugins/platforms/windows | |
parent | dd9da0441b18d1946a7b3d28e4e8819b1921de6f (diff) |
Update Dpi and scale factor computation
Remove pixelScale() in favor of logicalBaseDpi(). Compute scale factor
based on logical DPI and logical base DPI, or optionally based on the
physical DPI.
Add policies for running the scale factor and adjusting the logical
DPI reported to the application. The policies are set via environment
variables:
QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough
QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly
QT_USE_PHYSICAL_DPI=0|1
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: I4846f223186df665eb0a9c827eaef0a96d1f458f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.h | 2 |
2 files changed, 1 insertions, 10 deletions
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 282c0b107e..8cd09a34eb 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -256,15 +256,6 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) return result; } -qreal QWindowsScreen::pixelDensity() const -{ - // 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 qMax(1, qRound(logicalDpi().first / 96)); -} - /*! \brief Determine siblings in a virtual desktop system. diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h index 0ccebf6d71..2fd56f53cf 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.h +++ b/src/plugins/platforms/windows/qwindowsscreen.h @@ -87,7 +87,7 @@ public: QImage::Format format() const override { return m_data.format; } QSizeF physicalSize() const override { return m_data.physicalSizeMM; } QDpi logicalDpi() const override { return m_data.dpi; } - qreal pixelDensity() const override; + QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; qreal devicePixelRatio() const override { return 1.0; } qreal refreshRate() const override { return m_data.refreshRateHz; } QString name() const override { return m_data.name; } |