Results 1 to 4 of 4

Thread: link keybooard 'enter' button to our callback.

  1. #1
    Join Date
    Oct 2009
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default link keybooard 'enter' button to our callback.

    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)

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: link keybooard 'enter' button to our callback.

    See QAction.
    You can also have a look at QKeyEvent
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: link keybooard 'enter' button to our callback.

    Or you can use setDefault(true) from your Login Push Button.
    See this.
    I'm a rebel in the S.D.G.

  4. #4
    Join Date
    Apr 2011
    Posts
    3
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: link keybooard 'enter' button to our callback.


Similar Threads

  1. Replies: 2
    Last Post: 31st July 2009, 20:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.