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

Shortcut active when modal dialog is active

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      I'm using Qt 5.12.3 on macOS 10.14.4.
    • Platform/s:
      macOS

      Description

      I have a QML application with two menu item:

      • File/Open... trigger open file modal dialog
      • Control/Up just log something on the output console. This item has the up arrow keyboard shortcut association.

      Strangely, the shortcut is still active when the open file dialog is display. This make impossible the use of the up arrow to select a given file for example since the shortcut is bind to another action.

      In a regular Qt widget application, the menu shortcut is not handled when a modal dialog is on screen.

       

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import Qt.labs.platform 1.1
      
      Window {
          visible: true
          width: 640
          height: 480
          title: "Hello World"
      
          FileDialog {
              id: fileDialog
          }
      
          MenuBar {
              Menu {
                  title: "File"
                  MenuItem {
                      text: "Open"
                      shortcut: StandardKey.Open
                      onTriggered: fileDialog.open()
                  }
              }
              Menu {
                  title: "Control"
                  MenuItem {
                      text: "Up"
                      shortcut: "Up"
                      onTriggered: console.log("up!")
                  }
              }
          }
      }
       

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            martindelille Martin Delille
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes