PyQt : Checkbox in QTableWidget

Posted by user1064815 on Stack Overflow See other posts from Stack Overflow or by user1064815
Published on 2012-09-11T09:20:11Z Indexed on 2012/09/11 15:38 UTC
Read the original article Hit count: 1788

Filed under:
|
|
|

I use following code to put a checkbox in the 9th column of my QTableWidget

chkBoxItem = QtGui.QTableWidgetItem()
chkBoxItem.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled)
chkBoxItem.setCheckState(QtCore.Qt.Unchecked)       
table.setItem(rowNo,9,chkBoxItem)

Where table is my QtTableWidget. I need to add the row where the checkbox is clicked to a list.. how on earth do I achieve this?

Kind regards,

© Stack Overflow or respective owner

Related posts about python

Related posts about checkbox