summaryrefslogtreecommitdiffstats
path: root/examples/widgets/draganddrop
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-10 17:43:12 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-10 17:43:13 +0200
commit8ba384a5645aebbefe34b814828024d511171497 (patch)
tree6f6cfe1b849b6e0e02de15ee74ad0f3d5fc740b6 /examples/widgets/draganddrop
parente694ced803589b3504b6bdb2fc8bf97bc891c794 (diff)
parent25b72a63fffe800f2005b21d254b0b191d263b10 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'examples/widgets/draganddrop')
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
index b184fcf060..fb169b953b 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
@@ -160,7 +160,9 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
mimeData->setData(hotSpotMimeDataKey(),
QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
- QPixmap pixmap(child->size());
+ qreal dpr = window()->windowHandle()->devicePixelRatio();
+ QPixmap pixmap(child->size() * dpr);
+ pixmap.setDevicePixelRatio(dpr);
child->render(&pixmap);
QDrag *drag = new QDrag(this);