Issue
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?
Solution
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)
Answered By - thecreator232
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.