diff options
author | Thorbjørn Lund Martsum <tmartsum@gmail.com> | 2022-08-31 11:28:50 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-31 21:33:01 +0000 |
commit | 7e804fb10609aa72dd941eb20d46c18db38563d4 (patch) | |
tree | 73b45e20a60b67679c497a4c773347afd60eee28 /src | |
parent | 347c9e2b582a02878fb08e3933a7a88197046113 (diff) |
Fix dragging a docked QDockWidget [REG-fix]
In 54f328f0e8205480749a6d8d2ebe0e58cb1cdb67 issues with dragging
dock widgets between screens were solved. However, it only
worked well if the widget was floating. It worked wrong when
dragging out a docked widget. That is fixed by this patch.
Fixes: QTBUG-106064
Change-Id: I8d486d30a334719a2931828464ccaceb8ba2e019
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f082458c4609dfa20fdfb8bfe3e625c311b145da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/widgets/qdockwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 6072740db8..ff227bcedb 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -754,7 +754,7 @@ void QDockWidgetPrivate::initDrag(const QPoint &pos, bool nca) state = new QDockWidgetPrivate::DragState; state->pressPos = pos; state->globalPressPos = q->mapToGlobal(pos); - state->widgetInitialPos = q->pos(); + state->widgetInitialPos = q->isFloating() ? q->pos() : q->mapToGlobal(q->pos()); state->dragging = false; state->widgetItem = nullptr; state->ownWidgetItem = false; |