refactor: Center drag point for screen management
This commit is contained in:
committed by
Chris Rizzitello
parent
50240c1fc3
commit
acd4b59b4c
@ -34,6 +34,6 @@ void NewScreenWidget::mousePressEvent(QMouseEvent *event)
|
||||
auto *pDrag = new QDrag(this);
|
||||
pDrag->setMimeData(pMimeData);
|
||||
pDrag->setPixmap(pixmap());
|
||||
pDrag->setHotSpot(event->pos());
|
||||
pDrag->setHotSpot(QPoint(width() / 2, height() / 2));
|
||||
pDrag->exec(Qt::CopyAction, Qt::CopyAction);
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ void ScreenSetupView::startDrag(Qt::DropActions)
|
||||
auto *pDrag = new QDrag(this);
|
||||
pDrag->setPixmap(pixmap);
|
||||
pDrag->setMimeData(pData);
|
||||
pDrag->setHotSpot(QPoint(pixmap.width() / 2, pixmap.height() / 2));
|
||||
pDrag->setHotSpot(QPoint(iconSize().width() / 2, iconSize().height() / 2));
|
||||
|
||||
if (pDrag->exec(Qt::MoveAction, Qt::MoveAction) == Qt::MoveAction) {
|
||||
selectionModel()->clear();
|
||||
|
||||
Reference in New Issue
Block a user