Quote Originally Posted by zaphod.b View Post
clear() won't delete the node itself, just make null node of it.

The code snippet you provided will now remove immediate child nodes, "cell elements" that is. I'd guess in general these cell elements will have child nodes themselves, e.g. text. As I wrote before, you'd have to make sure you traverse all descendant nodes, no matter what sublevel or type.
It's exactly the other way round as explained by the Qt support via email, received today.

When you call removeChild() then all it is going to do is remove it from the current tree, you still get a reference to the QDomNode that you have removed which is why it still exists in memory because it hasn't been actually deleted. If you want to ensure that the contents of the node are also deleted then you need to call clear() on that node. This will cause it to be deleted and point to a null node and therefore the memory should be freed up for you. See:

http://qt-project.org/doc/qt-4.8/qdomnode.html#clear
But I will answer them tomorrow because this is not true.
If I only call clear(), nothing is deleted. The call to clear() seems to have no consequences.
Or, probably, for clear() it's as you said about removeChild(), call it recursively.