You have to delete everything yourself, except that QObject deletes all its children itself.
So for example when you add a widget to a layout, the layout becomes parent of that widget and deletes the widget when it is destroyed.
But you need to delete your custom objects yourself.
Your list will probably be a member variable of some object. in its destructor you call:
// iterates through all items of the list and calls delete on them, but does not remove the entry from the list!
qDeleteAll(list);
// removes all entries from the list.
list.clear();
// iterates through all items of the list and calls delete on them, but does not remove the entry from the list!
qDeleteAll(list);
// removes all entries from the list.
list.clear();
To copy to clipboard, switch view to plain text mode
Joh
Bookmarks