mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More stupid PyQt enums
This commit is contained in:
parent
168e58d704
commit
1936320bac
@ -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:
|
||||
|
@ -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'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user