Qt 6.11 is out! See what's new in the release
blog
QTreeWidget Delete Last Item
-
Hi,
Do you have a stack trace ?
Are you sure currentItem is valid ?
-
Maybe there is some side effect even that happens which is actually the source of the crash. For example, you might have a problem if you don't handle the signal itemSelectionChanged() properly (i.e. you don't expect a no-selection case).
I tried this without problems:
while(d_machine_parameter_tree->topLevelItemCount()) { d_machine_parameter_tree->takeTopLevelItem(0); }Qt 5.6.0, OSX 10.10.5
Note: You should delete the returned widget otherwise it is a memory leak.