summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/Trellis/QtDynamicGridLayout.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp b/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp
index b753ffa..2509b3f 100644
--- a/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp
+++ b/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp
@@ -138,19 +138,21 @@ void QtDynamicGridLayout::setCurrentIndex(int index) {
} else {
assert(false);
}
}
void QtDynamicGridLayout::removeTab(int index) {
int tabIndex = -1;
QtTabWidget* tabWidget = indexToTabWidget(index, tabIndex);
if (tabWidget) {
+ QWidget* tab = tabWidget->widget(tabIndex);
tabWidget->removeTab(tabIndex);
+ tab->setParent(nullptr);
}
}
/**
* This event filter serves the purpose of filtering out all QEvent::Show events targeted at
* all widgets excepts the currently moving widget.
* It is required because of the way Qt internally implements the QTabBar::moveTab method.
* It does not move the actual tab in the underlying structure, but instead removes it from
* a stacked layout and later adds it again.