mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +08:00
Fixed position calculation for tab dragging
This commit is contained in:
parent
98ebdbea50
commit
ce1e8c8beb
@ -219,11 +219,10 @@ void DockWidgetTabPrivate::createLayout()
|
|||||||
void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
|
void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
|
||||||
{
|
{
|
||||||
ev->accept();
|
ev->accept();
|
||||||
int left, top, right, bottom;
|
QPoint Distance = ev->globalPos() - DragStartMousePosition;
|
||||||
_this->getContentsMargins(&left, &top, &right, &bottom);
|
Distance.setY(0);
|
||||||
QPoint moveToPos = ev->globalPos() - DragStartMousePosition;
|
auto TargetPos = Distance + TabDragStartPosition;
|
||||||
moveToPos.setY(0);
|
_this->move(TargetPos);
|
||||||
_this->move(moveToPos);
|
|
||||||
_this->raise();
|
_this->raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user