Improve CDockManager::addDockWidgetTab() for dynamically added widgets

This commit is contained in:
Tibo Clausen 2019-05-15 14:30:32 +01:00
parent 69894f3f88
commit 5ee94d7602

View File

@ -565,9 +565,13 @@ CDockAreaWidget* CDockManager::addDockWidgetTab(DockWidgetArea area,
{
return addDockWidget(ads::CenterDockWidgetArea, Dockwidget, AreaWidget);
}
else if (!openedDockAreas().isEmpty())
{
return addDockWidget(area, Dockwidget, openedDockAreas().last());
}
else
{
return addDockWidget(area, Dockwidget, AreaWidget);
return addDockWidget(area, Dockwidget, nullptr);
}
}