Fixed emission of missing top level event when redocking a auto hide widget

This commit is contained in:
Uwe Kindler 2022-11-07 08:11:00 +01:00
parent e1368be645
commit 44a5873415

View File

@ -379,7 +379,17 @@ void CAutoHideDockContainer::moveContentsToParent()
// location like it had as a auto hide widget. This brings the least surprise
// to the user and he does not have to search where the widget was inserted.
d->DockWidget->setDockArea(nullptr);
dockContainer()->addDockWidget(d->getDockWidgetArea(d->SideTabBarArea), d->DockWidget);
auto DockContainer = dockContainer();
// If the container contained only one visible dock widget, the we need
// to emit a top level event for this widget because it is not the one and
// only visible docked widget anymore
auto TopLevelDockWidget = DockContainer->topLevelDockWidget();
DockContainer->addDockWidget(d->getDockWidgetArea(d->SideTabBarArea), d->DockWidget);
if (TopLevelDockWidget)
{
CDockWidget::emitTopLevelEventForWidget(TopLevelDockWidget, false);
}
}