[Qt-components] Key navigation

Alberto Mardegan mardy at users.sourceforge.net
Mon Jan 7 20:49:08 CET 2013


On 01/07/2013 08:41 PM, Alan Alpert wrote:
> The current approach basically has that with FocusScopes. If you have
> a component which can do something with Keyboard focus, it has a
> FocusScope around it.

Yes.

> Now FocusScopes aren't that great, so maybe there's a better way, but
> given the current keyboard handling in QML where would you add
> CanFocus where there isn't already a FocusScope (or a root level Item
> that could easily be turned into a FocusScope)?

When I talk about the CanFocus property, I'm actually thinking about 
child items, not about the FocusScope itself.
Now, suppose that a FocusScope has 10 child items, 5 of which are 
buttons (therefore, focusable) and 5 are labels (unfocusable): if you 
want to automatically build a focus chain, you need to know which 
children are focusable and which are not; and that's where a CanFocus 
property comes handy.

Ciao,
   Alberto




More information about the Qt-components mailing list