diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-09 14:15:58 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-16 14:40:15 +0000 |
commit | ca4c33a886fb4cec50f1a4140fc29ec731240ecb (patch) | |
tree | f588922134c26d089d22eb92a1589f2b457c9fb3 /tests/manual/highdpi | |
parent | 714cb4020e12e078e8ba8c2c5493d138d515f46d (diff) |
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>
Diffstat (limited to 'tests/manual/highdpi')
-rw-r--r-- | tests/manual/highdpi/dragwidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp index b203566696..193a90cd18 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); |