Pyqt clears all branch methods under a qtreeewidgetitem

Time:2020-1-23

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.

Recommended Today

PHP realizes UnionPay business H5 payment

UnionPay business H5 payment interface document: document address 1: H5 payment interface address: 1: Alipay payment Test address: http://58.247.0.18:29015/v1/netpay/trade/h5-pay Official address: https://api-mop.chinaums.com/ 2: UnionPay payment Test address: http://58.247.0.18:29015/v1/netpay/uac/order Official address: https://api-mop.chinaums.com/ 2: Basic parameters required by the interface The interface uses get parameters. After the interface parameters are directly put into the interface address, the […]