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()); _this->sideTabBar(area)->insertSideTab(0, DockWidget->sideTabWidget());
DockArea->overlayDockContainer()->addDockWidget(DockWidget); 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->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); DockArea->overlayDockContainer()->toggleView(!Closed);
}
if (Testing)
{
return true;
}
if (!DockArea->dockWidgetsCount())
{
delete DockArea;
DockArea = nullptr;
}
else
{
DockArea->setProperty("currentDockWidget", CurrentDockWidget);
} }
return true; return true;
@ -1913,6 +1898,8 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
//============================================================================ //============================================================================
QList<CDockWidget*> CDockContainerWidget::openedDockWidgets() const QList<CDockWidget*> CDockContainerWidget::openedDockWidgets() const
{ {
// todo: cleanup
qInfo() << "Opened Dock Widgets: ";
QList<CDockWidget*> DockWidgetList; QList<CDockWidget*> DockWidgetList;
for (auto DockArea : d->DockAreas) 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; return DockWidgetList;
} }