From 20775b77454afce35f3c3e88f07e7e18896989a1 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 30 Jun 2021 15:26:27 -0500 Subject: [PATCH] [LYN-3195] Fixed fancy docking restore state to only touch dock tab containers that it created Signed-off-by: Chris Galvan --- .../AzQtComponents/Components/FancyDocking.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp index 9fe4ac29fb..8470cedce1 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp @@ -3288,16 +3288,16 @@ namespace AzQtComponents } // Untab tabbed dock widgets before restoring, as the restore only works on dock widgets parented directly to the main window - const QList dockWidgets = m_mainWindow->findChildren(); - for (QDockWidget* dockWidget : dockWidgets) + for (QDockWidget* dockWidget : m_mainWindow->findChildren( + QRegularExpression(QString("%1.*").arg(m_tabContainerIdentifierPrefix)), Qt::FindChildrenRecursively)) { - if (QStackedWidget* stackedWidget = qobject_cast(dockWidget->parentWidget())) + DockTabWidget* tabWidget = qobject_cast(dockWidget->widget()); + if (!tabWidget) { - if (AzQtComponents::DockTabWidget* tabWidget = qobject_cast(stackedWidget->parentWidget())) - { - tabWidget->removeTab(dockWidget); - } + continue; } + + tabWidget->closeTabs(); } // Restore the floating windows