AnchorChanges QML Type
The AnchorChanges element allows you to change the anchors of an item in a state. More...
Import Statement: | import . |
Properties
- anchors
- anchors.left : AnchorLine
- anchors.right : AnchorLine
- anchors.horizontalCenter : AnchorLine
- anchors.top : AnchorLine
- anchors.bottom : AnchorLine
- anchors.verticalCenter : AnchorLine
- anchors.baseline : AnchorLine
- target : Item
Detailed Description
The AnchorChanges element is used to modify the anchors of an item in a State.
AnchorChanges cannot be used to modify the margins on an item. For this, use PropertyChanges intead.
In the following example we change the top and bottom anchors of an item using AnchorChanges, and the top and bottom anchor margins using PropertyChanges:
[Missing image anchorchanges.png]
AnchorChanges can be animated using AnchorAnimation.
//animate our anchor changes Transition { AnchorAnimation {} }
Margin animations can be animated using NumberAnimation.
For more information on anchors see Anchor Layouts.
Property Documentation
These properties change the respective anchors of the item.
To reset an anchor you can assign undefined:
AnchorChanges { target: myItem anchors.left: undefined //remove myItem's left anchor anchors.right: otherItem.right }