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. MenuBar Alt-key problem

MenuBar Alt-key problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • S Offline
    S Offline
    skammers
    wrote on last edited by
    #1

    Hey!

    I have a MenuBar containing some Menu Elements. In each Menu element you have some MenuItem elements.
    The weird thing is that when I am using my program, and press the Alt-key, I guess to focus is automatic set to the first Menu item in the menu bar, becuase if I use Key-up or Key-down the Menu item opens. But when it is open, you cant do anything more, the key-up and key-down are not doing anything more. Neither is the tab button. To continue using my program I need to use the mouse and click outside of the Menu.

    I want to disable the Alt-key so that it does not behave like this.

    Any tips?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      butterface
      wrote on last edited by
      #2

      Override the keyPressEvent and do not pass it through.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        skammers
        wrote on last edited by
        #3

        I cant get that to work? How would you do it? I tried

        @
        Keys.onPressed: {
        if(event.key === Qt.Key_Alt){
        console.log("Alt pressed");
        }
        }
        @

        but it still moves the focus to the menu bar..

        1 Reply Last reply
        0
        • S Offline
          S Offline
          skammers
          wrote on last edited by
          #4

          in addition to printing out "Alt pressed", so it does both...

          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