Basically i have combo boxes in many rows inside QTableWidget and i want to retrieve all the cells in row in which the combo-box value currentTextChanged. i have combobox link to the QTableWidget like this,
and i connect the updateTableWidget
Listener in this Qcombobox like this,
# objTableWidget of QTableWidget
cbxResult = QtWidgets.QComboBox()
cbxResult.addItems(["Matched", "Not Matched"])
objTableWidget.setCellWidget(rowCount, colCount, cbxResult)
cbxResult.currentTextChanged.connect(lambda: self.updateTableWidget(rowCount, colCount, objTableWidget=objTableWidget))
and the self.updateTableWidget
function is,
def updateTableWidget(row:int, col:int, objTableWidget:object):
print(objTableWidget.rowCount())
print(objTableWidget.objectName())
objCellWidget = objTableWidget.item(row, col)
strCellVal = objCellWidget.text()
the objCellWidget = objTableWidget.item(row, col)
return a NoneType
and
strCellVal = objCellWidget.text()
NoneType has no attribute 'text()'.
the objCellWidget = objTableWidget.item(row, col)
is working fine with default TableWidget lineEdit but doesn't work with custom Widget like i use Combobox Widget in QTableWidget.