当前位置:主页 > 软件编程 > Python代码 >
时间:2021-06-09 08:08:02 | 栏目:Python代码 | 点击:次
1.循环删除
#这个是我选中其中的一个分支进行右键清空操作时进行的处理 for i in range(self.tree.currentItem().childCount()): self.tree.currentItem().removeChild(self.tree.currentItem().child(0))
如上,采用循环删除某一个分支的方法进行处理。