[PyQt] QActions on a toolbar and mnemonics

alanm me at alandmoore.com
Thu Jul 1 17:24:12 BST 2010


I have a QToolBar created from a QMainWindow's addToolBar() method.

I have created a number of QActions with mnemonics in the name and shortcut 
keys assigned by using the QKeySequence.mnemonic() method to extract the 
mnemonic from the QAction's name.

The problem is that when I add the QActions to the toolbar (with no icons, so 
that they display text), the mnemonic is not being underlined on the button.

I have searched for this and someone mentioned this is a feature of the 
Desktop / Windowing environment, but the problem shows up on multiple 
environments:
 - my kiosks, running matchbox window manager
 - my desktop, running KDE 4.4.5
 - my virtual machine, running windows XP (even when pressing alt, they don't 
get underlined)

Is there a way to force mnemonics to underline all the time? 


More information about the PyQt mailing list