OpenCoverage

qparallelanimationgroupjob.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/animations/qparallelanimationgroupjob.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "private/qparallelanimationgroupjob_p.h"-
41#include "private/qanimationjobutil_p.h"-
42-
43QT_BEGIN_NAMESPACE-
44-
45QParallelAnimationGroupJob::QParallelAnimationGroupJob()-
46 : QAnimationGroupJob()-
47 , m_previousLoop(0)-
48 , m_previousCurrentTime(0)-
49{-
50}
executed 20972 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
20972
51-
52QParallelAnimationGroupJob::~QParallelAnimationGroupJob()-
53{-
54}-
55-
56int QParallelAnimationGroupJob::duration() const-
57{-
58 int ret = 0;-
59-
60 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 733753 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 401890 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
401890-733753
61 int currentDuration = animation->totalDuration();-
62 if (currentDuration == -1)
currentDuration == -1Description
TRUEevaluated 310 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEevaluated 733443 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
310-733443
63 return -1; // Undetermined length
executed 310 times by 5 tests: return -1;
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
310
64 ret = qMax(ret, currentDuration);-
65 }
executed 733443 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
733443
66-
67 return ret;
executed 401890 times by 12 tests: return ret;
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
401890
68}-
69-
70void QParallelAnimationGroupJob::updateCurrentTime(int /*currentTime*/)-
71{-
72 if (!firstChild())
!firstChild()Description
TRUEnever evaluated
FALSEevaluated 78694 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
0-78694
73 return;
never executed: return;
0
74-
75 if (m_currentLoop > m_previousLoop) {
m_currentLoop > m_previousLoopDescription
TRUEevaluated 98 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
FALSEevaluated 78596 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
98-78596
76 // simulate completion of the loop-
77 int dura = duration();-
78 if (dura < 0) {
dura < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
2-96
79 // For an uncontrolled parallel group, we need to simulate the end of running animations.-
80 // As uncontrolled animation finish time is already reset for this next loop, we pick the-
81 // longest of the known stop times.-
82 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
2-6
83 int currentDuration = animation->totalDuration();-
84 if (currentDuration >= 0)
currentDuration >= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
2-4
85 dura = qMax(dura, currentDuration);
executed 2 times by 1 test: dura = qMax(dura, currentDuration);
Executed by:
  • tst_qparallelanimationgroupjob
2
86 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qparallelanimationgroupjob
6
87 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qparallelanimationgroupjob
2
88 if (dura > 0) {
dura > 0Description
TRUEevaluated 98 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
FALSEnever evaluated
0-98
89 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 296 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
FALSEevaluated 98 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
98-296
90 if (!animation->isStopped())
!animation->isStopped()Description
TRUEevaluated 112 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
FALSEevaluated 184 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
112-184
91 RETURN_IF_DELETED(animation->setCurrentTime(dura)); // will stop
never executed: return;
never executed: *prevWasDeleted = true;
executed 112 times by 2 tests: end of block
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
wasDeletedDescription
TRUEnever evaluated
FALSEevaluated 112 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
prevWasDeletedDescription
TRUEnever evaluated
FALSEnever evaluated
0-112
92 }
executed 296 times by 2 tests: end of block
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
296
93 }
executed 98 times by 2 tests: end of block
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
98
94 } else if (m_currentLoop < m_previousLoop) {
executed 98 times by 2 tests: end of block
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
m_currentLoop < m_previousLoopDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 78552 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
44-78552
95 // simulate completion of the loop seeking backwards-
96 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 132 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
44-132
97 //we need to make sure the animation is in the right state-
98 //and then rewind it-
99 applyGroupState(animation);-
100 RETURN_IF_DELETED(animation->setCurrentTime(0));
never executed: return;
never executed: *prevWasDeleted = true;
wasDeletedDescription
TRUEnever evaluated
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
prevWasDeletedDescription
TRUEnever evaluated
FALSEnever evaluated
0-132
101 animation->stop();-
102 }
executed 132 times by 1 test: end of block
Executed by:
  • tst_qparallelanimationgroupjob
132
103 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_qparallelanimationgroupjob
44
104-
105 // finally move into the actual time of the current loop-
106 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 114003 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 78686 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
78686-114003
107 const int dura = animation->totalDuration();-
108 //if the loopcount is bigger we should always start all animations-
109 if (m_currentLoop > m_previousLoop
m_currentLoop > m_previousLoopDescription
TRUEevaluated 296 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
FALSEevaluated 113707 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
296-113707
110 //if we're at the end of the animation, we need to start it if it wasn't already started in this loop-
111 //this happens in Backward direction where not all animations are started at the same time-
112 || shouldAnimationStart(animation, m_previousCurrentTime > dura /*startIfAtEnd*/)) {
shouldAnimatio...tTime > dura )Description
TRUEevaluated 84633 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 29074 times by 9 tests
Evaluated by:
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_scenegraph
29074-84633
113 applyGroupState(animation);-
114 }
executed 84929 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
84929
115-
116 if (animation->state() == state()) {
animation->state() == state()Description
TRUEevaluated 113615 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 388 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
388-113615
117 RETURN_IF_DELETED(animation->setCurrentTime(m_currentTime));
executed 8 times by 1 test: return;
Executed by:
  • tst_qquickanimations
executed 8 times by 1 test: *prevWasDeleted = true;
Executed by:
  • tst_qquickanimations
wasDeletedDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 113607 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
prevWasDeletedDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
0-113607
118 if (dura > 0 && m_currentTime > dura)
dura > 0Description
TRUEevaluated 113101 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 506 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
m_currentTime > duraDescription
TRUEevaluated 72 times by 3 tests
Evaluated by:
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
FALSEevaluated 113029 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
72-113101
119 animation->stop();
executed 72 times by 3 tests: animation->stop();
Executed by:
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
72
120 }
executed 113607 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
113607
121 }
executed 113995 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
113995
122 m_previousLoop = m_currentLoop;-
123 m_previousCurrentTime = m_currentTime;-
124}
executed 78686 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
78686
125-
126void QParallelAnimationGroupJob::updateState(QAbstractAnimationJob::State newState,-
127 QAbstractAnimationJob::State oldState)-
128{-
129 QAnimationGroupJob::updateState(newState, oldState);-
130-
131 switch (newState) {-
132 case Stopped:
executed 19338 times by 10 tests: case Stopped:
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_scenegraph
19338
133 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
animationDescription
TRUEevaluated 29400 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_scenegraph
FALSEevaluated 19338 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_scenegraph
19338-29400
134 animation->stop();
executed 29400 times by 10 tests: animation->stop();
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_scenegraph
29400
135 break;
executed 19338 times by 10 tests: break;
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_scenegraph
19338
136 case Paused:
executed 48 times by 3 tests: case Paused:
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
48
137 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
animationDescription
TRUEevaluated 212 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
FALSEevaluated 48 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
48-212
138 if (animation->isRunning())
animation->isRunning()Description
TRUEevaluated 210 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
2-210
139 animation->pause();
executed 210 times by 3 tests: animation->pause();
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
210
140 break;
executed 48 times by 3 tests: break;
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
48
141 case Running:
executed 20959 times by 12 tests: case Running:
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
20959
142 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 31532 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 20959 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
20959-31532
143 if (oldState == Stopped) {
oldState == StoppedDescription
TRUEevaluated 31324 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 208 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimationcontroller
  • tst_qsequentialanimationgroupjob
208-31324
144 animation->stop();-
145 m_previousLoop = m_direction == Forward ? 0 : m_loopCount - 1;
m_direction == ForwardDescription
TRUEevaluated 31206 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 118 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
118-31206
146 }
executed 31324 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
31324
147 resetUncontrolledAnimationFinishTime(animation);-
148 animation->setDirection(m_direction);-
149 if (shouldAnimationStart(animation, oldState == Stopped))
shouldAnimatio...te == Stopped)Description
TRUEevaluated 31424 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
108-31424
150 animation->start();
executed 31424 times by 12 tests: animation->start();
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
31424
151 }
executed 31532 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
31532
152 break;
executed 20959 times by 12 tests: break;
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
20959
153 }-
154}
executed 40345 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
40345
155-
156bool QParallelAnimationGroupJob::shouldAnimationStart(QAbstractAnimationJob *animation, bool startIfAtEnd) const-
157{-
158 const int dura = animation->totalDuration();-
159-
160 if (dura == -1)
dura == -1Description
TRUEevaluated 354 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEevaluated 144885 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
354-144885
161 return uncontrolledAnimationFinishTime(animation) == -1;
executed 354 times by 5 tests: return uncontrolledAnimationFinishTime(animation) == -1;
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
354
162-
163 if (startIfAtEnd)
startIfAtEndDescription
TRUEevaluated 31638 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 113247 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
31638-113247
164 return m_currentTime <= dura;
executed 31638 times by 11 tests: return m_currentTime <= dura;
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
31638
165 if (m_direction == Forward)
m_direction == ForwardDescription
TRUEevaluated 113087 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
FALSEevaluated 160 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
160-113087
166 return m_currentTime < dura;
executed 113087 times by 12 tests: return m_currentTime < dura;
Executed by:
  • tst_examples
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
113087
167 else //direction == Backward-
168 return m_currentTime && m_currentTime <= dura;
executed 160 times by 2 tests: return m_currentTime && m_currentTime <= dura;
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
160
169}-
170-
171void QParallelAnimationGroupJob::applyGroupState(QAbstractAnimationJob *animation)-
172{-
173 switch (m_state)-
174 {-
175 case Running:
executed 84787 times by 12 tests: case Running:
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
84787
176 animation->start();-
177 break;
executed 84787 times by 12 tests: break;
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qpauseanimationjob
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickflipable
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickspringanimation
  • tst_qsequentialanimationgroupjob
  • tst_scenegraph
84787
178 case Paused:
never executed: case Paused:
0
179 animation->pause();-
180 break;
never executed: break;
0
181 case Stopped:
executed 274 times by 2 tests: case Stopped:
Executed by:
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
274
182 default:
never executed: default:
0
183 break;
executed 274 times by 2 tests: break;
Executed by:
  • tst_qanimationgroupjob
  • tst_qparallelanimationgroupjob
274
184 }-
185}-
186-
187void QParallelAnimationGroupJob::updateDirection(QAbstractAnimationJob::Direction direction)-
188{-
189 //we need to update the direction of the current animation-
190 if (!isStopped()) {
!isStopped()Description
TRUEnever evaluated
FALSEevaluated 40 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
0-40
191 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEnever evaluated
FALSEnever evaluated
0
192 animation->setDirection(direction);-
193 }
never executed: end of block
0
194 } else {
never executed: end of block
0
195 if (direction == Forward) {
direction == ForwardDescription
TRUEnever evaluated
FALSEevaluated 40 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
0-40
196 m_previousLoop = 0;-
197 m_previousCurrentTime = 0;-
198 } else {
never executed: end of block
0
199 // Looping backwards with loopCount == -1 does not really work well...-
200 m_previousLoop = (m_loopCount == -1 ? 0 : m_loopCount - 1);
m_loopCount == -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
6-34
201 m_previousCurrentTime = duration();-
202 }
executed 40 times by 2 tests: end of block
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
40
203 }-
204}-
205-
206void QParallelAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimationJob *animation)-
207{-
208 Q_ASSERT(animation && (animation->duration() == -1 || animation->loopCount() < 0));-
209 int uncontrolledRunningCount = 0;-
210-
211 for (QAbstractAnimationJob *child = firstChild(); child; child = child->nextSibling()) {
childDescription
TRUEevaluated 46 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEevaluated 20 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
20-46
212 if (child == animation) {
child == animationDescription
TRUEevaluated 20 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
20-26
213 setUncontrolledAnimationFinishTime(animation, animation->currentTime());-
214 } else if (child->duration() == -1 || child->loopCount() < 0) {
executed 20 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
child->duration() == -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
child->loopCount() < 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
6-20
215 if (uncontrolledAnimationFinishTime(child) == -1)
uncontrolledAn...e(child) == -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
6
216 ++uncontrolledRunningCount;
executed 6 times by 1 test: ++uncontrolledRunningCount;
Executed by:
  • tst_qparallelanimationgroupjob
6
217 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qparallelanimationgroupjob
12
218 }
executed 46 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
46
219-
220 if (uncontrolledRunningCount > 0)
uncontrolledRunningCount > 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qparallelanimationgroupjob
FALSEevaluated 14 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
6-14
221 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qparallelanimationgroupjob
6
222-
223 int maxDuration = 0;-
224 bool running = false;-
225 for (QAbstractAnimationJob *job = firstChild(); job; job = job->nextSibling()) {
jobDescription
TRUEevaluated 28 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEevaluated 14 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
14-28
226 if (job->state() == Running)
job->state() == RunningDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
FALSEevaluated 22 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
6-22
227 running = true;
executed 6 times by 2 tests: running = true;
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
6
228 maxDuration = qMax(maxDuration, job->totalDuration());-
229 }
executed 28 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
28
230-
231 setUncontrolledAnimationFinishTime(this, qMax(maxDuration + m_currentLoopStartTime, currentTime()));-
232-
233 if (!running
!runningDescription
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qparallelanimationgroupjob
6-8
234 && ((m_direction == Forward && m_currentLoop == m_loopCount -1)
m_direction == ForwardDescription
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEnever evaluated
m_currentLoop ...m_loopCount -1Description
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
FALSEnever evaluated
0-8
235 || (m_direction == Backward && m_currentLoop == 0))) {
m_direction == BackwardDescription
TRUEnever evaluated
FALSEnever evaluated
m_currentLoop == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
236 stop();-
237 }
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
8
238}
executed 14 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qparallelanimationgroupjob
  • tst_qquickanimations
  • tst_qquickspringanimation
14
239-
240void QParallelAnimationGroupJob::debugAnimation(QDebug d) const-
241{-
242 d << "ParallelAnimationGroupJob(" << hex << (const void *) this << dec << ")";-
243-
244 debugChildren(d);-
245}
never executed: end of block
0
246-
247QT_END_NAMESPACE-
248-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0