Don't use QAction::setShortcut

Andreas Pakulat apaku at gmx.de
Thu Oct 2 21:01:38 UTC 2008


Hi,

I've just gone through part of our codebase (basically every plugin thats
loaded by default - including cmake and cpp) to fix all occurences of
QAction::setShortcut. The problem with that method is that it doesn't work
properly with KDE's shortcut editor (for details I think you need to read
KAction sources or ask Michael Jansen). So instead KAction should be used,
in fact we should probably always use KAction over QAction - just with
other classes where there's a QXX and KXX version.

Problematic setShortcut uses can be easily found with an up-to-date kdelibs
and the debug output from kdeui/xmlgui. There's an error message that
starts with "Shortcut for action <actionname>.." that indicates which
action is a QAction and hence its setShortcut is called.

Andreas

-- 
Is that really YOU that is reading this?




More information about the KDevelop-devel mailing list