QML Documents - Sequential Animation with different files and properties
-
Hi,
is it possible to run a PropertyAction within a SequentialAnimation on property alias items?
For example, if you have 2 qml files.- Button.qml
- application.qml
I took the example from the "qml documents article":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedocuments.html to describe my problem.
Button.qml
@ import QtQuick 1.0Rectangle {
property alias text: textItem.textwidth: 100; height: 30 border.width: 1 radius: 5 smooth: true gradient: Gradient { GradientStop { position: 0.0; color: "darkGray" } GradientStop { position: 0.5; color: "black" } GradientStop { position: 1.0; color: "darkGray" } } Text { id: textItem anchors.centerIn: parent font.pointSize: 20 color: "white" }
}@
The following qml file is loading Button and trying to change its property in a SequentialAnimation
application.qml (modified)
@ import QtQuick 1.0Column {
spacing: 10Button { id: button1; text: "Apple" } Button { text: "Orange" } Button { text: "Pear" } Button { text: "Grape" }
}
SequentialAnimation{
loops: Animation.Infinite
running: truePropertyAction { target: button1; property: "text"; value: "Orange"}
...
PropertyAction { target: button1; property: "text"; value: "Apple"}
}
@Unfortunately this approach doesn't work.
Any Ideas how to solve that issue? -
Cannot see why that would not work.
Of course, it may depend on what you do in "...".
And for you to be able to ever see "Apple" you have to also do something before the first or after the second PropertyAction as well, otherwise those two will just immediately follow each other.