summaryrefslogtreecommitdiff
path: root/src/widgets/effects
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-18 15:02:08 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-18 13:08:43 +0000
commit8b62673d9f0cf8aea126b3cd2f52686f013d7fe1 (patch)
treef3f72636b8883839d4d69c4d1dd17efe442ff88e /src/widgets/effects
parent84fb8c5ec909fa29512236aed3a77f595a2ac891 (diff)
downloadqtbase-8b62673d9f0cf8aea126b3cd2f52686f013d7fe1.tar.gz
QGraphicsDropShadowEffect: Fix for high DPI scaling
Preserve the device pixel ratio. Task-number: QTBUG-60026 Change-Id: Ie818c582fe2c7b11ceb347b39cfbf7ea49361021 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/effects')
-rw-r--r--src/widgets/effects/qpixmapfilter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/effects/qpixmapfilter.cpp b/src/widgets/effects/qpixmapfilter.cpp
index 2a069d7529..bb949fcebf 100644
--- a/src/widgets/effects/qpixmapfilter.cpp
+++ b/src/widgets/effects/qpixmapfilter.cpp
@@ -1316,6 +1316,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
return;
QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied);
+ tmp.setDevicePixelRatio(px.devicePixelRatioF());
tmp.fill(0);
QPainter tmpPainter(&tmp);
tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
@@ -1324,6 +1325,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
// blur the alpha channel
QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied);
+ blurred.setDevicePixelRatio(px.devicePixelRatioF());
blurred.fill(0);
QPainter blurPainter(&blurred);
qt_blurImage(&blurPainter, tmp, d->radius, false, true);