From cb9d8226d77103212618125867b4f9d657c57f9b Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 6 Nov 2024 21:11:47 +0100 Subject: [PATCH] QCachedPainter: fix pixmapRect() for dpr != 1 Return the correct (device independent) size of the pixmap rect. This amends 75617efe238bb20e9a0e1d12a1a8bf5d6f6819e1. Task-number: QTBUG-129680 Change-Id: I19ed4665143824204de77e01ae47772d79fbf0ff Reviewed-by: Volker Hilsheimer --- src/widgets/styles/qstyle_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/styles/qstyle_p.h b/src/widgets/styles/qstyle_p.h index ff8a2060522..2df2757c4e7 100644 --- a/src/widgets/styles/qstyle_p.h +++ b/src/widgets/styles/qstyle_p.h @@ -57,7 +57,8 @@ class Q_WIDGETS_EXPORT QCachedPainter } QRect pixmapRect() const { - return QRect(0, 0, m_pixmap.width(), m_pixmap.height()); + const auto sz = m_pixmap.deviceIndependentSize(); + return QRect(0, 0, sz.width(), sz.height()); } QPainter *operator->() {