mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +08:00
change fix for crash on currentIndex invalid
This commit is contained in:
parent
44b2dc4b9d
commit
07355fa5b2
@ -311,7 +311,8 @@ void CAutoHideDockContainer::addDockWidget(CDockWidget* DockWidget)
|
||||
d->DockWidget = DockWidget;
|
||||
d->SideTab->setDockWidget(DockWidget);
|
||||
CDockAreaWidget* OldDockArea = DockWidget->dockAreaWidget();
|
||||
if (OldDockArea)
|
||||
// Don't remove dock widgets while restoring state, the current index pointer may be invalid
|
||||
if (!DockWidget->dockManager()->isRestoringState() && OldDockArea)
|
||||
{
|
||||
OldDockArea->removeDockWidget(DockWidget);
|
||||
}
|
||||
|
@ -1089,11 +1089,6 @@ bool DockContainerWidgetPrivate::restoreSideBar(CDockingStateReader& s,
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const auto oldDockArea = DockWidget->dockAreaWidget();
|
||||
if (oldDockArea)
|
||||
{
|
||||
oldDockArea->removeDockWidget(DockWidget);
|
||||
}
|
||||
|
||||
auto SideBar = _this->sideTabBar(Area);
|
||||
auto AutoHideContainer = SideBar->insertDockWidget(-1, DockWidget);
|
||||
|
Loading…
Reference in New Issue
Block a user