[Qt-qml] Popups and Keyboard Focus
Vinayakam Murugan
mvinayakam at gmail.com
Fri Feb 11 03:51:40 CET 2011
This is resolved now.
I have changed the popup code to
FocusScope{
anchors.fill:parent
visible:false
property variant caller
x:300
y:100
Image{
source:"popup.png"
BaseButton {
id:buttonOk
buttonText:"Ok"
KeyNavigation.right:buttonCancel
focus:true
x:0
onButtonClicked:{popup.visible=false;caller.forceActiveFocus()}
}
BaseButton {
id: buttonCancel
x:400
KeyNavigation.left:buttonOk;
buttonText:"Cancel"
}
}
}
So whenever popup is invoked, I set the caller to the item or group
Warm Regards
~~~~~~~~~~~~~~~
Vinayak
http://www.flickr.com/photos/rightplacerighttime/
On Thu, Feb 10, 2011 at 6:03 PM, Vinayakam Murugan <mvinayakam at gmail.com>wrote:
> Hello
>
>
> I have a popup QML which could be invoked from any screen
>
> Popup.QML
>
> FocusScope{
>
> anchors.fill:parent
>
> visible:false
>
> x:300
>
> y:100
>
> Image{
>
> source:"popup.png"
>
> BaseButton {
>
> id:buttonOk
>
> buttonText:"Ok"
>
> KeyNavigation.right:buttonCancel
>
> x:0
>
> onButtonClicked:{popup.visible=false;}
>
> }
>
> BaseButton {
>
> id: buttonCancel
>
> x:400
>
> focus:true
>
> KeyNavigation.left:buttonOk;
>
> buttonText:"Cancel"
>
> }
>
> }
>
> }
>
>
>
> The problem I am facing is that once I click on Ok here and hide the popup,
> the keyboard focus is lost. Is there a way I can have the focus on the
> screen which invoked it.
>
>
> Warm Regards
> ~~~~~~~~~~~~~~~
> Vinayak
>
> http://www.flickr.com/photos/rightplacerighttime/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110210/a75cf964/attachment-0001.html
More information about the Qt-qml
mailing list