aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickstates/data/parentChangeInvolvingBindings.qml
blob: d3873883cd298266cbc6671645266929025af6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import QtQuick

Item {
    id: root
    property alias childWidth: firstChild.width
    property alias childX: firstChild.x
    property alias childRotation: firstChild.rotation
    property double myrotation: 100
    property double myrotation2: 200
    height: 400
    y: 40

    Item {
        id: firstChild
        height: parent.height
        width: height
        y: parent.y
        x: y
        rotation: root.myrotation

        Item {
            id: inner
            anchors.fill: parent
        }
    }

    states: State {
        name: "reparented"
        ParentChange {
            target: firstChild
            parent: otherChild
            width: 2 *height
            x: 2 * y
            rotation: root.myrotation2
        }
    }

    Item {
        height: parent.height
        y: parent.y
        id: otherChild
    }
}