Fix nested parallel/sequential animations combined with animators.
authorGunnar Sletta <gunnar.sletta@jollamobile.com>
Wed, 16 Apr 2014 09:11:41 +0000 (11:11 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 24 Apr 2014 11:46:52 +0000 (13:46 +0200)
commit9bd69842ed8a03381914733a778fbda0d3d56630
tree2b6aa7ea6420109fc6fa82a4cae84cb985b41eec
parentd71fb383337b45c31653e54345bff58cf419af19
Fix nested parallel/sequential animations combined with animators.

The logic for looping uncontrolled animations in
QAbstractAnimationJob::setCurrentTime assumes that uncontrolled
animations return duration == -1, always. The logic falls apart when a
duration gets set while the animation is running. To rememdy this,
update QParallelAnimation's duration to return -1 for this case. This
is also how the sequential group's duration is implemented so these
are now using the same pattern.

Update the logic in parallel animations to flush previous loops in
updateAnimationsTime to handle the case where duration is -1. This
solves the case where we have for instance:

ParallelAnimation
  Sequential
    YAnimator: duration: 1000
    ScriptAction ...
  Sequential
    Pause duration: 5000 <--- longer than yanimator
    ScriptAction ...

Task-number: QTBUG-37246
Change-Id: I7a1ea547b2f3090feb8b1e87aa7ca746151736fa
Reviewed-by: Michael Brasser <michael.brasser@live.com>
src/qml/animations/qparallelanimationgroupjob.cpp