OpenCoverage

qquickanimator.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickanimator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QQuickAnimator::QQuickAnimator(QQuickAnimatorPrivate &dd, QObject *parent)-
5 : QQuickAbstractAnimation(dd, parent)-
6{-
7}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
8-
9QQuickAnimator::QQuickAnimator(QObject *parent)-
10 : QQuickAbstractAnimation(*new QQuickAnimatorPrivate, parent)-
11{-
12}
executed 28 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
28
13void QQuickAnimator::setTargetItem(QQuickItem *target)-
14{-
15 QQuickAnimatorPrivate * const d = d_func();-
16 if (target == d->target
target == d->targetDescription
TRUEnever evaluated
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-24
17 return;
never executed: return;
0
18 d->target = target;-
19 targetItemChanged(d->target);-
20}
executed 24 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
24
21-
22QQuickItem *QQuickAnimator::targetItem() const-
23{-
24 const QQuickAnimatorPrivate * const d = d_func();-
25 return
never executed: return d->target;
d->target;
never executed: return d->target;
0
26}-
27-
28-
29-
30-
31-
32-
33-
34void QQuickAnimator::setDuration(int duration)-
35{-
36 QQuickAnimatorPrivate * const d = d_func();-
37 if (duration == d->duration
duration == d->durationDescription
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-36
38 return;
never executed: return;
0
39 d->duration = duration;-
40 durationChanged(duration);-
41}
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
36
42-
43int QQuickAnimator::duration() const-
44{-
45 const QQuickAnimatorPrivate * const d = d_func();-
46 return
never executed: return d->duration;
d->duration;
never executed: return d->duration;
0
47}-
48void QQuickAnimator::setEasing(const QEasingCurve &easing)-
49{-
50 QQuickAnimatorPrivate * const d = d_func();-
51 if (easing == d->easing
easing == d->easingDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
)
0-8
52 return;
never executed: return;
0
53 d->easing = easing;-
54 easingChanged(d->easing);-
55}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
56-
57QEasingCurve QQuickAnimator::easing() const-
58{-
59 const QQuickAnimatorPrivate * const d = d_func();-
60 return
executed 8 times by 1 test: return d->easing;
Executed by:
  • tst_examples
d->easing;
executed 8 times by 1 test: return d->easing;
Executed by:
  • tst_examples
8
61}-
62void QQuickAnimator::setTo(qreal to)-
63{-
64 QQuickAnimatorPrivate * const d = d_func();-
65 if (to == d->to
to == d->toDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
)
10-26
66 return;
executed 10 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimations
10
67 d->isToDefined = true;-
68 d->to = to;-
69 toChanged(d->to);-
70}
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
71-
72qreal QQuickAnimator::to() const-
73{-
74 const QQuickAnimatorPrivate * const d = d_func();-
75 return
never executed: return d->to;
d->to;
never executed: return d->to;
0
76}-
77void QQuickAnimator::setFrom(qreal from)-
78{-
79 QQuickAnimatorPrivate * const d = d_func();-
80 if (from == d->from
from == d->fromDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
12-24
81 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_examples
12
82 d->isFromDefined = true;-
83 d->from = from;-
84 fromChanged(d->from);-
85}
executed 24 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
24
86-
87qreal QQuickAnimator::from() const-
88{-
89 const QQuickAnimatorPrivate * const d = d_func();-
90 return
never executed: return d->from;
d->from;
never executed: return d->from;
0
91}-
92-
93void QQuickAnimatorPrivate::apply(QQuickAnimatorJob *job,-
94 const QString &propertyName,-
95 QQuickStateActions &actions,-
96 QQmlProperties &modified,-
97 QObject *defaultTarget)-
98{-
99-
100 if (actions.size()
actions.size()Description
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-36
101 for (int i=0; i<actions.size()
i<actions.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
102 QQuickStateAction &action = actions[i];-
103 if (action.property.name() != propertyName
action.propert...= propertyNameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
104 continue;
never executed: continue;
0
105 modified << action.property;-
106-
107 job->setTarget(qobject_cast<QQuickItem *>(action.property.object()));-
108-
109 if (isFromDefined
isFromDefinedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
110 job->setFrom(from);
never executed: job->setFrom(from);
0
111 else if (action.fromValue.isValid()
action.fromValue.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
112 job->setFrom(action.fromValue.toReal());
never executed: job->setFrom(action.fromValue.toReal());
0
113 else-
114 job->setFrom(action.property.read().toReal());
never executed: job->setFrom(action.property.read().toReal());
0
115-
116 if (isToDefined
isToDefinedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
117 job->setTo(to);
never executed: job->setTo(to);
0
118 else if (action.toValue.isValid()
action.toValue.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
119 job->setTo(action.toValue.toReal());
never executed: job->setTo(action.toValue.toReal());
0
120 else-
121 job->setTo(action.property.read().toReal());
never executed: job->setTo(action.property.read().toReal());
0
122-
123-
124-
125-
126-
127 action.fromValue = action.toValue;-
128 }
never executed: end of block
0
129 }
never executed: end of block
0
130-
131 if (modified.isEmpty()
modified.isEmpty()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-36
132 job->setTarget(target);-
133 job->setFrom(from);-
134 job->setTo(to);-
135 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
36
136-
137 if (!job->target()
!job->target()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
12-24
138 if (defaultProperty.object()
defaultProperty.object()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-12
139 job->setTarget(qobject_cast<QQuickItem *>(defaultProperty.object()));
executed 12 times by 1 test: job->setTarget(qobject_cast<QQuickItem *>(defaultProperty.object()));
Executed by:
  • tst_examples
12
140 else-
141 job->setTarget(qobject_cast<QQuickItem *>(defaultTarget));
never executed: job->setTarget(qobject_cast<QQuickItem *>(defaultTarget));
0
142 }-
143-
144 job->setDuration(duration);-
145 job->setLoopCount(loopCount);-
146 job->setEasingCurve(easing);-
147}
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
36
148-
149QAbstractAnimationJob *QQuickAnimator::transition(QQuickStateActions &actions,-
150 QQmlProperties &modified,-
151 TransitionDirection direction,-
152 QObject *defaultTarget)-
153{-
154 QQuickAnimatorPrivate * const d = d_func();-
155-
156 if (d->defaultProperty.isValid()
d->defaultProperty.isValid()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
&& propertyName() != d->defaultProperty.name()
propertyName()...roperty.name()Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
) {
0-24
157 QMessageLogger(__FILE__, 282, __PRETTY_FUNCTION__).debug() << __PRETTY_FUNCTION__ << "property name conflict...";-
158 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
159 }-
160-
161-
162 if (direction == Backward
direction == BackwardDescription
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-36
163 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
164-
165 QQuickAnimatorJob *job = createJob();-
166 if (!job
!jobDescription
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-36
167 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
168-
169 d->apply(job, propertyName(), actions, modified, defaultTarget);-
170-
171 if (!job->target()
!job->target()Description
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-36
172 delete job;-
173 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
174 }-
175-
176 return
executed 36 times by 2 tests: return job;
Executed by:
  • tst_examples
  • tst_qquickanimations
job;
executed 36 times by 2 tests: return job;
Executed by:
  • tst_examples
  • tst_qquickanimations
36
177}-
178QQuickXAnimator::QQuickXAnimator(QObject *parent) : QQuickAnimator(parent) {}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
179-
180QQuickAnimatorJob *QQuickXAnimator::createJob() const { return
executed 4 times by 1 test: return new QQuickXAnimatorJob();
Executed by:
  • tst_examples
new QQuickXAnimatorJob();
executed 4 times by 1 test: return new QQuickXAnimatorJob();
Executed by:
  • tst_examples
}
4
181QQuickYAnimator::QQuickYAnimator(QObject *parent) : QQuickAnimator(parent) {}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
182-
183QQuickAnimatorJob *QQuickYAnimator::createJob() const { return
executed 8 times by 1 test: return new QQuickYAnimatorJob();
Executed by:
  • tst_examples
new QQuickYAnimatorJob();
executed 8 times by 1 test: return new QQuickYAnimatorJob();
Executed by:
  • tst_examples
}
8
184QQuickScaleAnimator::QQuickScaleAnimator(QObject *parent) : QQuickAnimator(parent) {}
executed 10 times by 1 test: end of block
Executed by:
  • tst_examples
10
185-
186QQuickAnimatorJob *QQuickScaleAnimator::createJob() const { return
executed 10 times by 1 test: return new QQuickScaleAnimatorJob();
Executed by:
  • tst_examples
new QQuickScaleAnimatorJob();
executed 10 times by 1 test: return new QQuickScaleAnimatorJob();
Executed by:
  • tst_examples
}
10
187QQuickOpacityAnimator::QQuickOpacityAnimator(QObject *parent) : QQuickAnimator(parent) {}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
6
188-
189QQuickAnimatorJob *QQuickOpacityAnimator::createJob() const { return
executed 6 times by 2 tests: return new QQuickOpacityAnimatorJob();
Executed by:
  • tst_examples
  • tst_qquickanimations
new QQuickOpacityAnimatorJob();
executed 6 times by 2 tests: return new QQuickOpacityAnimatorJob();
Executed by:
  • tst_examples
  • tst_qquickanimations
}
6
190QQuickRotationAnimator::QQuickRotationAnimator(QObject *parent)-
191 : QQuickAnimator(*new QQuickRotationAnimatorPrivate, parent)-
192{-
193}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
194-
195QQuickAnimatorJob *QQuickRotationAnimator::createJob() const {-
196 const QQuickRotationAnimatorPrivate * const d = d_func();-
197 QQuickRotationAnimatorJob *job = new QQuickRotationAnimatorJob();-
198 job->setDirection(d->direction);-
199 return
executed 4 times by 1 test: return job;
Executed by:
  • tst_examples
job;
executed 4 times by 1 test: return job;
Executed by:
  • tst_examples
4
200}-
201void QQuickRotationAnimator::setDirection(RotationDirection dir)-
202{-
203 QQuickRotationAnimatorPrivate * const d = d_func();-
204 if (d->direction == dir
d->direction == dirDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
205 return;
never executed: return;
0
206 d->direction = dir;-
207 directionChanged(d->direction);-
208}
never executed: end of block
0
209-
210QQuickRotationAnimator::RotationDirection QQuickRotationAnimator::direction() const-
211{-
212 const QQuickRotationAnimatorPrivate * const d = d_func();-
213 return
never executed: return d->direction;
d->direction;
never executed: return d->direction;
0
214}-
215QQuickUniformAnimator::QQuickUniformAnimator(QObject *parent)-
216 : QQuickAnimator(*new QQuickUniformAnimatorPrivate, parent)-
217{-
218}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
219void QQuickUniformAnimator::setUniform(const QString &uniform)-
220{-
221 QQuickUniformAnimatorPrivate * const d = d_func();-
222 if (d->uniform == uniform
d->uniform == uniformDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
)
0-2
223 return;
never executed: return;
0
224 d->uniform = uniform;-
225 uniformChanged(d->uniform);-
226}
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
227-
228QString QQuickUniformAnimator::uniform() const-
229{-
230 const QQuickUniformAnimatorPrivate * const d = d_func();-
231 return
never executed: return d->uniform;
d->uniform;
never executed: return d->uniform;
0
232}-
233-
234QString QQuickUniformAnimator::propertyName() const-
235{-
236 const QQuickUniformAnimatorPrivate * const d = d_func();-
237 if (!d->uniform.isEmpty()
!d->uniform.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
)
4-6
238 return
executed 4 times by 1 test: return d->uniform;
Executed by:
  • tst_examples
d->uniform;
executed 4 times by 1 test: return d->uniform;
Executed by:
  • tst_examples
4
239 return
executed 6 times by 1 test: return d->defaultProperty.name();
Executed by:
  • tst_examples
d->defaultProperty.name();
executed 6 times by 1 test: return d->defaultProperty.name();
Executed by:
  • tst_examples
6
240}-
241-
242QQuickAnimatorJob *QQuickUniformAnimator::createJob() const-
243{-
244 QString u = propertyName();-
245 if (u.isEmpty()
u.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
)
0-4
246 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
247-
248 QQuickUniformAnimatorJob *job = new QQuickUniformAnimatorJob();-
249 job->setUniform(u.toLatin1());-
250 return
executed 4 times by 1 test: return job;
Executed by:
  • tst_examples
job;
executed 4 times by 1 test: return job;
Executed by:
  • tst_examples
4
251}-
252-
253-
254-
255-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0