GH-4164 set instance drag image hotspot based on where the drag started

This commit is contained in:
Petr Mrázek 2021-10-27 10:25:18 +02:00
parent ae4939e0d2
commit 393d17b8d3

View File

@ -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()))
{