Skip to content Skip to sidebar Skip to footer

How To Get The Checked Items Listed In A Qt Qlistwidget

I've populated a QListWidget with a list of items and added a check box leaving everything unchecked. for td in root.iter('testdata'): test_data = td.get('ins') item = QtGu

Solution 1:

You need to check if checkState is actually Qt.Checked:

for index in range(self.listWidgetLabels.count()):
    if self.listWidgetLabels.item(index).checkState() == Qt.Checked:
        checked_items.append(self.listWidgetLabels.item(index))

Post a Comment for "How To Get The Checked Items Listed In A Qt Qlistwidget"