Skip to content

Commit

Permalink
Qt Designer: Fix assert when switching from Docked to Top Level mode …
Browse files Browse the repository at this point in the history
…with forms

Clear the active window of the QMdiArea, fixing an assert:
ASSERT failure in DockedMainWindow: "Called object is not of the correct type (class destructor may have already run)", file qobjectdefs_impl.h, line 155
when reparenting.

Pick-to: 6.4 6.3 6.2
Change-Id: Ia8078475d55c5d18839973c512093b7fcc1960ec
Reviewed-by: Jarek Kobus <[email protected]>
  • Loading branch information
FriedemannKleint committed Jun 28, 2022
1 parent e824a09 commit 3766369
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/designer/src/designer/qdesigner_workbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ void QDesignerWorkbench::switchToNeutralMode()
tw->setParent(nullptr);
}

if (m_dockedMainWindow != nullptr) // Prevent assert
m_dockedMainWindow->mdiArea()->setActiveSubWindow(nullptr);

for (QDesignerFormWindow *fw : qAsConst(m_formWindows)) {
fw->setParent(nullptr);
fw->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
Expand Down

0 comments on commit 3766369

Please sign in to comment.