diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp index b2035666965779cb2cb380259473a24ae29a5641..193a90cd185cc8d6802932973af8b930e0fc038d 100644 --- a/tests/manual/highdpi/dragwidget.cpp +++ b/tests/manual/highdpi/dragwidget.cpp @@ -168,7 +168,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);