Qt/C++: Signal for when a QListWidgetItem is checked?

前端 未结 2 1878
遥遥无期
遥遥无期 2021-01-04 05:02

In my form I have a QListWidget which contains checkable QListWidgetItems. I\'m looking for a way to capture the event of a QListWidgetItem

2条回答
  •  被撕碎了的回忆
    2021-01-04 05:30

    An extra option is to use your own QAbstractListModel with a QListView. At first this does add some extra code as you need to add your own management code . But you do get a lower level access. Basically because the QListView will ask your model what to do. It will also relay input back to your listmodel where you can hook into it.

    Alternatively you could subclass QStandardItemModel and catch certain edits related to changing the checkbox.

提交回复
热议问题