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: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This commit is contained in:
parent
714cb4020e
commit
ca4c33a886
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user