[Development] QtQuickControls Action keyboard shortcuts and keyPressEvent (TextField)

Frederik Gladhorn frederik.gladhorn at digia.com
Mon Aug 12 11:02:14 CEST 2013

Mandag 12. august 2013 10.54.50 skrev Ola Røer Thorsen:
> Hello,
> I'm writing a specialized playback application, based on Qt 5.1. The GUI
> is based on QtQuick, and uses the QuickControls. The root window is a
> QQuickWindow, and the base item in the Quick scene is an ApplicationWindow.
> I use Action items with keyboard shortcuts defined. This works, but it
> seems like an Action gets the keyboard event before the Quick items
> receive them. This means that if I have a TextField with active focus,
> it will not receive any keyboard key press events if such a key is
> already defined in an Action.
> I tried the same setup in a QWidget-based application. There it is no
> problem - I add a QAction to QApplication with a shortcut - it is
> triggered as long as it's not accepted by a text field first.
> Example: spacebar is shortcut for a play/pause toggle action. This means
> space cannot be used in a TextField with active focus. It will toggle
> play/pause while you type, and no space appears in the text. Please
> don't tell me I will have to add Ctrl+ to all the shortcuts...
> Is this intended behavior in QtQuick? Shouldn't the item with active
> focus get the key press BEFORE any Action?

Yes, please file an issue on bugreports.qt-project.org .
The text control should have a chance to do a "shortcut override".


> Thanks,
> Ola
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
Best regards,
Frederik Gladhorn
Senior Software Engineer - Digia, Qt
Visit us on: http://qt.digia.com

More information about the Development mailing list