Skip to content

Commit

Permalink
Workaround for Qt 5 regression that prevented the keyboard shortcuts …
Browse files Browse the repository at this point in the history
…for the various Similar books actions from working
  • Loading branch information
kovidgoyal committed Aug 24, 2014
1 parent dfac964 commit 73366a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/calibre/gui2/actions/similar_books.py
Expand Up @@ -9,6 +9,7 @@

from PyQt5.Qt import QToolButton

from calibre.constants import isosx
from calibre.gui2.actions import InterfaceAction

class SimilarBooksAction(InterfaceAction):
Expand All @@ -30,6 +31,11 @@ def genesis(self):
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)

Expand Down

0 comments on commit 73366a7

Please sign in to comment.