mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 23:51:33 +08:00
Prevent deletion of DockWidgetSideTabs if SideTabBar is deleted - the DockWidget is the real owner
This commit is contained in:
parent
c94155fb06
commit
11223bf664
@ -110,6 +110,13 @@ CSideTabBar::CSideTabBar(CDockContainerWidget* parent, SideBarLocation area) :
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
CSideTabBar::~CSideTabBar()
|
CSideTabBar::~CSideTabBar()
|
||||||
{
|
{
|
||||||
|
// The SideTabeBar is not the owner of the tabs and to prevent deletion
|
||||||
|
// we set the parent here to nullptr to remove it from the children
|
||||||
|
auto Tabs = findChildren<CDockWidgetSideTab*>(QString(), Qt::FindDirectChildrenOnly);
|
||||||
|
for (auto Tab : Tabs)
|
||||||
|
{
|
||||||
|
Tab->setParent(nullptr);
|
||||||
|
}
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user