def setModelData(self, editor: QWidget, model: QAbstractTableModel, index: QModelIndex) -> None: """ Update the model data at the given index from the editor value. Derived function. :param editor: data provider :param model: data storage :param index: index where data has to be updated :return: Nothing """ if index.isValid(): if index.column() in (0, 1): model.setData(index, editor.isChecked()) return if index.column() == 4: model.setData(index, editor.color()) return super().setModelData(editor, model, index)