diff --git a/src/calibre/gui2/keyboard.py b/src/calibre/gui2/keyboard.py index c5f1318df9..5324c69fdb 100644 --- a/src/calibre/gui2/keyboard.py +++ b/src/calibre/gui2/keyboard.py @@ -11,7 +11,7 @@ from functools import partial from PyQt5.Qt import (QObject, QKeySequence, QAbstractItemModel, QModelIndex, QItemSelectionModel, Qt, QStyledItemDelegate, QTextDocument, QStyle, pyqtSignal, QFrame, QAbstractItemView, - QApplication, QSize, QRectF, QWidget, QTreeView, QHBoxLayout, QVBoxLayout, + QApplication, QSize, QRectF, QWidget, QTreeView, QHBoxLayout, QVBoxLayout, QAbstractItemDelegate, QGridLayout, QLabel, QRadioButton, QPushButton, QToolButton, QIcon, QEvent) try: from PyQt5 import sip @@ -610,7 +610,7 @@ class Delegate(QStyledItemDelegate): # {{{ editor.initialize(shortcut, all_shortcuts) def setModelData(self, editor, model, index): - self.closeEditor.emit(editor, self.NoHint) + self.closeEditor.emit(editor, QAbstractItemDelegate.EndEditHint.NoHint) custom_keys = editor.custom_keys sc = index.data(Qt.ItemDataRole.UserRole).data if custom_keys is None: diff --git a/src/calibre/gui2/shortcuts.py b/src/calibre/gui2/shortcuts.py index b914681725..4898d65355 100644 --- a/src/calibre/gui2/shortcuts.py +++ b/src/calibre/gui2/shortcuts.py @@ -10,7 +10,7 @@ from functools import partial from PyQt5.Qt import ( QAbstractListModel, Qt, QKeySequence, QListView, QVBoxLayout, QLabel, QAbstractItemView, - QHBoxLayout, QWidget, QApplication, QStyledItemDelegate, QStyle, QIcon, + QHBoxLayout, QWidget, QApplication, QStyledItemDelegate, QStyle, QIcon, QAbstractItemDelegate, QTextDocument, QRectF, QFrame, QSize, QFont, QKeyEvent, QRadioButton, QPushButton, QToolButton, QEvent ) @@ -187,7 +187,7 @@ class Delegate(QStyledItemDelegate): setattr(editor, 'shortcut%d'%(x+1), seq) def setModelData(self, editor, model, index): - self.closeEditor.emit(editor, self.NoHint) + self.closeEditor.emit(editor, QAbstractItemDelegate.EndEditHint.NoHint) custom = [] if editor.custom.isChecked(): for x in ('1', '2'):