When I programatically create a shortcut using setShortcut(QKeySequence("alt + X")) creates a shortcut that contains ⌥ symbol (on mac keyboards it can be found next to command key) + X, which however can't be triggered using alt + X (I have normal keyboard connected to Mac).
In Qt4 this works fine.
This happens with parent-less menubar only. The attached example can be used to reproduce the problem. It's menu has three items with shortcuts: cmd+T, alt+T and alt+shift+T. Shortcuts trigger statusbar message - except now only cmd+T triggers it. If you want to compare the behavior to a menubar with parent, remove the define from mainwindow.cpp, line 6. In that case all the shortcuts trigger the statusbar message.
One workaround is to add the alt+ actions to the mainwindow too. Then the shortcut doesn't trigger the menu action though and therefore f.ex. the menu doesn't flash, but at least they work.
|For Gerrit Dashboard: QTBUG-45453|
|224461,5||Don't ignore the shortcut when the QMenuBar is parentless||5.11||qt/qtbase||Status: MERGED||-2||0|