-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.9.1
-
None
-
Debian 13, Qt Creator
Context:
I have an application which is using a QMdiArea and some subwindows. I'd like to be able to detach subwindows to make them floating windows. Settings the parent to nullptr and call setVisible is enough while dealing with pure QWidget subwindows.
But that leads to crash when the subwindow contains a QQuickWidget. (see example in the archive).
Summarize:
QMdiSubWindow reparenting crash when there is an QQuickWidget as internal widget.
The code: (Which is fine with normal QWidget subwindows)
connect(m_ctrl, &MainController::detachChanged, this, [this](){ if(m_ctrl->detach()) { m_subWin->setParent(nullptr); m_subWin->setVisible(true); } else { ui->mdiArea->addSubWindow(m_subWin); m_subWin->setVisible(true); } });
The example :
I made a simple example of the issue with 2 subwindows. The QML subwindow (red one) leads to the crash, while the QWidget (the small one) can be detach and reattach easily.