Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2, 6.2.3
-
Linux X11 (org.kde.desktop theme, Desktop theme, Flatpak with KDE SDK), Windows (tested through wine, fusion theme)
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.