PyQt Tree Widget, adding check boxes for dynamic removal

前端 未结 4 742
一生所求
一生所求 2020-12-28 11:21

I am attempting to create a tree widget that will essentially allow the user to view various breakdowns of data and have the option to delete certain items. In order to do t

4条回答
  •  时光取名叫无心
    2020-12-28 11:36

    QTreeWidgetItem actually has a built in check box that you can use fairly easily.

    For example:

    item = QTreeWidgetItem(self.treeWidget)
    
    item.setCheckState(0, QtCore.Qt.Unchecked)
    

提交回复
热议问题