summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindowlayout.cpp
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-11-14 10:26:09 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2023-11-15 21:52:23 +0100
commit1ab91b7bdbcced6ea4cc176da1d18e6b789208ae (patch)
treefd397b017c707a3148ab9d1ce8ac73357feaed72 /src/widgets/widgets/qmainwindowlayout.cpp
parent5565ed24e1f81cef499f7f6e6d8a24db333c8810 (diff)
QDockWidget: call raise() when a dock widget starts to hover
When dock widget (1) starts to hover over another floating dock widget (2), the latter animates a rubber band, to indicate to the user that it is ready to accept a drop. The creation of a QRubberBand moves (2) one position up in the Z order. The consequence is a visual glitch: While - the mouse cursor dragging (1) is still outside (2) and - the visual rectangle of (1) starts overlapping (2) (1) hides behind (2). As soon as the mouse cursor enters (2), (1) suddenly comes on top and (2) hides behind (1). => raise() 1 as soon as it starts hovering. That brings it on top of the Z order, which is expected behavior. Pick-to: 6.6 6.5 Change-Id: I1140fc6ff109c7a713e7e2617072698467375585 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index c6fc5f0bb5..0730e86336 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -2787,6 +2787,7 @@ void QMainWindowLayout::hover(QLayoutItem *hoverTarget,
QWidget *widget = hoverTarget->widget();
#if QT_CONFIG(dockwidget)
+ widget->raise();
if ((dockOptions & QMainWindow::GroupedDragging) && (qobject_cast<QDockWidget*>(widget)
|| qobject_cast<QDockWidgetGroupWindow *>(widget))) {