summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2015-08-16 15:09:51 +0100
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-09-04 12:40:41 +0000
commit1a0384cb15f7a2194341ec4b102948fa9337f5cf (patch)
treea2696a3d51d2eb03096e4ea7effb49d6de07c923 /src
parentfeff56827b86ff00930a903944afe913a926a9a1 (diff)
Support device pixel ratio in QWidget graphic effects
Change-Id: Ie20bd30328ae353ace82fbeee5808546f0568703 Reviewed-by: Christoph Cullmann <cullmann@kde.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index ba0fcf75d0..49da4d1faf 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5828,7 +5828,10 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
pixmapOffset -= effectRect.topLeft();
- QPixmap pixmap(effectRect.size());
+ const qreal dpr = context->painter->device()->devicePixelRatio();
+ QPixmap pixmap(effectRect.size() * dpr);
+ pixmap.setDevicePixelRatio(dpr);
+
pixmap.fill(Qt::transparent);
m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren);
return pixmap;