When you have a QMenuBar without a parent the submenu shortcuts don't work unless if you open the menu that contains the submenu which has some items with shortcuts.
When the QMenuBar has a parent the shortcuts seem to work as long as the parent is not hidden, if the menu that contains the submenu which has some items with shortcuts is opened by the user then the shortcuts work even when the QMenuBars parent widget is hidden.
Steps to reproduce the issue:
1. Run attached test application from QTBUG-57076.tar.gz
2. Press CMD+ALT+O
3. Press CMD+ALT+L
Both shortcuts work
Only the shortcut on the first menu level works (CMD+ALT+O)
(Issue not reproducible with example app from main.cpp. Left there for archival only.)