[PyQt] problem setting multiple shortcuts for QAction

Wilo Denja wilo108 at gmail.com
Mon Jul 7 18:58:17 BST 2014


Hi,

I'm trying to set two shortcuts for the same QAction in PyQt5, using the
following code:

zoom_in_action = QtWidgets.QAction('Increase Text Size', self)
zoom_in_action.setShortcuts(['Ctrl++', 'Crtl+='])

The primary shortcut (i.e. the first one) works fine, but the second
does not.  If I swap the two key sequences around, then it's the same --
the primary one works, the other does not.

It should work this way, shouldn't it?  Should I file a bug?  Is there a
workaround, perhaps?

Thank you!

wilo



More information about the PyQt mailing list