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, <[email protected]> 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 [[email protected]] > Sent: Thursday, December 16, 2010 2:43 PM > To: Malmqvist Mathias (Nokia-MS/London) > Cc: [email protected] > Subject: Re: [Qt-qml] Components, loaders, and focus scope > > Hi Mathias, > > On Thu, Dec 16, 2010 at 7:43 PM, <[email protected]> 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 > _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
