Closing all of the mainWindow's child dialogs
Hi
I'm trying to find a way to delete all of the opened child windows (separate dialogs) of my mainWindow. Is this possible. I've looked at the destroy function of the QWidget base class, but it seems like this will destroy all the qwidgets of the mainWindow as well. Is there an easy way to do this? Or is it necessary to do some sort of recursive run through all the children?
Thanks
Jaco
Re: Closing all of the mainWindow's child dialogs
All you need to do is to pass the main window as parent to the dialogs. When the main window is destructed (Qt::WA_DeleteOnClose might become handy), all its children are automatically destructed as well.
Re: Closing all of the mainWindow's child dialogs
Thanks for the reply.
I'm aware of the solution you posted. However I want to be able to close all the opened windows without having to close the main window.
Thanks
Jaco
Re: Closing all of the mainWindow's child dialogs
Re: Closing all of the mainWindow's child dialogs
Thank you very much. This is exactly what I was looking for.
Jaco