I am using PyQt4 and Qt Designer. I have a QListWidget
in which I populate after loading a file in my program.
I want to set it so that all items will be checkable, as opposed to just selectable. I have found online that this is a 'flag' of the QListWidget
, however, in Qt Designer I can't see where to do this.
Is it possible?
You can do this by opening the edit list widget item tab , and look into the properties. and set the checkState property.
**UPDATE **
item = QtGui.QListWidgetItem()
item.setText(QtGui.QApplication.translate("Dialog", x, None, QtGui.QApplication.UnicodeUTF8))
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
item.setCheckState(QtCore.Qt.Unchecked)
self.listWidget.addItem(item)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With