def createEditor(self, parent, option, index): """Return editor.""" header = index.model().horizontal_header_labels() h = header.index if header[index.column()] in ('object_class_name', 'object_name', 'parameter_name'): return CustomComboEditor(parent) elif header[index.column()] == 'json': self.json_editor_requested.emit() return None else: return CustomLineEditor(parent)
def createEditor(self, parent, option, index): """Return editor.""" header = index.model().horizontal_header_labels() h = header.index if header[index.column()] in ('relationship_class_name', 'parameter_name'): return CustomComboEditor(parent) elif header[index.column()] == 'object_name_list': editor = ObjectNameListEditor(parent) model = index.model() editor.data_committed.connect( lambda e=editor, i=index, m=model: self. close_object_name_list_editor(e, i, m)) return editor elif header[index.column()] == 'json': self.json_editor_requested.emit() return None else: return CustomLineEditor(parent)
def createEditor(self, parent, option, index): """Return editor.""" header = index.model().horizontal_header_labels() if header[index.column()] == 'fields': editor = FieldNameListEditor(parent, option, index) model = index.model() editor.data_committed.connect( lambda e=editor, i=index, m=model: self. close_field_name_list_editor(e, i, m)) return editor elif header[index.column()] == 'reference resource': return CustomComboEditor(parent) elif header[index.column()] == 'reference fields': editor = FieldNameListEditor(parent, option, index) model = index.model() editor.data_committed.connect( lambda e=editor, i=index, m=model: self. close_field_name_list_editor(e, i, m)) return editor else: return None
def createEditor(self, parent, option, index): """Return editor.""" header = index.model().horizontal_header_labels() if header[index.column()] == 'relationship name': return CustomLineEditor(parent) return CustomComboEditor(parent)