Fixed double emission of focusedDockWidgetChanged() signal

This commit is contained in:
Uwe Kindler
2020-07-07 14:38:03 +02:00
parent 8cf4134125
commit 9974256d71
3 changed files with 30 additions and 7 deletions

View File

@@ -447,7 +447,8 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
{
ADS_PRINT("CDockAreaWidget::removeDockWidget");
auto NextOpenDockWidget = nextOpenDockWidget(DockWidget);
auto CurrentDockWidget = currentDockWidget();
auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;
d->ContentsLayout->removeWidget(DockWidget);
auto TabWidget = DockWidget->tabWidget();
@@ -466,7 +467,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
DockContainer->removeDockArea(this);
this->deleteLater();
}
else
else if (DockWidget == CurrentDockWidget)
{
// if contents layout is not empty but there are no more open dock
// widgets, then we need to hide the dock area because it does not