Remove shortcut set to QAction
-
I have QT application developed with many QAction's (Menu & Toolbar). While creating this QAction's, shortcut key is associated with it. I want to allow user to remove the shortcut so that it can be used with other action as per his choice. But there is no API in QAction class to remove the shortcut.
Is it doable?
Thanks a lot.
-
hi
http://doc.qt.io/qt-5.5/qaction.html#shortcut-prop
cannot be used ? -
@mrjj When I understand the documentation correctly you just have to do
QAction::setShortcut(QKeySequence())
to remove a currently assigned keyboard shortcut -
@Joel-Bodenmann This does not seem to be correct. (at least not anymore).
Tested it right now. While debuging it seems to remove the item from shortcut map, but the shortcut still works. :(
-
@Kapitan-Papiroveho-Lodstva hi,
Which version of Qt are you using ?
Can you provide a minimal compilable example that shows the behavior ?