Home · All Classes · All Functions · Overviews

QML ParentAction Element Reference

[Inherits Animation]

The ParentAction element allows parent changes during animation. More...

Properties

Detailed Description

ParentAction provides a way to specify at what point in a Transition a ParentChange should occur.

 State {
     ParentChange {
         target: myItem
         parent: newParent
     }
 }
 Transition {
     SequentialAnimation {
         PropertyAnimation { ... }
         ParentAction {}   //reparent myItem now
         PropertyAnimation { ... }
     }
 }

It also provides a way to explicitly reparent an item during an animation.

 SequentialAnimation {
     ParentAction { target: myItem; parent: newParent }
     PropertyAnimation {}
 }

The ParentAction is immediate - it is not animated in any way.


Property Documentation

parent : Item

The item to reparent to (i.e. the new parent).


target : Item

This property holds a target item to reparent.

In the following example, myItem will be reparented by the ParentAction, while myOtherItem will not.

 State {
     ParentChange {
         target: myItem
         parent: newParent
     }
     ParentChange {
         target: myOtherItem
         parent: otherNewParent
     }
 }
 Transition {
     SequentialAnimation {
         PropertyAnimation { ... }
         ParentAction { target: myItem }
         PropertyAnimation { ... }
     }
 }


Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.7.0