From 393d17b8d383d7514b45ba980cc0246859bad085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 27 Oct 2021 10:25:18 +0200 Subject: [PATCH] GH-4164 set instance drag image hotspot based on where the drag started --- launcher/instanceview/InstanceView.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/launcher/instanceview/InstanceView.cpp b/launcher/instanceview/InstanceView.cpp index a7077d23..80dfb6f2 100644 --- a/launcher/instanceview/InstanceView.cpp +++ b/launcher/instanceview/InstanceView.cpp @@ -669,11 +669,10 @@ void InstanceView::startDrag(Qt::DropActions supportedActions) } QRect rect; QPixmap pixmap = renderToPixmap(indexes, &rect); - //rect.translate(offset()); - // rect.adjust(horizontalOffset(), verticalOffset(), 0, 0); QDrag *drag = new QDrag(this); drag->setPixmap(pixmap); drag->setMimeData(data); + drag->setHotSpot(m_pressedPosition - rect.topLeft()); Qt::DropAction defaultDropAction = Qt::IgnoreAction; if (this->defaultDropAction() != Qt::IgnoreAction && (supportedActions & this->defaultDropAction())) {