Fixed position calculation for tab dragging

This commit is contained in:
Uwe Kindler 2020-01-15 21:15:29 +01:00
parent 98ebdbea50
commit ce1e8c8beb

View File

@ -219,11 +219,10 @@ void DockWidgetTabPrivate::createLayout()
void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
{
ev->accept();
int left, top, right, bottom;
_this->getContentsMargins(&left, &top, &right, &bottom);
QPoint moveToPos = ev->globalPos() - DragStartMousePosition;
moveToPos.setY(0);
_this->move(moveToPos);
QPoint Distance = ev->globalPos() - DragStartMousePosition;
Distance.setY(0);
auto TargetPos = Distance + TabDragStartPosition;
_this->move(TargetPos);
_this->raise();
}