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,
|
from PyQt5.Qt import (QObject, QKeySequence, QAbstractItemModel, QModelIndex, QItemSelectionModel,
|
||||||
Qt, QStyledItemDelegate, QTextDocument, QStyle, pyqtSignal, QFrame, QAbstractItemView,
|
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)
|
QGridLayout, QLabel, QRadioButton, QPushButton, QToolButton, QIcon, QEvent)
|
||||||
try:
|
try:
|
||||||
from PyQt5 import sip
|
from PyQt5 import sip
|
||||||
@ -610,7 +610,7 @@ class Delegate(QStyledItemDelegate): # {{{
|
|||||||
editor.initialize(shortcut, all_shortcuts)
|
editor.initialize(shortcut, all_shortcuts)
|
||||||
|
|
||||||
def setModelData(self, editor, model, index):
|
def setModelData(self, editor, model, index):
|
||||||
self.closeEditor.emit(editor, self.NoHint)
|
self.closeEditor.emit(editor, QAbstractItemDelegate.EndEditHint.NoHint)
|
||||||
custom_keys = editor.custom_keys
|
custom_keys = editor.custom_keys
|
||||||
sc = index.data(Qt.ItemDataRole.UserRole).data
|
sc = index.data(Qt.ItemDataRole.UserRole).data
|
||||||
if custom_keys is None:
|
if custom_keys is None:
|
||||||
|
@ -10,7 +10,7 @@ from functools import partial
|
|||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QAbstractListModel, Qt, QKeySequence, QListView, QVBoxLayout, QLabel, QAbstractItemView,
|
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
|
QTextDocument, QRectF, QFrame, QSize, QFont, QKeyEvent, QRadioButton, QPushButton, QToolButton, QEvent
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ class Delegate(QStyledItemDelegate):
|
|||||||
setattr(editor, 'shortcut%d'%(x+1), seq)
|
setattr(editor, 'shortcut%d'%(x+1), seq)
|
||||||
|
|
||||||
def setModelData(self, editor, model, index):
|
def setModelData(self, editor, model, index):
|
||||||
self.closeEditor.emit(editor, self.NoHint)
|
self.closeEditor.emit(editor, QAbstractItemDelegate.EndEditHint.NoHint)
|
||||||
custom = []
|
custom = []
|
||||||
if editor.custom.isChecked():
|
if editor.custom.isChecked():
|
||||||
for x in ('1', '2'):
|
for x in ('1', '2'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user