Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.10.1, 5.11.1, 5.12.0
-
None
-
Windows 10, Visual Studio 2017
-
-
cc33dd079796437bafed8f42de7fbf8f17d19ec8 (qt/qtbase/5.13), ba639edd2 (dev)
Description
Qt 5.10 introduced Qt::AA_DontShowShortcutsInContextMenus attribute to allow hiding shortcuts in context menus. The previous behavior (showing shortcuts) is set as default (attribute set to false).
Unfortuanely it is broken (at least on Windows) and shortcuts don't show up at all no matter if the attribute is set to true or false.
Sample code:
#include <QApplication> #include <QWidget> #include <QAction> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget w; w.setContextMenuPolicy(Qt::ActionsContextMenu); QAction act("Copy", nullptr); act.setShortcut(QKeySequence::Copy); w.addAction(&act); w.show(); return a.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-71471 No way to enable shortcuts in Standard contextMenu
- Closed
- is duplicated by
-
QTBUG-69511 QWidget context menu doesn't show short-cuts
- Closed
- relates to
-
QTBUG-73990 Context Menu Items Fonts and Hotkeys Not Displaying
- Closed
-
QTBUG-109590 styleHints()->setShowShortcutsInContextMenus(true) has no effect
- Closed
- resulted from
-
QTBUG-49435 Don't show shortcuts in context menus
- Closed