[SOLVED]how to clear the children of a QTreeWidgetItem?
how to clear the children of a QTreeWidgetItem?
i just found item.takeChildren();
is there any better way to do this?
Depends on what you mean by "better" ;)
That's pretty standard way to do this. If you also want to delete them here's a one-liner:
foreach(auto i, item.takeChildren()) delete i;