[PyQt] Keyboard shortcut for specific widget
mail at jdborg.com
Mon Sep 2 10:00:49 BST 2013
I'm trying to use QShortcut to set a keyboard shortcut, only for when a
certain widget is focused.
I thought that by setting the parent, this would work. For example:
But, this is fired when ever Ctrl+Return is pressed. I know I can do this
by subclassing QWidget and overwriting setShortcut, but this seems overkill?
Is there an easier way?
I think this can be done using QShortcutContext
doesn't work either.
Joseph David Borġ
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt