Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Documents - Sequential Animation with different files and properties
Forum Updated to NodeBB v4.3 + New Features

QML Documents - Sequential Animation with different files and properties

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qtd1d1
    wrote on last edited by
    #1

    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.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" }
    

    }

    SequentialAnimation{
    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?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ludde
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtd1d1
        wrote on last edited by
        #3

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

        thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved