Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Highlight/focus first action in QMenu on show

Highlight/focus first action in QMenu on show

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 352 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Giert
    wrote on last edited by
    #1

    I'm having a QMenu show up with suggestions while entering text. The suggestions are arranged by probability, and usually the first suggestion is correct. This works well except the user has to click enter twice to select the item, once to first get highlighted the first item, then another time to select. Same goes for tabbing to an option. This is inefficient and unnecessary clicks for the user. Initial user testing also shows that users think it is not responding properly.

    How can i give focus or highlight to the first action in a QMenu after calling popup? So that the first item is selected with a single click on enter, and the second is highlighted with a single click on the tab button?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, you can't do that because it's not how menu works. Wouldn't you be best served with a popup like the one QCompleter provides ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      G 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        AFAIK, you can't do that because it's not how menu works. Wouldn't you be best served with a popup like the one QCompleter provides ?

        G Offline
        G Offline
        Giert
        wrote on last edited by
        #3

        @SGaist that's exactly what I need! Didn't know that existed, how incredibly convenient. Thank you!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved