aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativebinding/data/restoreBindingWithLoop.qml
blob: ee07104817d19151f726e8c46767b11e3f705a6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import QtQuick 2.0

Rectangle {
    width: 400
    height: 400

    property bool activateBinding: false

    Rectangle {
        id: myItem
        objectName:  "myItem"
        width: 100
        height: 100
        color: "green"
        x: myItem.y + 100
        onXChanged: { if (x == 188) y = 90; }   //create binding loop

        Binding on x {
            when: activateBinding
            value: myItem.y
        }
    }
}