summaryrefslogtreecommitdiffstats
path: root/tests/manual/highdpi/dragwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/highdpi/dragwidget.cpp')
-rw-r--r--tests/manual/highdpi/dragwidget.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp
index b5ad6fa63b..fc1ea72963 100644
--- a/tests/manual/highdpi/dragwidget.cpp
+++ b/tests/manual/highdpi/dragwidget.cpp
@@ -163,7 +163,11 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
mimeData->setData("application/x-hotspot",
QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
- QPixmap pixmap(child->size());
+ const qreal dpr = devicePixelRatioF() > 1 && !(QGuiApplication::keyboardModifiers() & Qt::ShiftModifier)
+ ? devicePixelRatioF() : 1;
+
+ QPixmap pixmap(child->size() * dpr);
+ pixmap.setDevicePixelRatio(dpr);
child->render(&pixmap);
QDrag *drag = new QDrag(this);