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

Shortcut context incorrectly handled on macOS while modal dialog is open

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.3, 6.9.1
    • Widgets: Main Window
    • None
    • Qt 6.9.1 for macOS
      macOS Sequoia 15.1
    • macOS

      On macOS, when a QFileDialog::getSaveFileName dialog is shown, application-level shortcuts in the menu bar are still triggered, even if their shortcutContext is set to WindowShortcut or WidgetShortcut.

      For example, when arrow keys (Left/Right) are assigned as shortcuts to menu actions, pressing those keys while editing the filename in the dialog results in the shortcut being triggered, rather than moving the text cursor. This makes it impossible to navigate within the text field using the arrow keys.

      This issue does not occur on Windows or Linux, where the modal dialog correctly prevents interaction with the application menu and its shortcuts.

      Expected behavior:
      While a modal dialog like QFileDialog::getSaveFileName is open, application shortcuts should be disabled or ignored to allow proper interaction with the dialog, especially with text input fields.

      Steps to reproduce:

      1. Extract and build the attached project shortcut_context.zip.
      2. Run the application.
      3. Click the “Save as” button to open a save file dialog.
      4. Type test in the filename field, and press the Left or Right arrow key.
      5. Observe that the text cursor does not move, and instead a log message like Action Left(Right) triggered. is printed, showing that the menu shortcut is erroneously triggered.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ayamamoto Atsushi Yamamoto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes