Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Remove shortcut set to QAction
TheKodz last edited by
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.
cannot be used ?
Joel Bodenmann last edited by
@mrjj When I understand the documentation correctly you just have to do
QAction::setShortcut(QKeySequence())to remove a currently assigned keyboard shortcut
Kapitan Papiroveho Lodstva last edited by
@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. :(
Which version of Qt are you using ?
Can you provide a minimal compilable example that shows the behavior ?