Skip to content

Commit ce1e8c8

Browse files
Fixed position calculation for tab dragging
1 parent 98ebdbe commit ce1e8c8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/DockWidgetTab.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,10 @@ void DockWidgetTabPrivate::createLayout()
219219
void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
220220
{
221221
ev->accept();
222-
int left, top, right, bottom;
223-
_this->getContentsMargins(&left, &top, &right, &bottom);
224-
QPoint moveToPos = ev->globalPos() - DragStartMousePosition;
225-
moveToPos.setY(0);
226-
_this->move(moveToPos);
222+
QPoint Distance = ev->globalPos() - DragStartMousePosition;
223+
Distance.setY(0);
224+
auto TargetPos = Distance + TabDragStartPosition;
225+
_this->move(TargetPos);
227226
_this->raise();
228227
}
229228

0 commit comments

Comments
 (0)