def setEditorData(self, editor: QWidget, index: QModelIndex) -> None: dst_prop = editor.metaObject().userProperty() if dst_prop.isValid(): name = dst_prop.name() setattr(editor, name, index.data(role=Qt.EditRole)) super().setEditorData(editor, index)
def setEditorData(self, editor: QWidget, index: QModelIndex) -> None: conf = index.data(role=Qt.EditRole) editor.config = conf super().setEditorData(editor, index)