From 44a58de2aea6d2ac71efe7261a398effbf139f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 13 Sep 2013 10:42:40 +0200 Subject: Fix highdpi CE_HeaderLabel pixmaps in fusion style Make sure enough pixels is sourced by multiplying the layout rect size with the pixmaps devicePixelRatio. Task-number: QTBUG-31477 Change-Id: I742603c09a65a520587da3eef9479ef7f0c87022 Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qcommonstyle.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index ba6c222820..aaad4c3331 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1525,7 +1525,10 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, QRect aligned = alignedRect(header->direction, QFlag(header->iconAlignment), pixmap.size() / pixmap.devicePixelRatio(), rect); QRect inter = aligned.intersected(rect); - p->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width(), inter.height()); + p->drawPixmap(inter.x(), inter.y(), pixmap, + inter.x() - aligned.x(), inter.y() - aligned.y(), + aligned.width() * pixmap.devicePixelRatio(), + pixmap.height() * pixmap.devicePixelRatio()); if (header->direction == Qt::LeftToRight) rect.setLeft(rect.left() + pixw + 2); -- cgit v1.2.3