[PyQt] Key return
milan at 3trees.cz
Sat Nov 22 18:39:26 GMT 2008
On Saturday 22 November 2008 00:32:30 David Boddie wrote:
if press ENTER on the button with focus - call action for this button ( same
like if press key SPACE
> On Sat Nov 1 17:46:29 GMT 2008, lucaberto wrote:
> > i need that when i press the Return key, one button intercept the
> > pression of it and process the event Can you explain me how i can do it
> On Fri Nov 21 11:02:02 GMT 2008, Milan Hemžal wrote:
> > On Sunday 02 November 2008 18:46:44 Matt Smith wrote:
> > Ok, but i also have this problem.
> > pls. howto use press enter in button if have more button?
> All of this depends on how you guys are using those buttons.
> If you are using a QDialog subclass, you can make one of the buttons the
> "default" button for the dialog:
> If you are using some other widget to display the buttons, there are other
> ways to connect a key press with a specific button. For example, you could
> create an action with a keyboard shortcut, connect its triggered() signal
> to a push button's animateClick() slot, and add it to the button's parent
> # b is the chosen button
> # w is the button's parent widget
> action = QAction(w)
> w.connect(action, SIGNAL("triggered()"), b, SLOT("animateClick()"))
> You might need to add another action to the widget if you also want the
> Enter key to have the same effect as the Return key.
> PyQt mailing list PyQt at riverbankcomputing.com
3 Trees s.r.o.
Dřevěné podlahy a koupelny
GSM +420 775 393 335
More information about the PyQt