From eb98bed4e76bb0fa6bad8474f2f370334cb70f6c Mon Sep 17 00:00:00 2001 From: Chen Bin Date: Thu, 20 Aug 2020 17:59:20 +0800 Subject: Linux: Fix QLabel content truncated under high dpi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed truncation of pixmap content under high device pixel ratio of QLabel. Pick-to: 5.15 Fixes: QTBUG-86170 Change-Id: I795815e0d8a9e57e0dfcca9cf104e86e45027b18 Reviewed-by: Morten Johan Sørvig --- src/widgets/styles/qstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/styles') diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 87d33c689f..14dd8ad2be 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -627,7 +627,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, QRect aligned = alignedRect(QGuiApplication::layoutDirection(), QFlag(alignment), pixmap.size() / scale, rect); QRect inter = aligned.intersected(rect); - painter->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width() * scale, inter.height() *scale); + painter->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), qRound(inter.width() * scale), qRound(inter.height() *scale)); } /*! -- cgit v1.2.3