diff --git a/src/DockAreaTabBar.cpp b/src/DockAreaTabBar.cpp index b109bbe68..f70f75bab 100644 --- a/src/DockAreaTabBar.cpp +++ b/src/DockAreaTabBar.cpp @@ -345,7 +345,7 @@ void CDockAreaTabBar::insertTab(int Index, CDockWidgetTab* Tab) connect(Tab, SIGNAL(moved(const QPoint&)), this, SLOT(onTabWidgetMoved(const QPoint&))); Tab->installEventFilter(this); emit tabInserted(Index); - if (Index <= d->CurrentIndex) + if (Index <= d->CurrentIndex || d->CurrentIndex == -1) { setCurrentIndex(d->CurrentIndex + 1); }