I am having some problems with the automatic keyboard shortcuts. I am using a Mac, where they seem to be disabled by default, so I call qt_set_sequence_auto_mnemonic to enable them. Consider the following code:

Qt Code:
  1. #include <QtGui>
  2.  
  3. #ifdef Q_WS_MAC
  4. extern void qt_set_sequence_auto_mnemonic(bool b);
  5. #endif
  6.  
  7. int main(int argv, char **args)
  8. {
  9. #ifdef Q_WS_MAC
  10. qt_set_sequence_auto_mnemonic(true);
  11. #endif
  12.  
  13. QApplication app(argv, args);
  14. QPushButton button("&test");
  15. QObject::connect(&button, SIGNAL(clicked()), qApp, SLOT(quit()));
  16. button.show();
  17. return app.exec();
  18. }
To copy to clipboard, switch view to plain text mode 

This opens a window with a single push button, which is activated by the keyboard shortcut Alt+t, which works fine. However, when I change the button label to "t&est", then activating the button by Alt+e does not work. Changing it to "te&st" allows me to activate the button using Alt+s.

It seems like there is something special about the keyboard combination Alt+e. After a little bit of trial and error, it seems like the keys that are used by OS X to enter accented characters (e, u, i, n) cannot be used a keyboard shortcuts.

Is this interpretation correct? Is there any workaround that would allow me to use consistent keyboard shortcuts across several platforms?

Thanks,

Lutz