I'm wondering if there is a way to run a function whenever you check/uncheck a checkbox from a cell in a QTableWidget. Right now I create these checkboxes in the following way:
for row in range(len(my_list)):
self.item = QtWidgets.QTableWidgetItem()
self.item.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled)
self.item.setCheckState(QtCore.Qt.Checked)
Is there some sort of item.stateChanged.connect() method for this? I even tried to, for every click in the table, check for the state of the item in the row clicked but it returns 2 every time, as if it's always checked:
if self.mytable.item(row,1).checkState() == QtCore.Qt.Checked:
Thanks