How to make QTableView refresh Background color after it loads data again
问题 i have the following doubt regarding QTableView , i have added some code that changes the row background depending on what string the dataframe contains on the last column. def data(self, index, role=Qt.DisplayRole): if index.isValid(): if role == Qt.BackgroundRole: if df.iloc[index.row(),5] == "Ready for QC": return QBrush(Qt.yellow) if df.iloc[index.row(),5] == "In Progress": return QBrush(Qt.green) if role == Qt.DisplayRole: return str(self._data.iloc[index.row(), index.column()]) return