From 756d7facf6c862faea1fdeadafba361f248328cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 28 Aug 2020 11:23:17 +0200 Subject: [PATCH] Fix tst_QHighDpiScaling::scale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without an override for logicalDpi() the base class implementation would use the geometry of the screen to figure out the DPI, and end up with ~100, which combined with a 96DPI base logical DPI would give a wrong scale factor. Change-Id: I68aecce44d2ee672c7b707dfe5444af8f551e961 Reviewed-by: Morten Johan Sørvig --- tests/auto/gui/kernel/qhighdpiscaling/tst_qhighdpiscaling.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/gui/kernel/qhighdpiscaling/tst_qhighdpiscaling.cpp b/tests/auto/gui/kernel/qhighdpiscaling/tst_qhighdpiscaling.cpp index ec80c2d02c..3fbaa0715a 100644 --- a/tests/auto/gui/kernel/qhighdpiscaling/tst_qhighdpiscaling.cpp +++ b/tests/auto/gui/kernel/qhighdpiscaling/tst_qhighdpiscaling.cpp @@ -47,6 +47,8 @@ public: QRect geometry() const override { return QRect(3840, 0, 3840, 1920); } QRect availableGeometry() const override { return geometry(); } + QDpi logicalDpi() const override { return logicalBaseDpi(); } + int depth() const override { return 32; } QImage::Format format() const override { return QImage::Format_ARGB32_Premultiplied; } };