aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Yadrov <oleg.yadrov@qt.io>2017-09-06 15:54:50 -0400
committerOleg Yadrov <oleg.yadrov@qt.io>2017-09-06 23:39:28 +0000
commitc103ab2c2257ae99c541d4be15532edeba144762 (patch)
tree16fc30e259d410cc78bdb9e051b73486629030f8
parenta32cf1a22d096b33340cddbe91328c6c088e221d (diff)
QQuickDragAttached: make hotSpot work with imageSource
This amends patch 4b982c744f538a24e21a2af146c45f93d27dd1cb. Previously, setting hotSpot had no effect on the image position because QDrag object used for the drag is created in startDrag(), and the hotspot was never updated before drag->exec(...). Task-number: QTBUG-61980 Change-Id: I9c11c456d3b32b5986cf287b2610437e3825d9d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/quick/items/qquickdrag.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index 41847e5f01..7c936ff21c 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -772,6 +772,7 @@ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedAct
drag->setPixmap(QPixmap::fromImage(pixmapLoader.image()));
}
+ drag->setHotSpot(hotSpot.toPoint());
emit q->dragStarted();
Qt::DropAction dropAction = drag->exec(supportedActions);