Important: Please read the Qt Code of Conduct -

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":

  • 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 ?

  • Qt Champions 2017

    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