mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
fix: better fix to switch to newly created class
This commit is contained in:
11
src/main.cpp
11
src/main.cpp
@@ -1572,14 +1572,13 @@ QDockWidget* MainWindow::createTab(RcxDocument* doc) {
|
|||||||
|
|
||||||
dock->raise();
|
dock->raise();
|
||||||
dock->show();
|
dock->show();
|
||||||
// Ensure the new dock's tab is activated in the tab bar
|
// Ensure the new dock's tab is activated in the tab bar.
|
||||||
|
// Since we tabify with the last dock, the new tab is always appended last.
|
||||||
for (auto* tabBar : findChildren<QTabBar*>()) {
|
for (auto* tabBar : findChildren<QTabBar*>()) {
|
||||||
if (tabBar->parent() != this) continue;
|
if (tabBar->parent() != this) continue;
|
||||||
for (int i = 0; i < tabBar->count(); i++) {
|
if (tabBar->count() > 0) {
|
||||||
if (tabBar->tabText(i) == dock->windowTitle()) {
|
tabBar->setCurrentIndex(tabBar->count() - 1);
|
||||||
tabBar->setCurrentIndex(i);
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user