More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-20 11:10:59 +05:30
parent 168e58d704
commit 1936320bac
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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'):