tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 10:37:55 +0300 (2010-08-18)
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
permissions -rw-r--r--
Revision: 201031 Kit: 201033
import Qt 4.7

Rectangle {
    width: 200; height: 200
    Rectangle {
        id: myRect
        objectName: "MyRect"
        color: "green";
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
    }
    Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
    Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
    states: State {
        name: "reanchored"
        AnchorChanges {
            target: myRect;
            anchors.horizontalCenter: bottomGuideline.horizontalCenter
            anchors.verticalCenter: leftGuideline.verticalCenter
        }
    }
}