I have made multi-select QComboBox. Items are checkable (every item have check box and text value). CheckBox is checked only when user click on it. What I want
You need to connect a handler to the pressed signal of the combo's view:
self.ui.comboBox.view().pressed.connect(self.handleItemPressed)
...
def handleItemPressed(self, index):
item = self.ui.comboBox.model().itemFromIndex(index)
if item.checkState() == QtCore.Qt.Checked:
item.setCheckState(QtCore.Qt.Unchecked)
else:
item.setCheckState(QtCore.Qt.Checked)