summaryrefslogtreecommitdiffstats
path: root/examples/widgets/draganddrop
diff options
context:
space:
mode:
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);