From d7fe948fdb79e919065875410dba14275a2a7478 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Tue, 5 Mar 2024 11:53:39 +0100 Subject: 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.7 6.6 Change-Id: I348f5281a200b78e6be4f11b3c25339d052783a5 Reviewed-by: Axel Spoerl --- src/widgets/widgets/qmainwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 30176edd49..85353d9b4e 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1300,6 +1300,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; -- cgit v1.2.3