[PyQt] Key return

David Boddie david at boddie.org.uk
Sat Nov 22 19:53:18 GMT 2008


On Sat Nov 22 18:39:26 GMT 2008, Milan Hemžal wrote:

> i mean:
> if press ENTER on the button with focus - call action for this button (
> same like if press key SPACE

You can set a shortcut for the button using its setShortcut() method:

  http://doc.trolltech.com/4.4/qabstractbutton.html#shortcut-prop

So, something like

  button.setShortcut("Enter")

should work for this case.

David



More information about the PyQt mailing list