Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquicksmoothedanimation.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | - | |||||||||||||
7 | - | |||||||||||||
8 | - | |||||||||||||
9 | - | |||||||||||||
10 | - | |||||||||||||
11 | - | |||||||||||||
12 | - | |||||||||||||
13 | QSmoothedAnimationTimer::QSmoothedAnimationTimer(QSmoothedAnimation *animation, QObject *parent) | - | ||||||||||||
14 | : QTimer(parent) | - | ||||||||||||
15 | , m_animation(animation) | - | ||||||||||||
16 | { | - | ||||||||||||
17 | connect(this, qFlagLocation("2""timeout()" "\0" __FILE__ ":" "64"), this, qFlagLocation("1""stopAnimation()" "\0" __FILE__ ":" "64")); | - | ||||||||||||
18 | } executed 10652 times by 13 tests: end of block Executed by:
| 10652 | ||||||||||||
19 | - | |||||||||||||
20 | QSmoothedAnimationTimer::~QSmoothedAnimationTimer() | - | ||||||||||||
21 | { | - | ||||||||||||
22 | } | - | ||||||||||||
23 | - | |||||||||||||
24 | void QSmoothedAnimationTimer::stopAnimation() | - | ||||||||||||
25 | { | - | ||||||||||||
26 | m_animation->stop(); | - | ||||||||||||
27 | } executed 195 times by 4 tests: end of block Executed by:
| 195 | ||||||||||||
28 | - | |||||||||||||
29 | QSmoothedAnimation::QSmoothedAnimation(QQuickSmoothedAnimationPrivate *priv) | - | ||||||||||||
30 | : QAbstractAnimationJob(), to(0), velocity(200), userDuration(-1), maximumEasingTime(-1), | - | ||||||||||||
31 | reversingMode(QQuickSmoothedAnimation::Eased), initialVelocity(0), | - | ||||||||||||
32 | trackVelocity(0), initialValue(0), invert(false), finalDuration(-1), lastTime(0), | - | ||||||||||||
33 | skipUpdate(false), delayedStopTimer(new QSmoothedAnimationTimer(this)), animationTemplate(priv) | - | ||||||||||||
34 | { | - | ||||||||||||
35 | delayedStopTimer->setInterval(32); | - | ||||||||||||
36 | delayedStopTimer->setSingleShot(true); | - | ||||||||||||
37 | } executed 10652 times by 13 tests: end of block Executed by:
| 10652 | ||||||||||||
38 | - | |||||||||||||
39 | QSmoothedAnimation::~QSmoothedAnimation() | - | ||||||||||||
40 | { | - | ||||||||||||
41 | delete delayedStopTimer; | - | ||||||||||||
42 | if (animationTemplate
| 24-10612 | ||||||||||||
43 | if (target.object()
| 0-24 | ||||||||||||
44 | QHash<QQmlProperty, QSmoothedAnimation* >::iterator it = | - | ||||||||||||
45 | animationTemplate->activeAnimations.find(target); | - | ||||||||||||
46 | if (it != animationTemplate->activeAnimations.end()
| 0 | ||||||||||||
47 | animationTemplate->activeAnimations.erase(it); never executed: animationTemplate->activeAnimations.erase(it); | 0 | ||||||||||||
48 | } never executed: else {end of block | 0 | ||||||||||||
49 | - | |||||||||||||
50 | QHash<QQmlProperty, QSmoothedAnimation* >::iterator it; | - | ||||||||||||
51 | for (it = animationTemplate->activeAnimations.begin(); it != animationTemplate->activeAnimations.end()
| 0-24 | ||||||||||||
52 | if (it.value() == this
| 0-24 | ||||||||||||
53 | animationTemplate->activeAnimations.erase(it); | - | ||||||||||||
54 | break; executed 24 times by 3 tests: break; Executed by:
| 24 | ||||||||||||
55 | } | - | ||||||||||||
56 | } never executed: end of block | 0 | ||||||||||||
57 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||||||||
58 | } | - | ||||||||||||
59 | } executed 10636 times by 12 tests: end of block Executed by:
| 10636 | ||||||||||||
60 | - | |||||||||||||
61 | void QSmoothedAnimation::restart() | - | ||||||||||||
62 | { | - | ||||||||||||
63 | initialVelocity = trackVelocity; | - | ||||||||||||
64 | if (isRunning()
| 9164-41531 | ||||||||||||
65 | init(); executed 9164 times by 4 tests: init(); Executed by:
| 9164 | ||||||||||||
66 | else | - | ||||||||||||
67 | start(); executed 41531 times by 11 tests: start(); Executed by:
| 41531 | ||||||||||||
68 | } | - | ||||||||||||
69 | - | |||||||||||||
70 | void QSmoothedAnimation::prepareForRestart() | - | ||||||||||||
71 | { | - | ||||||||||||
72 | initialVelocity = trackVelocity; | - | ||||||||||||
73 | if (isRunning()
| 15-50 | ||||||||||||
74 | - | |||||||||||||
75 | skipUpdate = true; | - | ||||||||||||
76 | init(); | - | ||||||||||||
77 | lastTime = 0; | - | ||||||||||||
78 | } executed 50 times by 2 tests: else {end of block Executed by:
| 50 | ||||||||||||
79 | skipUpdate = false; | - | ||||||||||||
80 | - | |||||||||||||
81 | } executed 15 times by 2 tests: end of block Executed by:
| 15 | ||||||||||||
82 | } | - | ||||||||||||
83 | - | |||||||||||||
84 | void QSmoothedAnimation::updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State ) | - | ||||||||||||
85 | { | - | ||||||||||||
86 | if (newState == QAbstractAnimationJob::Running
| 40292-41572 | ||||||||||||
87 | init(); executed 41572 times by 13 tests: init(); Executed by:
| 41572 | ||||||||||||
88 | } executed 81864 times by 13 tests: end of block Executed by:
| 81864 | ||||||||||||
89 | - | |||||||||||||
90 | void QSmoothedAnimation::delayedStop() | - | ||||||||||||
91 | { | - | ||||||||||||
92 | if (!delayedStopTimer->isActive()
| 577-678 | ||||||||||||
93 | delayedStopTimer->start(); executed 678 times by 4 tests: delayedStopTimer->start(); Executed by:
| 678 | ||||||||||||
94 | } executed 1255 times by 4 tests: end of block Executed by:
| 1255 | ||||||||||||
95 | - | |||||||||||||
96 | int QSmoothedAnimation::duration() const | - | ||||||||||||
97 | { | - | ||||||||||||
98 | return executed 49139 times by 13 tests: -1;return -1; Executed by:
executed 49139 times by 13 tests: return -1; Executed by:
| 49139 | ||||||||||||
99 | } | - | ||||||||||||
100 | - | |||||||||||||
101 | bool QSmoothedAnimation::recalc() | - | ||||||||||||
102 | { | - | ||||||||||||
103 | s = to - initialValue; | - | ||||||||||||
104 | vi = initialVelocity; | - | ||||||||||||
105 | - | |||||||||||||
106 | s = (invert
| 4038-6910 | ||||||||||||
107 | - | |||||||||||||
108 | if (userDuration >= 0
| 4-6075 | ||||||||||||
109 | tf = s / velocity; | - | ||||||||||||
110 | if (tf > (userDuration / 1000.)
executed 5374 times by 3 tests: tf = (userDuration / 1000.); Executed by:
| 697-5374 | ||||||||||||
111 | } executed 6071 times by 3 tests: else if (userDuration >= 0end of block Executed by:
| 4-6071 | ||||||||||||
112 | tf = userDuration / 1000.; | - | ||||||||||||
113 | } executed 4 times by 1 test: else if (velocity > 0end of block Executed by:
| 0-4873 | ||||||||||||
114 | tf = s / velocity; | - | ||||||||||||
115 | } executed 4873 times by 4 tests: else {end of block Executed by:
| 4873 | ||||||||||||
116 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||
117 | } | - | ||||||||||||
118 | - | |||||||||||||
119 | finalDuration = qCeil(tf * 1000.0); | - | ||||||||||||
120 | - | |||||||||||||
121 | if (maximumEasingTime == 0
| 0-10948 | ||||||||||||
122 | a = 0; | - | ||||||||||||
123 | d = 0; | - | ||||||||||||
124 | tp = 0; | - | ||||||||||||
125 | td = tf; | - | ||||||||||||
126 | vp = velocity; | - | ||||||||||||
127 | sp = 0; | - | ||||||||||||
128 | sd = s; | - | ||||||||||||
129 | } never executed: else if (maximumEasingTime != -1end of block
| 0-10948 | ||||||||||||
130 | qreal met = maximumEasingTime / 1000.; | - | ||||||||||||
131 | qreal ta = met / 2.; | - | ||||||||||||
132 | a = (s - (vi * tf - 0.5 * vi * ta)) / (tf * ta - ta * ta); | - | ||||||||||||
133 | - | |||||||||||||
134 | vp = vi + a * ta; | - | ||||||||||||
135 | d = vp / ta; | - | ||||||||||||
136 | tp = ta; | - | ||||||||||||
137 | sp = vi * ta + 0.5 * a * tp * tp; | - | ||||||||||||
138 | sd = sp + vp * (tf - 2 * ta); | - | ||||||||||||
139 | td = tf - ta; | - | ||||||||||||
140 | } never executed: else {end of block | 0 | ||||||||||||
141 | qreal c1 = 0.25 * tf * tf; | - | ||||||||||||
142 | qreal c2 = 0.5 * vi * tf - s; | - | ||||||||||||
143 | qreal c3 = -0.25 * vi * vi; | - | ||||||||||||
144 | - | |||||||||||||
145 | qreal a1 = (-c2 + qSqrt(c2 * c2 - 4 * c1 * c3)) / (2. * c1); | - | ||||||||||||
146 | - | |||||||||||||
147 | qreal tp1 = 0.5 * tf - 0.5 * vi / a1; | - | ||||||||||||
148 | qreal vp1 = a1 * tp1 + vi; | - | ||||||||||||
149 | - | |||||||||||||
150 | qreal sp1 = 0.5 * a1 * tp1 * tp1 + vi * tp1; | - | ||||||||||||
151 | - | |||||||||||||
152 | a = a1; | - | ||||||||||||
153 | d = a1; | - | ||||||||||||
154 | tp = tp1; | - | ||||||||||||
155 | td = tp1; | - | ||||||||||||
156 | vp = vp1; | - | ||||||||||||
157 | sp = sp1; | - | ||||||||||||
158 | sd = sp1; | - | ||||||||||||
159 | } executed 10948 times by 6 tests: end of block Executed by:
| 10948 | ||||||||||||
160 | return executed 10948 times by 6 tests: true;return true; Executed by:
executed 10948 times by 6 tests: return true; Executed by:
| 10948 | ||||||||||||
161 | } | - | ||||||||||||
162 | - | |||||||||||||
163 | qreal QSmoothedAnimation::easeFollow(qreal time_seconds) | - | ||||||||||||
164 | { | - | ||||||||||||
165 | qreal value; | - | ||||||||||||
166 | if (time_seconds < tp
| 2798-5931 | ||||||||||||
167 | trackVelocity = vi + time_seconds * a; | - | ||||||||||||
168 | value = 0.5 * a * time_seconds * time_seconds + vi * time_seconds; | - | ||||||||||||
169 | } executed 5931 times by 6 tests: else if (time_seconds < tdend of block Executed by:
| 0-5931 | ||||||||||||
170 | time_seconds -= tp; | - | ||||||||||||
171 | trackVelocity = vp; | - | ||||||||||||
172 | value = sp + time_seconds * vp; | - | ||||||||||||
173 | } never executed: else if (time_seconds < tfend of block
| 0-1543 | ||||||||||||
174 | time_seconds -= td; | - | ||||||||||||
175 | trackVelocity = vp - time_seconds * a; | - | ||||||||||||
176 | value = sd - 0.5 * d * time_seconds * time_seconds + vp * time_seconds; | - | ||||||||||||
177 | } executed 1543 times by 4 tests: else {end of block Executed by:
| 1543 | ||||||||||||
178 | trackVelocity = 0; | - | ||||||||||||
179 | value = s; | - | ||||||||||||
180 | delayedStop(); | - | ||||||||||||
181 | } executed 1255 times by 4 tests: end of block Executed by:
| 1255 | ||||||||||||
182 | - | |||||||||||||
183 | - | |||||||||||||
184 | return executed 8729 times by 6 tests: value;return value; Executed by:
executed 8729 times by 6 tests: return value; Executed by:
| 8729 | ||||||||||||
185 | } | - | ||||||||||||
186 | - | |||||||||||||
187 | void QSmoothedAnimation::updateCurrentTime(int t) | - | ||||||||||||
188 | { | - | ||||||||||||
189 | if (skipUpdate
| 50-8729 | ||||||||||||
190 | skipUpdate = false; | - | ||||||||||||
191 | return; executed 50 times by 2 tests: return; Executed by:
| 50 | ||||||||||||
192 | } | - | ||||||||||||
193 | - | |||||||||||||
194 | if (!isRunning()
| 0-8727 | ||||||||||||
195 | return; never executed: return; | 0 | ||||||||||||
196 | - | |||||||||||||
197 | qreal time_seconds = qreal(t - lastTime) / 1000.; | - | ||||||||||||
198 | - | |||||||||||||
199 | qreal value = easeFollow(time_seconds); | - | ||||||||||||
200 | value *= (invert
| 3199-5530 | ||||||||||||
201 | QQmlPropertyPrivate::write(target, initialValue + value, | - | ||||||||||||
202 | QQmlPropertyData::BypassInterceptor | - | ||||||||||||
203 | | QQmlPropertyData::DontRemoveBinding); | - | ||||||||||||
204 | } executed 8729 times by 6 tests: end of block Executed by:
| 8729 | ||||||||||||
205 | - | |||||||||||||
206 | void QSmoothedAnimation::init() | - | ||||||||||||
207 | { | - | ||||||||||||
208 | if (velocity == 0
| 0-50786 | ||||||||||||
209 | stop(); | - | ||||||||||||
210 | return; never executed: return; | 0 | ||||||||||||
211 | } | - | ||||||||||||
212 | - | |||||||||||||
213 | if (delayedStopTimer->isActive()
| 256-50530 | ||||||||||||
214 | delayedStopTimer->stop(); executed 256 times by 3 tests: delayedStopTimer->stop(); Executed by:
| 256 | ||||||||||||
215 | - | |||||||||||||
216 | initialValue = target.read().toReal(); | - | ||||||||||||
217 | lastTime = this->currentTime(); | - | ||||||||||||
218 | - | |||||||||||||
219 | if (to == initialValue
| 10948-39838 | ||||||||||||
220 | stop(); | - | ||||||||||||
221 | return; executed 39838 times by 11 tests: return; Executed by:
| 39838 | ||||||||||||
222 | } | - | ||||||||||||
223 | - | |||||||||||||
224 | bool hasReversed = trackVelocity != 0.
| 2697-8251 | ||||||||||||
225 | ((
| 180-2517 | ||||||||||||
226 | - | |||||||||||||
227 | if (hasReversed
| 180-10768 | ||||||||||||
228 | switch (reversingMode) { | - | ||||||||||||
229 | default never executed: :default: never executed: default: | 0 | ||||||||||||
230 | case executed 180 times by 2 tests: QQuickSmoothedAnimation::Eased:case QQuickSmoothedAnimation::Eased: Executed by:
executed 180 times by 2 tests: case QQuickSmoothedAnimation::Eased: Executed by:
| 180 | ||||||||||||
231 | initialVelocity = -trackVelocity; | - | ||||||||||||
232 | break; executed 180 times by 2 tests: break; Executed by:
| 180 | ||||||||||||
233 | case never executed: QQuickSmoothedAnimation::Sync:case QQuickSmoothedAnimation::Sync: never executed: case QQuickSmoothedAnimation::Sync: | 0 | ||||||||||||
234 | QQmlPropertyPrivate::write(target, to, | - | ||||||||||||
235 | QQmlPropertyData::BypassInterceptor | - | ||||||||||||
236 | | QQmlPropertyData::DontRemoveBinding); | - | ||||||||||||
237 | trackVelocity = 0; | - | ||||||||||||
238 | stop(); | - | ||||||||||||
239 | return; never executed: return; | 0 | ||||||||||||
240 | case never executed: QQuickSmoothedAnimation::Immediate:case QQuickSmoothedAnimation::Immediate: never executed: case QQuickSmoothedAnimation::Immediate: | 0 | ||||||||||||
241 | initialVelocity = 0; | - | ||||||||||||
242 | break; never executed: break; | 0 | ||||||||||||
243 | } | - | ||||||||||||
244 | } | - | ||||||||||||
245 | - | |||||||||||||
246 | trackVelocity = initialVelocity; | - | ||||||||||||
247 | - | |||||||||||||
248 | invert = (to < initialValue); | - | ||||||||||||
249 | - | |||||||||||||
250 | if (!recalc()
| 0-10948 | ||||||||||||
251 | QQmlPropertyPrivate::write(target, to, | - | ||||||||||||
252 | QQmlPropertyData::BypassInterceptor | - | ||||||||||||
253 | | QQmlPropertyData::DontRemoveBinding); | - | ||||||||||||
254 | stop(); | - | ||||||||||||
255 | return; never executed: return; | 0 | ||||||||||||
256 | } | - | ||||||||||||
257 | } executed 10948 times by 6 tests: end of block Executed by:
| 10948 | ||||||||||||
258 | - | |||||||||||||
259 | void QSmoothedAnimation::debugAnimation(QDebug d) const | - | ||||||||||||
260 | { | - | ||||||||||||
261 | d << "SmoothedAnimationJob(" << hex << (const void *) this << dec << ")" << "duration:" << userDuration | - | ||||||||||||
262 | << "velocity:" << velocity << "target:" << target.object() << "property:" << target.name() | - | ||||||||||||
263 | << "to:" << to << "current velocity:" << trackVelocity; | - | ||||||||||||
264 | } never executed: end of block | 0 | ||||||||||||
265 | QQuickSmoothedAnimation::QQuickSmoothedAnimation(QObject *parent) | - | ||||||||||||
266 | : QQuickNumberAnimation(*(new QQuickSmoothedAnimationPrivate), parent) | - | ||||||||||||
267 | { | - | ||||||||||||
268 | } executed 42 times by 3 tests: end of block Executed by:
| 42 | ||||||||||||
269 | - | |||||||||||||
270 | QQuickSmoothedAnimation::~QQuickSmoothedAnimation() | - | ||||||||||||
271 | { | - | ||||||||||||
272 | - | |||||||||||||
273 | } | - | ||||||||||||
274 | - | |||||||||||||
275 | QQuickSmoothedAnimationPrivate::QQuickSmoothedAnimationPrivate() | - | ||||||||||||
276 | : anim(new QSmoothedAnimation) | - | ||||||||||||
277 | { | - | ||||||||||||
278 | } executed 42 times by 3 tests: end of block Executed by:
| 42 | ||||||||||||
279 | - | |||||||||||||
280 | QQuickSmoothedAnimationPrivate::~QQuickSmoothedAnimationPrivate() | - | ||||||||||||
281 | { | - | ||||||||||||
282 | typedef QHash<QQmlProperty, QSmoothedAnimation* >::iterator ActiveAnimationsHashIt; | - | ||||||||||||
283 | - | |||||||||||||
284 | delete anim; | - | ||||||||||||
285 | for (ActiveAnimationsHashIt it = activeAnimations.begin(), end = activeAnimations.end(); it != end
| 0-40 | ||||||||||||
286 | it.value()->clearTemplate(); never executed: it.value()->clearTemplate(); | 0 | ||||||||||||
287 | } executed 40 times by 3 tests: end of block Executed by:
| 40 | ||||||||||||
288 | - | |||||||||||||
289 | void QQuickSmoothedAnimationPrivate::updateRunningAnimations() | - | ||||||||||||
290 | { | - | ||||||||||||
291 | for (QSmoothedAnimation *ease : qAsConst(activeAnimations)) { | - | ||||||||||||
292 | ease->maximumEasingTime = anim->maximumEasingTime; | - | ||||||||||||
293 | ease->reversingMode = anim->reversingMode; | - | ||||||||||||
294 | ease->velocity = anim->velocity; | - | ||||||||||||
295 | ease->userDuration = anim->userDuration; | - | ||||||||||||
296 | ease->init(); | - | ||||||||||||
297 | } never executed: end of block | 0 | ||||||||||||
298 | } executed 34 times by 2 tests: end of block Executed by:
| 34 | ||||||||||||
299 | - | |||||||||||||
300 | QAbstractAnimationJob* QQuickSmoothedAnimation::transition(QQuickStateActions &actions, | - | ||||||||||||
301 | QQmlProperties &modified, | - | ||||||||||||
302 | TransitionDirection direction, | - | ||||||||||||
303 | QObject *defaultTarget) | - | ||||||||||||
304 | { | - | ||||||||||||
305 | (void)direction;; | - | ||||||||||||
306 | QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
307 | - | |||||||||||||
308 | const QQuickStateActions dataActions = QQuickPropertyAnimation::createTransitionActions(actions, modified, defaultTarget); | - | ||||||||||||
309 | - | |||||||||||||
310 | QContinuingAnimationGroupJob *wrapperGroup = new QContinuingAnimationGroupJob(); | - | ||||||||||||
311 | - | |||||||||||||
312 | if (!dataActions.isEmpty()
| 2-91 | ||||||||||||
313 | QSet<QAbstractAnimationJob*> anims; | - | ||||||||||||
314 | for (int i = 0; i < dataActions.size()
| 91 | ||||||||||||
315 | QSmoothedAnimation *ease; | - | ||||||||||||
316 | bool isActive; | - | ||||||||||||
317 | if (!d->activeAnimations.contains(dataActions[i].property)
| 26-65 | ||||||||||||
318 | ease = new QSmoothedAnimation(d); | - | ||||||||||||
319 | d->activeAnimations.insert(dataActions[i].property, ease); | - | ||||||||||||
320 | ease->target = dataActions[i].property; | - | ||||||||||||
321 | isActive = false; | - | ||||||||||||
322 | } executed 26 times by 3 tests: else {end of block Executed by:
| 26 | ||||||||||||
323 | ease = d->activeAnimations.value(dataActions[i].property); | - | ||||||||||||
324 | isActive = true; | - | ||||||||||||
325 | } executed 65 times by 3 tests: end of block Executed by:
| 65 | ||||||||||||
326 | wrapperGroup->appendAnimation(initInstance(ease)); | - | ||||||||||||
327 | - | |||||||||||||
328 | ease->to = dataActions[i].toValue.toReal(); | - | ||||||||||||
329 | - | |||||||||||||
330 | - | |||||||||||||
331 | ease->maximumEasingTime = d->anim->maximumEasingTime; | - | ||||||||||||
332 | ease->reversingMode = d->anim->reversingMode; | - | ||||||||||||
333 | ease->velocity = d->anim->velocity; | - | ||||||||||||
334 | ease->userDuration = d->anim->userDuration; | - | ||||||||||||
335 | - | |||||||||||||
336 | ease->initialVelocity = ease->trackVelocity; | - | ||||||||||||
337 | - | |||||||||||||
338 | if (isActive
| 26-65 | ||||||||||||
339 | ease->prepareForRestart(); executed 65 times by 3 tests: ease->prepareForRestart(); Executed by:
| 65 | ||||||||||||
340 | anims.insert(ease); | - | ||||||||||||
341 | } executed 91 times by 3 tests: end of block Executed by:
| 91 | ||||||||||||
342 | - | |||||||||||||
343 | const auto copy = d->activeAnimations; | - | ||||||||||||
344 | for (QSmoothedAnimation *ease : copy) { | - | ||||||||||||
345 | if (!anims.contains(ease)
| 0-91 | ||||||||||||
346 | ease->clearTemplate(); | - | ||||||||||||
347 | d->activeAnimations.remove(ease->target); | - | ||||||||||||
348 | } never executed: end of block | 0 | ||||||||||||
349 | } executed 91 times by 3 tests: end of block Executed by:
| 91 | ||||||||||||
350 | } executed 91 times by 3 tests: end of block Executed by:
| 91 | ||||||||||||
351 | return executed 93 times by 3 tests: wrapperGroup;return wrapperGroup; Executed by:
executed 93 times by 3 tests: return wrapperGroup; Executed by:
| 93 | ||||||||||||
352 | } | - | ||||||||||||
353 | QQuickSmoothedAnimation::ReversingMode QQuickSmoothedAnimation::reversingMode() const | - | ||||||||||||
354 | { | - | ||||||||||||
355 | const QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
356 | return executed 6 times by 1 test: (QQuickSmoothedAnimation::ReversingMode) d->anim->reversingMode;return (QQuickSmoothedAnimation::ReversingMode) d->anim->reversingMode; Executed by:
executed 6 times by 1 test: return (QQuickSmoothedAnimation::ReversingMode) d->anim->reversingMode; Executed by:
| 6 | ||||||||||||
357 | } | - | ||||||||||||
358 | - | |||||||||||||
359 | void QQuickSmoothedAnimation::setReversingMode(ReversingMode m) | - | ||||||||||||
360 | { | - | ||||||||||||
361 | QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
362 | if (d->anim->reversingMode == m
| 0-4 | ||||||||||||
363 | return; never executed: return; | 0 | ||||||||||||
364 | - | |||||||||||||
365 | d->anim->reversingMode = m; | - | ||||||||||||
366 | reversingModeChanged(); | - | ||||||||||||
367 | d->updateRunningAnimations(); | - | ||||||||||||
368 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||
369 | int QQuickSmoothedAnimation::duration() const | - | ||||||||||||
370 | { | - | ||||||||||||
371 | const QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
372 | return executed 6 times by 1 test: d->anim->userDuration;return d->anim->userDuration; Executed by:
executed 6 times by 1 test: return d->anim->userDuration; Executed by:
| 6 | ||||||||||||
373 | } | - | ||||||||||||
374 | - | |||||||||||||
375 | void QQuickSmoothedAnimation::setDuration(int duration) | - | ||||||||||||
376 | { | - | ||||||||||||
377 | QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
378 | if (duration != -1
| 0-10 | ||||||||||||
379 | QQuickNumberAnimation::setDuration(duration); executed 10 times by 2 tests: QQuickNumberAnimation::setDuration(duration); Executed by:
| 10 | ||||||||||||
380 | if(duration == d->anim->userDuration
| 0-10 | ||||||||||||
381 | return; never executed: return; | 0 | ||||||||||||
382 | d->anim->userDuration = duration; | - | ||||||||||||
383 | d->updateRunningAnimations(); | - | ||||||||||||
384 | } executed 10 times by 2 tests: end of block Executed by:
| 10 | ||||||||||||
385 | - | |||||||||||||
386 | qreal QQuickSmoothedAnimation::velocity() const | - | ||||||||||||
387 | { | - | ||||||||||||
388 | const QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
389 | return executed 6 times by 1 test: d->anim->velocity;return d->anim->velocity; Executed by:
executed 6 times by 1 test: return d->anim->velocity; Executed by:
| 6 | ||||||||||||
390 | } | - | ||||||||||||
391 | void QQuickSmoothedAnimation::setVelocity(qreal v) | - | ||||||||||||
392 | { | - | ||||||||||||
393 | QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
394 | if (d->anim->velocity == v
| 6-18 | ||||||||||||
395 | return; executed 6 times by 1 test: return; Executed by:
| 6 | ||||||||||||
396 | - | |||||||||||||
397 | d->anim->velocity = v; | - | ||||||||||||
398 | velocityChanged(); | - | ||||||||||||
399 | d->updateRunningAnimations(); | - | ||||||||||||
400 | } executed 18 times by 2 tests: end of block Executed by:
| 18 | ||||||||||||
401 | int QQuickSmoothedAnimation::maximumEasingTime() const | - | ||||||||||||
402 | { | - | ||||||||||||
403 | const QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
404 | return executed 6 times by 1 test: d->anim->maximumEasingTime;return d->anim->maximumEasingTime; Executed by:
executed 6 times by 1 test: return d->anim->maximumEasingTime; Executed by:
| 6 | ||||||||||||
405 | } | - | ||||||||||||
406 | - | |||||||||||||
407 | void QQuickSmoothedAnimation::setMaximumEasingTime(int v) | - | ||||||||||||
408 | { | - | ||||||||||||
409 | QQuickSmoothedAnimationPrivate * const d = d_func(); | - | ||||||||||||
410 | if(v == d->anim->maximumEasingTime
| 0-2 | ||||||||||||
411 | return; never executed: return; | 0 | ||||||||||||
412 | d->anim->maximumEasingTime = v; | - | ||||||||||||
413 | maximumEasingTimeChanged(); | - | ||||||||||||
414 | d->updateRunningAnimations(); | - | ||||||||||||
415 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
416 | - | |||||||||||||
417 | - | |||||||||||||
418 | - | |||||||||||||
Switch to Source code | Preprocessed file |