Simplify logic when restoring state

This commit is contained in:
Syarif Fakhri 2022-09-13 13:10:29 +08:00
parent b950b8a209
commit 9a69955124

View File

@ -1099,22 +1099,7 @@ bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s,
_this->sideTabBar(area)->insertSideTab(0, DockWidget->sideTabWidget());
DockArea->overlayDockContainer()->addDockWidget(DockWidget);
DockWidget->sideTabWidget()->updateStyle(); // Needed as the side tab widget get it's left/right property from the overlay dock container which was just added
DockWidget->toggleView(Closed);
}
if (Testing)
{
return true;
}
if (!DockArea->dockWidgetsCount())
{
delete DockArea;
DockArea = nullptr;
}
else
{
DockArea->setProperty("currentDockWidget", CurrentDockWidget);
DockArea->overlayDockContainer()->toggleView(!Closed);
}
return true;
@ -1913,6 +1898,8 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
//============================================================================
QList<CDockWidget*> CDockContainerWidget::openedDockWidgets() const
{
// todo: cleanup
qInfo() << "Opened Dock Widgets: ";
QList<CDockWidget*> DockWidgetList;
for (auto DockArea : d->DockAreas)
{
@ -1922,6 +1909,12 @@ QList<CDockWidget*> CDockContainerWidget::openedDockWidgets() const
}
}
// todo: cleanup
for (auto dockWidget : DockWidgetList)
{
qInfo() << "Opened dock widgets: " << dockWidget->objectName();
}
return DockWidgetList;
}