PDA

View Full Version : Understanding KeyNavigation.BeforeItem - qtQuick



TheIndependentAquarius
30th September 2013, 08:42
From: http://qt-project.org/doc/qt-4.8/qml-keynavigation.html#priority-prop


KeyNavigation.BeforeItem - process the key events before normal item key processing. If the event is used for key navigation, it will be accepted and will not be passed on to the item.

Please make me understand the above quote with an example.

anda_skoa
30th September 2013, 09:12
Assume you have a text input element. It normal reaction to e.g. the leftr/right cursor keys is to to move the text input cursor left/right.

If you use KeyNavigation.BeforeItem together with one of the left/right keys, the key navigation will react to that key press/release and the text input field will not know anything about it.

Like when you are editing a cell in a spreadsheet, then almost all input goes to the cell, but cursor keys change cell.

Cheers,
_