qt6-bb10/qtdeclarative/tests/auto/qml/qqmlbinding/data/restoreBindingWithLoop.qml

24 lines
433 B
QML

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
}
}
}