Prevent QMdiArea object from removing QMdiSubWindow when user clicks close button
I want the hide the sub window and not remove it when the user clicks the close button on the sub window. How do I prevent the QMdiArea object from removing this object?
Hi and welcome to devnet,
From the top of my head: subclass QMdiSubWindow and reimplement it's closeEvent to hide rather than close.
Hope it helps
I know two ways to do it:
Hidde the close button of the QMdiSubWindow:
@subwindow->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowMinMaxButtonsHint);@
Avoid the close accion re-writing the close event of the QWidget of the subwindow:
@void YourWidget::closeEvent(QCloseEvent *e)