[SOLVED]will clear also delete all the QTreeWidgetItem/QListWidgetItem?
-
will clear also delete all the QTreeWidgetItem/QListWidgetItem?
i found there is takeChildren in QTreeWidgetItem, but there is only item/takeItem in QListWidget, no items()/takeItems()...... -
Yes. The items will be deleted by
clear()
as stated in the docs.QTreeWidget has takeTopLevelItem and each item has takeChild / takeChildren.
QListWidget has takeItem and it's a flat structure. List items don't have children so there's nothing there to take. -
i mean there is no takeItems in QListWidget :) i want all the items.
-
while(auto item = listWidget->takeItem(0)) { //do something with item }
-
thank you