Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED]how to clear the children of a QTreeWidgetItem?
opengpu2 last edited by opengpu2
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;