Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114595

Alt modifier doesn't work in shortcuts on MacOS with parent-less menubar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.9, 5.15.10, 5.15.2, 6.2.4
    • GUI: Menus
    • None
    • macOS

    Description

      I am experiencing the same issue that has been reported here: https://bugreports.qt.io/browse/QTBUG-45453.

      I am programmatically creating an "Alt+X" shortcut using the setShortcut method, but it is not being triggered.

      This problem occurs when using a menubar without a parent, however it does not happen with the menubar provided by the QMainWindow class.

      Since our application does not have a main window, one workaround is to set an eventFilter on the application, which is not fully satisfactory (also, the menu does not flash).

      I have attached a similar example to the one in the link above.

      I am using macOS 10.15. I have checked that this issue occurs with all of: Qt 5.9.9, Qt 5.15.2, Qt 5.15.10, and Qt 6.2.4.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vestbo Tor Arne Vestbø
              steph-g Stéphane Gaydier
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes