I've been reading up on the ownership of Qwidgets and deleting them. eg: http://qt-project.org/doc/qt-4.8/objecttrees.html
This says "You can also delete child objects yourself, and they will remove themselves from their parents"
However a lot of examples I have seen set the parent to null before deleting it. eg:
if (widget != NULL)
{
layout->removeWidget(widget);
widget->setParent(NULL);
delete widget;
}
Is there any need for the setParent(NULL);
?
Leading on from this, is there any reason why I cannot just do a
delete layout->itemAt(i);
or
delete layout->takeAt(i);
In fact, is there any real difference between these last two? I am assuming all my objects are on the heap of course.