QMdiSubWindows - Deleting
I'm writing an application using QT that involves using the QMdiArea and consequently the creation of QMdiSubwindows.
Creating a sub window is fine, using QMdiArea::createSubWindow but when it comes to deleting them I have one question puzzling me.
My child windows are created automatically when a device is plugged into a USB port, and similarly the window is automatically closed should the device be detached from the USB port, and I do this with the QMdiArea::removeSubWindow(). I notice in the QT documentation that this function does not delete the QMdiSubWindow passed to it, and if I try
Code:
delete mdiSubWindow
The application crashes.. so just how am I supposed to delete it from memory, or have I misunderstood the documentation ?
Re: QMdiSubWindows - Deleting
Does it help if you use deleteLater() instead of delete directly?
Also, perhaps the subwindow gets removed from the mdiArea automatically after it has been deleted.