To answer my own question, if you reimplement the "bool event( QEvent* event )" handler, you can catch QEvent::ShortcutOverride events that represent shortcut sequences that you want to interpret differently in the widget.
Using this solved the problem:
Now the widget accepts "x" as text input when it has keyboard focus, and when it doesn't the QAction is invoked instead.Qt Code:
{ switch( event->type() ) { event->accept(); return true; break; default: // Important to avoid compiler warnings about unhandled QEvent types. break; } }To copy to clipboard, switch view to plain text mode
More information here: http://wiki.qt.io/ShortcutOverride
Bookmarks