summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2022-09-06 11:05:53 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-07 07:42:00 +0000
commit2b2c6a717c6680473edaebd8c1699933412ef842 (patch)
tree9785e75ba27dba3db16bc73adc7ea1ae3e2ca4e2
parentb0cadd5ed275dd64c19c15c0a09fe5d2383badf1 (diff)
Refix QDockwidget drag out dockwidget
In f082458c4609dfa20fdfb8bfe3e625c311b145da a fix attempt was made and in a lucky example on Mac it worked well. However, the logic was still not correct and that could be seen in other systems/examples. This patch updates the logic to be the correct behavior in general. Fixes: QTBUG-106064 Change-Id: I3b098be9942d37c367b146a7359185bcfd127762 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 06556d079afcf8c53c7dbbc0592988f52a23ff68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/widgets/widgets/qdockwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index ff227bcedb..eb6f1d83c1 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->isFloating() ? q->pos() : q->mapToGlobal(q->pos());
+ state->widgetInitialPos = q->isFloating() ? q->pos() : q->mapToGlobal(QPoint(0, 0));
state->dragging = false;
state->widgetItem = nullptr;
state->ownWidgetItem = false;