PDA

View Full Version : link keybooard 'enter' button to our callback.



newtowindows
29th October 2009, 12:24
Hi...
My desktop apps login page is as follows....

User id ________
Password ________

(Login Push Button) (Exit Push Button)

I wrote call back function(slot for clicked() signal) for Login push button.

Qn: After entering user id, password , i need to click on Login button(through mouse).
But is there any possibility that same slot will be exicuted, when i hit 'enter' button in my keyboard?(Its just like gmail login.. Here we need not to click login button. we just hit enter in our key board)

high_flyer
29th October 2009, 18:56
See QAction.
You can also have a look at QKeyEvent

lyuts
10th November 2009, 14:07
Or you can use setDefault(true) from your Login Push Button.
See this (http://http://doc.trolltech.com/4.5/qpushbutton.html#default-prop).

danger89
18th April 2011, 20:22
Link should be:
http://doc.trolltech.com/4.5/qpushbutton.html#default-prop