Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
[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;