def createEditor(self, parent, option, index): item = self.table.item(index.row(), 0) if index.column() == 0: item = self.table.item(index.row(), 0) if item.is_deleted: return None return QItemDelegate.createEditor(self, parent, option, index)
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 createEditor(self, parent, option, index): item = self.table.item(index.row(), 0) if index.column() == 0: item = self.table.item(index.row(), 0) if item.is_deleted: return None return QItemDelegate.createEditor(self, parent, option, index) if not confirm(_('Do you want to undo your changes?'), 'tag_list_editor_undo'): return item.setText(item.initial_text()) self.table.blockSignals(True) self.table.item(index.row(), 2).setData(Qt.DisplayRole, '') self.table.blockSignals(False)
def createEditor(self, parent, option, index): item = self.table.item(index.row(), 0) if index.column() == 0: item = self.table.item(index.row(), 0) if item.is_deleted: return None return QItemDelegate.createEditor(self, parent, option, index) if not confirm( _('Do you want to undo your changes?'), 'tag_list_editor_undo'): return item.setText(item.initial_text()) self.table.blockSignals(True) self.table.item(index.row(), 2).setData(Qt.DisplayRole, '') self.table.blockSignals(False)