Results 1 to 3 of 3

Thread: [QComboBox] avoid Enter keypress to select empty combo entry

  1. #1
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default [QComboBox] avoid Enter keypress to select empty combo entry

    Hi
    Following Wysota advice and my combo preselection problem,
    I added an empty entry to my comboboxes.
    I now have the side effect that typing enter (to trigger the dialog default button) selects the empty entry.
    Should I filter the event or is there an easier way ?
    Thnks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [QComboBox] avoid Enter keypress to select empty combo entry

    We'd have to see your dialog. It shouldn't work that way as you describe, can you explain exactly what happens? Especially, which widget has focus when you press enter?

  3. #3
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [QComboBox] avoid Enter keypress to select empty combo entry (solved-no error)

    You are right : it does not behave the way I described.
    It was a mistake of mine in handling the cancel button.

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.