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

Quick: ALT+ menu bar shortcuts not working when using Drawer.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2, 6.2.3
    • Quick: Controls 2
    • Linux X11 (org.kde.desktop theme, Desktop theme, Flatpak with KDE SDK), Windows (tested through wine, fusion theme)
    • Linux/Wayland, Linux/X11, Windows

    Description

      When using the MenuBar element from QtQuick.Controls 2 into an ApplicationWindow that has a drawer with Menus and Items having assigned an ALT+ shortcut (by using an & in the menu/item title), the according shortcuts do not do anything.
      Qt DOES detect the shortcuts and indicates they can be used through the underline that exists under the menu and actions items, but does not detect them.

      Steps to reproduce:

      • Launch qml qtbug100539.qml
      • Press Alt-F (to trigger file menu)
      • Expected: File menu opens Actual: File menu does not open
      • (Remove the drawer: Works as expected)

      Affected platforms:

      • Linux X11 under KDE Plasma (org.kde.desktop theme)
      • Linux X11 with Desktop theme- Linux Flatpak with KDE SDK (v5.15)
      • Windows (tested through wine), Fusion theme
      • PySide2 v5.15.2 (open source), v5.15.2.1 (PyPi version)
      • Python v3.9.7, v3.8.6- Qt v5.12.2 (qmlscene)

      Sample QML code:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      ApplicationWindow {
          visible: true
          width: 1000
          height: 500
          menuBar: MenuBar {
              Menu {
                  title: qsTr("&File")
                  Action {
                       text: qsTr("&Open")
                       shortcut: StandardKey.Open
                       icon.name: 'document-open'
                  }
      
                  MenuSeparator { } 
                  Action {
                      text: qsTr("&Quit")
                      shortcut: StandardKey.Quit
                      onTriggered: Qt.quit()
                      icon.name: 'application-exit'
                  }
              }
          }
          Drawer {
              visible: true
              position: 1
              interactive: false
          }
      }
      
      from PySide2.QtWidgets import QApplication
      from PySide2.QtQml import QQmlApplicationEngine
      from sys import argv
      from os import path, getcwd
      
      app = QApplication(argv)
      engine = QQmlApplicationEngine()
      engine.load(path.realpath(path.join(getcwd(), "bug.qml")))
      exit_code = app.exec_()
      

      Full source:

      Note: I've simply removed the Drawer to fix this bug, but this break the responsiveness of my app.

      Attachments

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ad5001 Ad Sooi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: