Qt Animation



  • Hello,

    I am pretty new to QT. I am trying to construct an animation sequence, where the animations start at different times and have different durations. I looked at (http://doc.qt.digia.com/4.7/animation-overview.html), and in QAnimationGroup, QSequentialAnimationGroup, or QParallelAnimationGroup I did not see a way to start animations at a certain time. Here is an example:

    Animation 1 - duration 1000ms, Start Time: 0
    Animation 2 - duration 500ms, Start Time, 1000
    Animation 3 - duration 10000ms, StartTime, 200ms

    How can I nest these into a timeline and set it to start and it will play all of them?

    Hopefully this all makes sense.

    Thanks


  • Moderators

    You could use a QParallelAnimationGroup which holds 3 QSequentialAnimationGroup animations, each of which holds a QPauseAnimation (if needed) followed by your Animation[1,2,3].

    That is to say:
    @

    QParallelAnimationGroup
    Animation1 (1000ms, starts immediately)
    QSequentialAnimationGroup
    QPauseAnimation (pauses 1000 ms)
    Animation2 (runs 500ms)
    QSequentialAnimationGroup
    QPauseAnimation (pauses 200ms)
    Animation3 (runs 10000ms)
    @



  • Thank you. I didn't think of that. This is perfect.


  • Moderators

    Glad it's what you need! Be sure and edit your original post and add [Solved] to the title. Thanks!


Log in to reply
 

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