Results 1 to 3 of 3

Thread: n00b question: Hit Enter and activate a button?

  1. #1
    Join Date
    May 2009
    Posts
    21
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default n00b question: Hit Enter and activate a button?

    Hi,

    im looking for a way to activate a button by hitting enter while i am writing in a QLineEdit.
    See the attached picture, it is a password dialog, and i want to activate the validate button when the user hits enter.

    I tried setting autodefault and default to the button, but without success!
    Attached Images Attached Images

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: n00b question: Hit Enter and activate a button?

    The QLineEdit has a signal called returnPressed().

  3. The following user says thank you to franz for this useful post:

    0xl33t (31st July 2009)

  4. #3
    Join Date
    May 2009
    Posts
    21
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: n00b question: Hit Enter and activate a button?

    Quote Originally Posted by franz View Post
    The QLineEdit has a signal called returnPressed().
    wow, that's cool!

    thanks

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.