mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround for Qt 5 regression that prevented the keyboard shortcuts for the various Similar books actions from working
This commit is contained in:
parent
dfac964265
commit
73366a79d6
@ -9,6 +9,7 @@ from functools import partial
|
||||
|
||||
from PyQt5.Qt import QToolButton
|
||||
|
||||
from calibre.constants import isosx
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
||||
class SimilarBooksAction(InterfaceAction):
|
||||
@ -30,6 +31,11 @@ class SimilarBooksAction(InterfaceAction):
|
||||
ac = self.create_action(spec=(text, icon, None, shortcut),
|
||||
attr=target)
|
||||
m.addAction(ac)
|
||||
if isosx:
|
||||
# For some reason with Qt 5 the keyboard shortcuts for these
|
||||
# actions dont work unless the actions are added to the main
|
||||
# window
|
||||
self.gui.addAction(ac)
|
||||
ac.triggered.connect(partial(self.show_similar_books, target))
|
||||
self.qaction.setMenu(m)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user