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. PropertyActions in SequentialAnimations issue
Qt 6.11 is out! See what's new in the release blog

PropertyActions in SequentialAnimations issue

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 584 Views
  • 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.
  • E Offline
    E Offline
    Eventh
    wrote on last edited by
    #1

    Hello everyone! I'm having an issue using PropertyActions in a SequentialAnimation that I can't quite figure out. I was hoping someone here might have some insight or could tell me what I am doing wrong.

    So I'm setting the "text" property of a Text qml component inside of the animation via a PropertyAction. The value that it is being set to is from a property that is declared above as you can see, and set with a binding where my component is used. When the value is changed, I handle it on the onChanged handler of the property. I see the one debug statement inside of the handler where it is changed, and it is changed to the correct value. I however do not see the debug statement in the textChanged handler of the Text component. This leads me to believe that when I start the animation in the handler, for some reason the PropertyAction doesn't set it to the new value. I was wondering if anyone here could explain why or how I can fix this issue. Thanks ahead of time!

    import QtQuick 2.12
    
    Text
    {
       id: someText
    
       property string animatedText: ""
    
       onAnimatedTextChanged:
       {
          console.log( "text changed: " + animatedText )
    
          if ( someText.text === "" )
             someText.text = animatedText;
          else
             textChangeAnimation.start()
       }
    
       onTextChanged: console.log( text )
    
       SequentialAnimation
       {
          id: textChangeAnimation
    
          NumberAnimation
          {
             target: someText
             property: "opacity"
             from: 1
             to: 0
             duration: 500
          }
    
          PropertyAction
          {
             target: someText
             property: "text"
             value: someText.animatedText
          }
    
          NumberAnimation
          {
             target: someText
             property: "opacity"
             from: 0
             to: 1
             duration: 500
          }
       }
    }
    
    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