Merge pull request #1695 from aws-lumberyard-dev/cgalvan/FixLCGraphNotOpeningOnEdit

[LYN-3195] Fixed fancy docking restore state to only touch dock tab containers that it created
This commit is contained in:
Chris Galvan
2021-07-07 20:18:09 -05:00
committed by GitHub
@@ -3288,15 +3288,20 @@ namespace AzQtComponents
}
// Untab tabbed dock widgets before restoring, as the restore only works on dock widgets parented directly to the main window
const QList<QDockWidget*> dockWidgets = m_mainWindow->findChildren<QDockWidget*>();
for (QDockWidget* dockWidget : dockWidgets)
for (QDockWidget* dockWidget : m_mainWindow->findChildren<QDockWidget*>(
QRegularExpression(QString("%1.*").arg(m_tabContainerIdentifierPrefix)), Qt::FindChildrenRecursively))
{
if (QStackedWidget* stackedWidget = qobject_cast<QStackedWidget*>(dockWidget->parentWidget()))
DockTabWidget* tabWidget = qobject_cast<DockTabWidget*>(dockWidget->widget());
if (!tabWidget)
{
if (AzQtComponents::DockTabWidget* tabWidget = qobject_cast<AzQtComponents::DockTabWidget*>(stackedWidget->parentWidget()))
{
tabWidget->removeTab(dockWidget);
}
continue;
}
// Remove the tabs from the tab widget (we don't actually want to close them, which could delete them at this point)
int numTabs = tabWidget->count();
for (int i = 0; i < numTabs; ++i)
{
tabWidget->removeTab(0);
}
}