def data(self, role): if role == Qt.ItemDataRole.DisplayRole: if self.is_deleted: return '' return self.current_value elif role == Qt.ItemDataRole.EditRole: return self.current_value else: return QTableWidgetItem.data(self, role)
def data(self, role): self.get_data() if role == Qt.DisplayRole: return self.val return QTableWidgetItem.data(self, role)