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

Menu items can be triggered with shortcut while modal dialog is open

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.0 Alpha
    • 5.8.0, 5.10.1
    • QPA
    • None
    • macOS 10.13
    • macOS
    • 8447f5f006287887ee2910d9710d7bd867aca6e8

    Description

      There is a condition under which menu items will be shown disabled in the menu bar while a modal dialog is open, but the actions still trigger when using the shortcut:

      1. The menu bar needs to be "shared" through all application windows (i.e. have no parent)
      2. The action must have shortcutContext==Qt::ApplicationShortcut
      3. The action must be added as a menu item into the shared menu bar

      See the attached minimal example.
      After removing any one of the conditions above, the behavior will be correct and the action cannot be triggered with the shortcut while a modal dialog is open.

      Unfortunately that is the setup we have in Qt Creator (see linked bug).

      Attachments

        Issue Links

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

          Activity

            People

              dedietri Gabriel de Dietrich (drgvond)
              con Eike Ziller
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes