[Qt-interest] Wish: QMenu selective display of shortcuts

KC Jones kc at asperasoft.com
Thu Apr 1 21:39:09 CEST 2010


I think this is a wishlist request.  But if there is some hidden way
to do this, please tell...

QMenu should support some way to suppress the display of shortcut keys
in its menu items.  Presumably via a parameter to the exec() and pop()
methods.

I'm currently using QAction objects to define my shortcut keys and
build a menu that is used both as a context menu and as a pull-down
menu.  This has some obvious advantages in terms of simplifying and
normalizing the widget implementation.  The problem is that it is not
correct to display shortcuts on context menus -- certainly not on Mac.
 So I'm working out some way to  construct the context menu
differently, using one-off clones of the widget's QActions that do not
include the shortcut in the context menu case.  But it is a messy,
sub-optimal solution.

Am I missing something?



More information about the Qt-interest-old mailing list