Fixed wrong current index when removing a widget from CDockAreaLayout

This commit is contained in:
Uwe Kindler 2020-06-14 16:12:56 +02:00
parent ffed6a9c5f
commit e36655a7ab
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ int main(int argc, char *argv[])
QMainWindow w;
ads::CDockManager::setConfigFlag(ads::CDockManager::FocusHighlighting, true);
ads::CDockManager::setConfigFlag(ads::CDockManager::AllTabsHaveCloseButton, true);
auto dockManager = new ads::CDockManager(&w);
QAction *action = new QAction("New Delete On Close", &w);

View File

@ -136,6 +136,10 @@ public:
m_CurrentWidget = nullptr;
m_CurrentIndex = -1;
}
else if (indexOf(Widget) < m_CurrentIndex)
{
--m_CurrentIndex;
}
m_Widgets.removeOne(Widget);
}