summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2016-06-13 17:56:49 +0200
committerDavid Edmundson <davidedmundson@kde.org>2016-06-13 16:12:20 +0000
commit49491dd678071661db2e34133c051cb176a83e0b (patch)
tree22382d2282d7bae57f6785795c5613554b3ab209
parentcbe332405aa22257d432f1797b325f5e57007c20 (diff)
Handle device pixel ratio in QTreeWidget animations
As we are rendering into a new paint device we need to copy the device pixel ratio from the widget. Task-number: QTBUG-50207 Change-Id: I2fe08052c4ab589cb871f4c95440b7d63f79beb9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/widgets/itemviews/qtreeview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index cecaa4d8fb..d2e1a10566 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -3232,7 +3232,8 @@ void QTreeViewPrivate::drawAnimatedOperation(QPainter *painter) const
QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect &rect) const
{
Q_Q(const QTreeView);
- QPixmap pixmap(rect.size());
+ QPixmap pixmap(rect.size() * q->devicePixelRatio());
+ pixmap.setDevicePixelRatio(q->devicePixelRatio());
if (rect.size().isEmpty())
return pixmap;
pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels.