Try to set attribute Qt::WA_DeleteOnClose for the main window. This assures that the main window is deleted upon closing and so the dialog should be destructed also.
Try to set attribute Qt::WA_DeleteOnClose for the main window. This assures that the main window is deleted upon closing and so the dialog should be destructed also.
J-P Nurmi
I thought that the MainWindow was set to this as default. Thanks, I will try that. It's good to know, but I solved the problem with implementing the closeEvent() and close down all dialogs there. I needed to save the state of the dialogs anyway...
But is the parent child relation ok?
Because I'm a bit unsure about how the destruction of the widgets work. Can't find it explained in detail on the homepage. According to what I've understaned , is the children automatically destructed when the parent is destructed. But what about orphins? Do I need to destroy them myself, or does Qt's main loop take care of this when I close down the Qt session?
thanks
pir
If a QObject is destructed, it destroys all its children each of which in turn destroy all its children, etc.Originally Posted by pir
You have to destroy them yourself. Qt doesn't do anything *magic*, it's just a C++ library.But what about orphins? Do I need to destroy them myself, or does Qt's main loop take care of this when I close down the Qt session?
Bookmarks