QML files are descriptions of user interfaces and and actions that execute when certain events or signals are received by the elements inside them. They aren't "programs", they don't "execute". They get loaded into memory, parsed, and sit there, waiting for one of the events or signals to occur, and then they react to it.
Animations run when their "running" property is set to "true" or their "start()" method is invoked. One way to cause a series of animations to run in sequence is to connect animation 2 with the "onStopped" slot of animation 1, something like this:
// One.qml:
Animation {
id: one
onStopped: two.running = true
}
// Two.qml
Animation {
id: two
onStopped: three.running = true
}
// etc.
// One.qml:
Animation {
id: one
onStopped: two.running = true
}
// Two.qml
Animation {
id: two
onStopped: three.running = true
}
// etc.
To copy to clipboard, switch view to plain text mode
You could also use the Animation::start() method. Setting the "running" property to "true" is equivalent to calling start().
The code above isn't valid QML - you can't use the Animation object stand-alone; you have to use one of the derived types (NumberAnimation, PropertyAnimation, etc.)
Bookmarks