mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-09-02 04:59:06 +00:00
GH-4164 set instance drag image hotspot based on where the drag started
This commit is contained in:
parent
ae4939e0d2
commit
393d17b8d3
@ -669,11 +669,10 @@ void InstanceView::startDrag(Qt::DropActions supportedActions)
|
|||||||
}
|
}
|
||||||
QRect rect;
|
QRect rect;
|
||||||
QPixmap pixmap = renderToPixmap(indexes, &rect);
|
QPixmap pixmap = renderToPixmap(indexes, &rect);
|
||||||
//rect.translate(offset());
|
|
||||||
// rect.adjust(horizontalOffset(), verticalOffset(), 0, 0);
|
|
||||||
QDrag *drag = new QDrag(this);
|
QDrag *drag = new QDrag(this);
|
||||||
drag->setPixmap(pixmap);
|
drag->setPixmap(pixmap);
|
||||||
drag->setMimeData(data);
|
drag->setMimeData(data);
|
||||||
|
drag->setHotSpot(m_pressedPosition - rect.topLeft());
|
||||||
Qt::DropAction defaultDropAction = Qt::IgnoreAction;
|
Qt::DropAction defaultDropAction = Qt::IgnoreAction;
|
||||||
if (this->defaultDropAction() != Qt::IgnoreAction && (supportedActions & this->defaultDropAction()))
|
if (this->defaultDropAction() != Qt::IgnoreAction && (supportedActions & this->defaultDropAction()))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user