1. Circular deletion
#This is the processing when I select one of the branches for the right-click clear operation for i in range(self.tree.currentItem().childCount()): self.tree.currentItem().removeChild(self.tree.currentItem().child(0))
As mentioned above, a branch is removed circularly.
The above pyqt clears all the branch methods under a qtreeewidgeitem, which is all the content that Xiaobian has shared with you. I hope it can give you a reference, and I hope you can support developer more.