Issue with Animations



  • Hi,

    1. I don't understand the Behavior animation:

    @Behavior on width {
    NumberAnimation { duration: 1000 }
    }@

    Why this will be done so and not only the NumberAnimation:

    @NumberAnimation on width{ duration: 1000 }@ ?

    @ states: State {
    name: "rotated"
    PropertyChanges { target: rect; rotation: 180 }
    }

         transitions: Transition {
             RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
         }@
    

    Why here transitions is the animation to the PropertyChanges?
    "Qt Doc":http://qt-project.org/doc/qt-4.8/qml-rotationanimation.html



  • Probably you didn't explain yourself completely, because the questions seems a bit silly.

    1. It's just syntax!
    2. because transitions animates the changes when passing from a state to another, and in the "rotated" state there is a PropertyChanges statements. That's it, again, it's just syntax.

    So, what do you really want to know ?



  • I request you to read the Qt Assistant for Animation. There are different ways in which animations can be triggered. Behavior and NumberAnimation are different types. They need to triggered separately. Behavior animation will trigger automatically whenever parameter(width) changes. Please read more about animations from Assistant. This will help you lot.



  • Thank you very much, that was my problem. I thought there are the same, but I ignored the trigger.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.