def createEditor(self, parent, option, index): if index.column() == 0: if self.completion_data: from calibre.gui2.complete2 import EditWithComplete editor = EditWithComplete(parent) editor.set_separator(None) editor.update_items_cache(self.completion_data) else: from calibre.gui2.widgets import EnLineEdit editor = EnLineEdit(parent) return editor return QItemDelegate.createEditor(self, parent, option, index)
def destroyEditor(self, editor, index): self.editing_finished.emit(index.row()) QItemDelegate.destroyEditor(self, editor, index)
def __init__(self, table): QItemDelegate.__init__(self) self.table = table self.completion_data = None
def __init__(self, completion_data): QItemDelegate.__init__(self) self.completion_data = completion_data