Children and members are two distinct things.
Why would it?But why does deleting them in the MainWindow destructor not cause a memory fault?
Think what is the order of destructor calls when using C++ inheritance.If the action instances were in fact first-class children of the MainWindow instance, shouldn't they have already been deleted by the QObject system before it gets to my destructor?
Here a pointer to an object is a member variable, not the object itself. You can have 10 pointers pointing to the same object and all these can be member variables of different objects. The pointed object doesn't have to be a member variable of any object.And by "member variable" I meant that the member variable is a QAction *, not QAction.






Reply With Quote
Bookmarks