I am trying to assemble an animation in which I get an indication of speed (rather than duration) and which loop forever. I came up with two broken examples:
FirstTry.qml
import Qt 4.7
Rectangle {
width: 100; height: 100
Text {
text: "hello"
NumberAnimation on x {
to: 50;
loops: Animation.Infinite;
duration: 50 * Math.abs(to - from)
}
}
}
I get the following warning at runtime, and helloswitches to the nuts on the screen (fairly fair).
QDeclarativeExpression: Expression "(function() { return 50 * Math.abs(to - from) })" depends on non-NOTIFYable properties:
QDeclarativeNumberAnimation::to
QDeclarativeNumberAnimation::from
SecondTry.qml
import Qt 4.7
Rectangle {
width: 100; height: 100
Text {
text: "hello"
SmoothedAnimation on x {
to: 50;
loops: Animation.Infinite;
velocity: 50
}
}
}
It is more likely mistery - SmoothedAnimationsimply refuses a cycle! Animation is performed once, and then it.
So, I have the following questions:
Is there a legal way to indicate speed in the first example? I understand what is SmoothedAnimationderived from NumberAnimation, so perhaps this is possible in QML, and not just in C ++.
SmoothedAnimation? - ?
?