From 8102a784bf4ee52b1bf7c0d4f121b89e8504c19d Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 25 Feb 2020 14:48:18 +0000 Subject: [PATCH] Update ToolWindowManager to eb4eb70f1 --- .../toolwindowmanager/ToolWindowManager.cpp | 22 ++++++++----------- .../toolwindowmanager/ToolWindowManager.h | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp index 5e0466468..6a23a9ee6 100644 --- a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp +++ b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp @@ -244,9 +244,9 @@ void ToolWindowManager::moveToolWindows(QList toolWindows, } else if(area.type() == NewFloatingArea) { - ToolWindowManagerWrapper *wrapper = new ToolWindowManagerWrapper(this, true); - ToolWindowManagerArea *floatArea = createArea(wrapper); + ToolWindowManagerArea *floatArea = createArea(); floatArea->addToolWindows(toolWindows); + ToolWindowManagerWrapper *wrapper = new ToolWindowManagerWrapper(this, true); wrapper->layout()->addWidget(floatArea); wrapper->move(QCursor::pos()); wrapper->updateTitle(); @@ -294,7 +294,7 @@ void ToolWindowManager::moveToolWindows(QList toolWindows, delete item; - ToolWindowManagerArea *newArea = createArea(splitter); + ToolWindowManagerArea *newArea = createArea(); newArea->addToolWindows(toolWindows); if(area.type() == TopWindowSide || area.type() == LeftWindowSide) @@ -358,7 +358,7 @@ void ToolWindowManager::moveToolWindows(QList toolWindows, { insertIndex++; } - ToolWindowManagerArea *newArea = createArea(parentSplitter); + ToolWindowManagerArea *newArea = createArea(); newArea->addToolWindows(toolWindows); parentSplitter->insertWidget(insertIndex, newArea); @@ -386,7 +386,7 @@ void ToolWindowManager::moveToolWindows(QList toolWindows, splitter->setOrientation(Qt::Horizontal); } - ToolWindowManagerArea *newArea = createArea(splitter); + ToolWindowManagerArea *newArea = createArea(); // inherit the size policy from the widget we are wrapping splitter->setSizePolicy(area.widget()->sizePolicy()); @@ -664,14 +664,9 @@ void ToolWindowManager::restoreState(const QVariantMap &dataMap) } } -ToolWindowManagerArea *ToolWindowManager::createArea(QWidget *owner) +ToolWindowManagerArea *ToolWindowManager::createArea() { - if(owner == NULL) - { - owner = this; - } - - ToolWindowManagerArea *area = new ToolWindowManagerArea(this, owner); + ToolWindowManagerArea *area = new ToolWindowManagerArea(this, 0); connect(area, SIGNAL(tabCloseRequested(int)), this, SLOT(tabCloseRequested(int))); return area; } @@ -686,6 +681,7 @@ void ToolWindowManager::releaseToolWindow(QWidget *toolWindow) } previousTabWidget->removeTab(previousTabWidget->indexOf(toolWindow)); toolWindow->hide(); + toolWindow->setParent(0); } void ToolWindowManager::simplifyLayout() @@ -881,7 +877,7 @@ QSplitter *ToolWindowManager::restoreSplitterState(const QVariantMap &savedData) } else if(itemType == QStringLiteral("area")) { - ToolWindowManagerArea *area = createArea(splitter); + ToolWindowManagerArea *area = createArea(); area->restoreState(itemValue); splitter->addWidget(area); } diff --git a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h index b4699037b..48539d66c 100644 --- a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h +++ b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h @@ -343,7 +343,7 @@ protected: * \brief Creates new area and sets its default properties. You may reimplement * this function to change properties of all tab widgets used by this class. */ - virtual ToolWindowManagerArea *createArea(QWidget *owner = NULL); + virtual ToolWindowManagerArea *createArea(); private slots: void tabCloseRequested(int index);