I have an item with value param. I wonder how to catch its change event?
Say having a RectComp.qml:
Item{
property alias currentX: rect.x
Rectangle {
id: rect
x: 617
y: 450
}
}
handle its currentX change from application that creates its instance say how to
Rectangle {
id: host
x: 617
y: 450
RectComp{ id: MyRC}
OnMyRCcurrentXChange(int){log("hello!")}
}
As per Qt documentation “Adding a property to an item automatically adds a value changed signal handler to the item.”
So your code will changes to following
Or you can use Connection element