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: Ica99ae84fe04311edfef817ab719863d627faf64
(cherry picked from commit 49491dd678)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
bb10
David Edmundson 2016-06-13 17:56:49 +02:00 committed by Giuseppe D'Angelo
parent d12a284bbb
commit ebb651aa73
1 changed files with 2 additions and 1 deletions

View File

@ -3244,7 +3244,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.