diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2023-11-14 09:41:54 +0100 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2023-11-14 15:05:19 +0100 |
commit | 4c60a11d8f935abb762a83b0ab99cefa6db3060c (patch) | |
tree | 9e102aa58279e3264b318852797ba083685a1040 /src/widgets/widgets/qmainwindow.cpp | |
parent | 0e435b7f13619106d61c9701e53803d3c488fea3 (diff) |
QDockWidget: Always show dock widgets with the main window
QMainWindow::show() also showed its dock widget children. When a main
window with dock widget children consumed a show event for another
reason, hidden dock widget children remained hidden.
If a dock widget application went to the background, e.g. because it
was hidden behind another application gaining focus, a klick on the
dock widget application's app icon would not show its dock widget
children. Unless the dock widget application provides shows them
explicitly, they can never been shown again by the user.
=> show all dock widget and group window children, when QMainWindow
consumes a show event.
Pick-to: 6.6 6.5
Change-Id: I7e8b59f021ec4ec5679d0d08d0eeda1e3225a385
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index fcf6d56c0c..662c9db892 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1290,6 +1290,13 @@ bool QMainWindow::event(QEvent *event) return true; #endif // QT_CONFIG(statustip) +#if QT_CONFIG(dockwidget) + case QEvent::Show: + Q_ASSERT(d->layout); + d->layout->showDockWidgets(); + break; +#endif // QT_CONFIG(dockwidget) + case QEvent::StyleChange: #if QT_CONFIG(dockwidget) Q_ASSERT(d->layout); |