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
main
Chris Galvan 5 years ago committed by GitHub
commit adb300b586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
{
if (QStackedWidget* stackedWidget = qobject_cast<QStackedWidget*>(dockWidget->parentWidget()))
for (QDockWidget* dockWidget : m_mainWindow->findChildren<QDockWidget*>(
QRegularExpression(QString("%1.*").arg(m_tabContainerIdentifierPrefix)), Qt::FindChildrenRecursively))
{
if (AzQtComponents::DockTabWidget* tabWidget = qobject_cast<AzQtComponents::DockTabWidget*>(stackedWidget->parentWidget()))
DockTabWidget* tabWidget = qobject_cast<DockTabWidget*>(dockWidget->widget());
if (!tabWidget)
{
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);
}
}

Loading…
Cancel
Save