From c103ab2c2257ae99c541d4be15532edeba144762 Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Wed, 6 Sep 2017 15:54:50 -0400 Subject: 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 --- src/quick/items/qquickdrag.cpp | 1 + 1 file changed, 1 insertion(+) 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); -- cgit v1.2.3