summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindowlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 83697278b8..857ca31529 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -1779,6 +1779,15 @@ bool QMainWindowTabBar::event(QEvent *e)
QTabBar *QMainWindowLayout::getTabBar()
{
+ if (!usedTabBars.isEmpty()) {
+ /*
+ If dock widgets have been removed and added while the main window was
+ hidden, then the layout hasn't been activated yet, and tab bars from empty
+ docking areas haven't been put in the cache yet.
+ */
+ activate();
+ }
+
QTabBar *result = nullptr;
if (!unusedTabBars.isEmpty()) {
result = unusedTabBars.takeLast();