summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyle.cpp
diff options
context:
space:
mode:
authorChen Bin <chenbin@uniontech.com>2020-08-20 17:59:20 +0800
committerMorten Johan Sørvig <morten.sorvig@qt.io>2020-08-28 01:08:18 +0000
commiteb98bed4e76bb0fa6bad8474f2f370334cb70f6c (patch)
treea01b55ebe5fe95a704e97da7f94ece4ee04fa5bd /src/widgets/styles/qstyle.cpp
parent257285553fffdb0d9246b3b0a1072f2092f9c0a2 (diff)
Linux: Fix QLabel content truncated under high dpi
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 <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets/styles/qstyle.cpp')
-rw-r--r--src/widgets/styles/qstyle.cpp2
1 files changed, 1 insertions, 1 deletions
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));
}
/*!