qanimationgroup.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/animation/qanimationgroup.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13QAnimationGroup::QAnimationGroup(QObject *parent)-
14 : QAbstractAnimation(*new QAnimationGroupPrivate, parent)-
15{-
16}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QAbstractAnimation
1
17-
18-
19-
20-
21QAnimationGroup::QAnimationGroup(QAnimationGroupPrivate &dd, QObject *parent)-
22 : QAbstractAnimation(dd, parent)-
23{-
24}
executed 145 times by 6 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
145
25-
26-
27-
28-
29QAnimationGroup::~QAnimationGroup()-
30{-
31}-
32QAbstractAnimation *QAnimationGroup::animationAt(int index) const-
33{-
34 const QAnimationGroupPrivate * const d = d_func();-
35-
36 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 85 times by 4 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
|| index >= d->animations.size()
index >= d->animations.size()Description
TRUEnever evaluated
FALSEevaluated 85 times by 4 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
) {
0-85
37 QMessageLogger(__FILE__, 132, __PRETTY_FUNCTION__).warning("QAnimationGroup::animationAt: index is out of bounds");-
38 return
never executed: return 0;
0;
never executed: return 0;
0
39 }-
40-
41 return
executed 85 times by 4 tests: return d->animations.at(index);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
d->animations.at(index);
executed 85 times by 4 tests: return d->animations.at(index);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
85
42}-
43-
44-
45-
46-
47-
48-
49-
50int QAnimationGroup::animationCount() const-
51{-
52 const QAnimationGroupPrivate * const d = d_func();-
53 return
executed 38 times by 4 tests: return d->animations.size();
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
d->animations.size();
executed 38 times by 4 tests: return d->animations.size();
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
38
54}-
55-
56-
57-
58-
59-
60-
61-
62int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const-
63{-
64 const QAnimationGroupPrivate * const d = d_func();-
65 return
never executed: return d->animations.indexOf(animation);
d->animations.indexOf(animation);
never executed: return d->animations.indexOf(animation);
0
66}-
67void QAnimationGroup::addAnimation(QAbstractAnimation *animation)-
68{-
69 QAnimationGroupPrivate * const d = d_func();-
70 insertAnimation(d->animations.count(), animation);-
71}
executed 335 times by 7 tests: end of block
Executed by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
335
72void QAnimationGroup::insertAnimation(int index, QAbstractAnimation *animation)-
73{-
74 QAnimationGroupPrivate * const d = d_func();-
75-
76 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 337 times by 7 tests
Evaluated by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
|| index > d->animations.size()
index > d->animations.size()Description
TRUEnever evaluated
FALSEevaluated 337 times by 7 tests
Evaluated by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
) {
0-337
77 QMessageLogger(__FILE__, 191, __PRETTY_FUNCTION__).warning("QAnimationGroup::insertAnimation: index is out of bounds");-
78 return;
never executed: return;
0
79 }-
80-
81 if (QAnimationGroup *oldGroup = animation->group()
QAnimationGrou...ation->group()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QAnimationGroup
FALSEevaluated 335 times by 7 tests
Evaluated by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
2-335
82 oldGroup->removeAnimation(animation);
executed 2 times by 1 test: oldGroup->removeAnimation(animation);
Executed by:
  • tst_QAnimationGroup
2
83-
84 d->animations.insert(index, animation);-
85 QAbstractAnimationPrivate::get(animation)->group = this;-
86-
87 animation->setParent(this);-
88 d->animationInsertedAt(index);-
89}
executed 337 times by 7 tests: end of block
Executed by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
337
90-
91-
92-
93-
94-
95-
96-
97void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)-
98{-
99 QAnimationGroupPrivate * const d = d_func();-
100-
101 if (!animation
!animationDescription
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
) {
0-8
102 QMessageLogger(__FILE__, 216, __PRETTY_FUNCTION__).warning("QAnimationGroup::remove: cannot remove null animation");-
103 return;
never executed: return;
0
104 }-
105 int index = d->animations.indexOf(animation);-
106 if (index == -1
index == -1Description
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
) {
0-8
107 QMessageLogger(__FILE__, 221, __PRETTY_FUNCTION__).warning("QAnimationGroup::remove: animation is not part of this group");-
108 return;
never executed: return;
0
109 }-
110-
111 takeAnimation(index);-
112}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
8
113QAbstractAnimation *QAnimationGroup::takeAnimation(int index)-
114{-
115 QAnimationGroupPrivate * const d = d_func();-
116 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 229 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
|| index >= d->animations.size()
index >= d->animations.size()Description
TRUEnever evaluated
FALSEevaluated 229 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
) {
0-229
117 QMessageLogger(__FILE__, 239, __PRETTY_FUNCTION__).warning("QAnimationGroup::takeAnimation: no animation at index %d", index);-
118 return
never executed: return 0;
0;
never executed: return 0;
0
119 }-
120 QAbstractAnimation *animation = d->animations.at(index);-
121 QAbstractAnimationPrivate::get(animation)->group = 0;-
122-
123-
124 d->animations.removeAt(index);-
125 animation->setParent(0);-
126 d->animationRemoved(index, animation);-
127 return
executed 229 times by 5 tests: return animation;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
animation;
executed 229 times by 5 tests: return animation;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
229
128}-
129-
130-
131-
132-
133-
134-
135-
136void QAnimationGroup::clear()-
137{-
138 QAnimationGroupPrivate * const d = d_func();-
139 qDeleteAll(d->animations);-
140}
executed 5 times by 3 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
5
141-
142-
143-
144-
145bool QAnimationGroup::event(QEvent *event)-
146{-
147 QAnimationGroupPrivate * const d = d_func();-
148 if (event->type() == QEvent::ChildAdded
event->type() ...nt::ChildAddedDescription
TRUEevaluated 337 times by 7 tests
Evaluated by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 450 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
) {
337-450
149 QChildEvent *childEvent = static_cast<QChildEvent *>(event);-
150 if (QAbstractAnimation *a = qobject_cast<QAbstractAnimation *>(childEvent->child())
QAbstractAnima...vent->child())Description
TRUEevaluated 337 times by 7 tests
Evaluated by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEnever evaluated
) {
0-337
151 if (a->group() != this
a->group() != thisDescription
TRUEevaluated 65 times by 4 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
FALSEevaluated 272 times by 6 tests
Evaluated by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
65-272
152 addAnimation(a);
executed 65 times by 4 tests: addAnimation(a);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
65
153 }
executed 337 times by 7 tests: end of block
Executed by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
337
154 }
executed 337 times by 7 tests: end of block
Executed by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
else if (event->type() == QEvent::ChildRemoved
event->type() ...::ChildRemovedDescription
TRUEevaluated 450 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
FALSEnever evaluated
) {
0-450
155 QChildEvent *childEvent = static_cast<QChildEvent *>(event);-
156-
157-
158-
159 const QList<QAbstractAnimation *>::const_iterator it-
160 = std::find(d->animations.cbegin(), d->animations.cend(), childEvent->child());-
161 if (it != d->animations.cend()
it != d->animations.cend()Description
TRUEevaluated 221 times by 4 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
FALSEevaluated 229 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
)
221-229
162 takeAnimation(it - d->animations.cbegin());
executed 221 times by 4 tests: takeAnimation(it - d->animations.cbegin());
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
221
163 }
executed 450 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
450
164 return
executed 787 times by 7 tests: return QAbstractAnimation::event(event);
Executed by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
QAbstractAnimation::event(event);
executed 787 times by 7 tests: return QAbstractAnimation::event(event);
Executed by:
  • tst_QAbstractAnimation
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
787
165}-
166-
167-
168void QAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *)-
169{-
170 QAnimationGroup * const q = q_func();-
171 (void)index;;-
172 if (animations.isEmpty()
animations.isEmpty()Description
TRUEevaluated 77 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
FALSEevaluated 152 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
) {
77-152
173 currentTime = 0;-
174 q->stop();-
175 }
executed 77 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
77
176}
executed 229 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QPropertyAnimation
  • tst_QSequentialAnimationGroup
229
177-
178-
179-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9