mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 17:24:20 +02:00
Fix for shortcuts and combobox delegates
This commit is contained in:
parent
74d48de82c
commit
fca9ccc67d
1 changed files with 12 additions and 1 deletions
|
|
@ -353,6 +353,17 @@ def setModelData(self, editor, model, index):
|
|||
model.setData(index, QVariant(editor.textbox.html), Qt.EditRole)
|
||||
# }}}
|
||||
|
||||
class DelegateCB(QComboBox): # {{{
|
||||
|
||||
def __init__(self, parent):
|
||||
QComboBox.__init__(self, parent)
|
||||
|
||||
def event(self, e):
|
||||
if e.type() == e.ShortcutOverride:
|
||||
e.accept()
|
||||
return QComboBox.event(self, e)
|
||||
# }}}
|
||||
|
||||
class CcBoolDelegate(QStyledItemDelegate): # {{{
|
||||
def __init__(self, parent):
|
||||
'''
|
||||
|
|
@ -361,7 +372,7 @@ def __init__(self, parent):
|
|||
QStyledItemDelegate.__init__(self, parent)
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
editor = QComboBox(parent)
|
||||
editor = DelegateCB(parent)
|
||||
items = [_('Y'), _('N'), ' ']
|
||||
icons = [I('ok.png'), I('list_remove.png'), I('blank.png')]
|
||||
if tweaks['bool_custom_columns_are_tristate'] == 'no':
|
||||
|
|
|
|||
Loading…
Reference in a new issue