From ce1e8c8beb082f11144a6c3e718738e41c8d696d Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Wed, 15 Jan 2020 21:15:29 +0100 Subject: [PATCH] Fixed position calculation for tab dragging --- src/DockWidgetTab.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp index aac597451..cc15aa5df 100644 --- a/src/DockWidgetTab.cpp +++ b/src/DockWidgetTab.cpp @@ -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(); }