[SOLVED] QMenu shortcut to menu NOT action
I would like to solve my issue and I hope you can help in this for me.
I can set a shortcut to QActions but not for QMenus. I mean in the way of Qt Creator, e.g.: ALT+F for File menu.
How can I implement this?
Thank you for your time :)
Hi and welcome to devnet,
IIRC, you can set the shortcut you want on the action return by "QMenu::actionMenu":http://doc.qt.io/qt-5/qmenu.html#menuAction
Hope it helps
When editing the text of the menu, write an ampersand just before the character you want to be associated with the menu. For example, if you have a 'File' entry in your main menu bar, just write '&File' as the menu's text, and the next time you run your application you will be able to press Alt+F for that menu. If you wrote 'Fil&e' as your menu's text, then you will have to press Alt+E for that menu.
Err… I misread your post. danieltm64 is right. The full explanation can be found in "QMenuBar's documentation":http://doc.qt.io/qt-5/qmenubar.html#details
Really lot of thank you, guys:) It was to easy to believe :D