1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

revert not removing old dock widgets when restoring state

This commit is contained in:
Syarif Fakhri 2022-11-03 15:27:18 +08:00
parent bcf8e8a421
commit 986077c765

View File

@ -315,8 +315,7 @@ void CAutoHideDockContainer::addDockWidget(CDockWidget* DockWidget)
d->DockWidget = DockWidget; d->DockWidget = DockWidget;
d->SideTab->setDockWidget(DockWidget); d->SideTab->setDockWidget(DockWidget);
CDockAreaWidget* OldDockArea = DockWidget->dockAreaWidget(); CDockAreaWidget* OldDockArea = DockWidget->dockAreaWidget();
// Don't remove dock widgets while restoring state, the current index pointer may be invalid if (OldDockArea)
if (!DockWidget->dockManager()->isRestoringState() && OldDockArea)
{ {
OldDockArea->removeDockWidget(DockWidget); OldDockArea->removeDockWidget(DockWidget);
} }