[Qt-qml] Components, loaders, and focus scope
Girish Ramakrishnan
girish at forwardbias.in
Thu Dec 16 17:20:55 CET 2010
Hi Mathias,
I think it's the right thing to do. The only way to switch focus
between FocusScope's is by using forceActiveFocus(). Note that each
Loader is a FocusScope and you want to switch the active focus between
these.
Girish
On Thu, Dec 16, 2010 at 9:14 PM, <mathias.malmqvist at nokia.com> wrote:
>
> Thanks Girish, that helped!
> Is this the right thing to do, or a workaround? Will it break some things?
>
> Posted http://bugreports.qt.nokia.com/browse/QTBUG-16157
>
>
> Cheers
> Mathias
>
> ________________________________________
> From: ext Girish Ramakrishnan [girish at forwardbias.in]
> Sent: Thursday, December 16, 2010 2:43 PM
> To: Malmqvist Mathias (Nokia-MS/London)
> Cc: qt-qml at qt.nokia.com
> Subject: Re: [Qt-qml] Components, loaders, and focus scope
>
> Hi Mathias,
>
> On Thu, Dec 16, 2010 at 7:43 PM, <mathias.malmqvist at nokia.com> wrote:
> 8< snipped
>
>> TextInput {
>> width: 200
>> height: 20
>> Rectangle { color: parent.activeFocus ? "green" : "red"; anchors.fill: parent; z: -1 }
>>
>> activeFocusOnPress: false
>> MouseArea { anchors.fill: parent; onClicked: parent.focus = true }
>> }
>
> Try parent.forceActiveFocus() instead above.
>
> Girish
>
More information about the Qt-qml
mailing list