[Qt-components] Key navigation

Zsombor Egri zsombor.egri at canonical.com
Tue Jan 8 06:18:09 CET 2013


Back in the "old times", when Borland's OWL was alive, each control
handling keys was having a tabOrder property, a numeric value defining
its index within the TAB-handling list. The list was defined on the Form
level, so even if you had groups or other layouting elements, the
content of those was also included in this ordering. How about having a
similar logic into the components too?

Zsombor

On 01/07/2013 10:02 PM, Alan Alpert wrote:
> On Mon, Jan 7, 2013 at 11:49 AM, Alberto Mardegan
> <mardy at users.sourceforge.net> wrote:
>> 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.
> But presumably the root object in a Button component is a FocusScope,
> whereas that of a Label would not be. So that's how you automatically
> know which ones are focusable and which aren't, by the type of the
> root object.
>
> http://qt-project.org/doc/qt-5.0/qtquick/qtquick-input-focus.html
> makes it look like any focusable component without a FocusScope is
> going to be acting funny anyways.
>
> --
> Alan Alpert
> _______________________________________________
> Qt-components mailing list
> Qt-components at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-components




More information about the Qt-components mailing list