Commit ca4c33a8 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Manual High DPI test: Create Dnd pixmap with device pixel ratio.


Apply the device pixel ratio from the widget unless Shift is pressed.

Task-number: QTBUG-46068
Task-number: QTBUG-50938
Change-Id: Ib806b7e545fa228043566800d22d1002728732bf
Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@theqtcompany.com>
Showing with 5 additions and 1 deletion
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment