[Qt-qml] Dynamically changing Keynaviagtion

amit shah techlist.amit at gmail.com
Thu Feb 10 03:08:54 CET 2011


Hi
I have 3 components

       GroupA{
           id: groupA;
           focus: true;
           KeyNavigation.right:groupB

       }

       GroupB{
           id: groupB
            KeyNavigation.left:groupA
            KeyNavigation.right:groupC


       }

       GroupC{
           id: groupC
            KeyNavigation.left:groupB

       }

The KeyNavigation is configured as

GroupA <--> GroupB <--> GroupC

and the behavior is as desired.

Is there a way if GroupB is hidden dynamically via code (visible=false)  I
should be still able to navigate between groupA & groupB.
That is
GroupA <--> GroupC

I tried reconfiguring the KeyNavigation for on groupA & groupB on GroupB's
 onVisibleChanged but was unable to do so.

onVisibleChanged: {
                if (groupB.visible){
                    groupB.KeyNavigation.left=(groupA);
                    groupB.KeyNavigation.right=(groupC);

                }
                else{
                   groupA.KeyNavigation.right=groupC;
                    groupC.KeyNavigation.left=groupA;
                }
            }


thanks
--amit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110209/8744ae1e/attachment.html 


More information about the Qt-qml mailing list