mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-26 08:01:32 +08:00
Simplify logic when restoring state
This commit is contained in:
parent
b950b8a209
commit
9a69955124
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user