Qt World Summit: Submit your Presentation

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.

    @ import QtQuick 1.0

    Rectangle {
    property alias text: textItem.text

     width: 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.0

    Column {
    spacing: 10

     Button { id: button1; text: "Apple" }
     Button { text: "Orange" }
     Button { text: "Pear" }
     Button { text: "Grape" }


    loops: Animation.Infinite
    running: true

    PropertyAction { 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.

  • oh ... it worked right away..
    You are right. It changed so quickly that I couldn't see it...


Log in to reply