hi all please tell me how to set user defined shortcut keys in menu like(CTRL+ALT+P).
thanks with regards:
gauravg
hi all please tell me how to set user defined shortcut keys in menu like(CTRL+ALT+P).
thanks with regards:
gauravg
Hi Gauravg,
the way I do it:
1. Create a QAction (QAction *action = new QAction(tr("New"))
2. Set the shortcut for the created QAction. (action->setShortcut("Ctrl+N"))
3. Add the QAction to your menu (menu->addAction(action))
Best regards
Ralf
Do you mean that it's the user that should be able to set the shortcuts to what he wants?
If your want your app to give user possibility to set shortcuts, then implement shortcut editor inside your app and bind shortcuts to actions in runtime as in Ralf's sample.
Oleg Shparber
Bookmarks