summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Redondo <qt@david-redondo.de>2024-03-05 11:53:39 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-06 14:13:53 +0000
commit157f7b47e460a388baa6f162383462febb2a0877 (patch)
treeef3f56dd58edd13e860d2bf43524b23d2b984e89
parent2bc6b25c5655e17f65a3a7fd84ba38f203f5cf4a (diff)
Handle drag leave when performing platform drag of docks or toolbars
The existing widget machinery works through mouse positions. In order to correctly update state when a drag moves outside of a window it needs to see a move outside of the window. When the platform drag leaves the window a move to the outside of the window is now faked to not keep the layout in the hovered state of the last move event. Fixes: QTBUG-122944 Pick-to: 6.6 Change-Id: I348f5281a200b78e6be4f11b3c25339d052783a5 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit d7fe948fdb79e919065875410dba14275a2a7478) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/widgets/widgets/qmainwindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 8c3a52c01b..4534058d45 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -1301,6 +1301,11 @@ bool QMainWindow::event(QEvent *event)
event->accept();
return true;
}
+ case QEvent::DragLeave:
+ if (!d->layout->draggingWidget)
+ break;
+ d->layout->hover(d->layout->draggingWidget, pos() - QPoint(-1, -1));
+ return true;
#endif
default:
break;