PDA

View Full Version : Rerouting messages for keyboard shortcut selection dialog.



andy.fillebrown
15th June 2009, 19:20
Hello again,

I would like to fix a keyboard-shortcut dialog that doesn't allow keys like Ctrl+Tab or Ctrl+Space to be selected by the user due to the dialog handling them and discarding the key combination before the message gets to the code that sets the shortcut. For example, if I open the dialog and goto the Indent/Unindent setting it won't allow me to set those two commands to Tab and Shift+Tab, but instead it just cycles through the dialog's buttons like the tab-key usually does in a dialog box. I'm sure others have encountered this and I'm wondering what's the easiest/best way to reroute the key-presses to the shortcut selection instead of the dialog.

Regards,
-andy.f

wysota
15th June 2009, 19:55
Reimplement the QObject::event() method for appropriate widgets or apply an event filter that will prevent the default implementation of event() from handling the event.