Your value hh is correclty displayed on console in fact, but only one time, when mouse is pressed. So at the first time it will print 0 (as the animation has not change the value and is asynchron), and 50 all the other times.
If you want to print all the intermediate values of hh
, just handle change signal on this property :
import QtQuick 1.0
Rectangle
{
id: rect
width: 100; height: 100
color: "red"
property int hh:0
Text
{
text: hh
}
MouseArea
{
anchors.fill: parent
onPressed:
{
animation.start()
console.log(hh)
}
NumberAnimation
{
id: animation
target: rect
property: "hh"
to: 50;
duration: 1000
}
}
onHhChanged: console.log(hh)
}
For completeness, note the camelize syntax convention used for defining automatically a signal handle on a custom property.