I\'m finding it frustratingly hard to find a simple way to delete my selected QTreeWidgetItem.
QTreeWidgetItem
My patchwork method involves setting the tree\'s current sele
The QTreeWidget class has an invisibleRootItem() function which allows for a somewhat neater approach:
QTreeWidget
root = tree.invisibleRootItem() for item in tree.selectedItems(): (item.parent() or root).removeChild(item)