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. Setting "hot keys" (or whatever they are called) for items in menus
QtWS25 Last Chance

Setting "hot keys" (or whatever they are called) for items in menus

Scheduled Pinned Locked Moved General and Desktop
shortcutsmenu
6 Posts 2 Posters 1.9k 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.
  • J Offline
    J Offline
    joeydonovan4
    wrote on 6 May 2015, 20:40 last edited by
    #1

    How do you set the shortcuts for opening menus and submenus? I know there is setShortcut in QAction, but I am referring to the underlining of a specific character, so when that character is pressed while the parent menu is open, the submenu will open. (e.g.) "Print" is a submenu in the file menu, and the "P" character needs to be underlined so that when it is pressed, the print dispatch will trigger. I know that putting '&' before the specified character usually notifies the program which character should be the "hot key". Just wondering if there is any specific way to do that with Qt.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 6 May 2015, 20:49 last edited by
      #2

      It's like you said: put "&" in front of the character you want to act as an accelerator.

      J 1 Reply Last reply 7 May 2015, 14:05
      0
      • C Chris Kawa
        6 May 2015, 20:49

        It's like you said: put "&" in front of the character you want to act as an accelerator.

        J Offline
        J Offline
        joeydonovan4
        wrote on 7 May 2015, 14:05 last edited by
        #3

        @Chris-Kawa The accelerators are working, but the line that usually shows up below the accelerator key is not there.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on 7 May 2015, 14:21 last edited by
          #4

          It should show up (only) when you navigate to menus via keyboard i.e. hold "alt".

          J 1 Reply Last reply 7 May 2015, 14:40
          0
          • C Chris Kawa
            7 May 2015, 14:21

            It should show up (only) when you navigate to menus via keyboard i.e. hold "alt".

            J Offline
            J Offline
            joeydonovan4
            wrote on 7 May 2015, 14:40 last edited by
            #5

            @Chris-Kawa Is there a way to make them always visible? Seems unreasonable to ask the user of the app to have to press the alt key to see them beforehand.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on 7 May 2015, 14:53 last edited by
              #6

              It's not Qt specific and that's how Windows worked from the time it was invented. The accelerators are keyboard navigation aid and they are not shown unless you use keyboard.

              1 Reply Last reply
              0

              1/6

              6 May 2015, 20:40

              • Login

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