graphicsview/qgraphicsitemanimation.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8class QGraphicsItemAnimationPrivate -
9{ -
10public: -
11 inline QGraphicsItemAnimationPrivate() -
12 : q(0), timeLine(0), item(0), step(0) -
13 { }
executed: }
Execution Count:6
6
14 -
15 QGraphicsItemAnimation *q; -
16 -
17 QPointer<QTimeLine> timeLine; -
18 QGraphicsItem *item; -
19 -
20 QPointF startPos; -
21 QMatrix startMatrix; -
22 -
23 qreal step; -
24 -
25 struct Pair { -
26 Pair(qreal a, qreal b) : step(a), value(b) {}
executed: }
Execution Count:41
41
27 bool operator <(const Pair &other) const -
28 { return step < other.step; }
executed: return step < other.step;
Execution Count:42
42
29 bool operator==(const Pair &other) const -
30 { return step == other.step; }
never executed: return step == other.step;
0
31 qreal step; -
32 qreal value; -
33 }; -
34 QList<Pair> xPosition; -
35 QList<Pair> yPosition; -
36 QList<Pair> rotation; -
37 QList<Pair> verticalScale; -
38 QList<Pair> horizontalScale; -
39 QList<Pair> verticalShear; -
40 QList<Pair> horizontalShear; -
41 QList<Pair> xTranslation; -
42 QList<Pair> yTranslation; -
43 -
44 qreal linearValueForStep(qreal step, QList<Pair> *source, qreal defaultValue = 0); -
45 void insertUniquePair(qreal step, qreal value, QList<Pair> *binList, const char* method); -
46}; -
47 -
48qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, QList<Pair> *source, qreal defaultValue) -
49{ -
50 if (source->isEmpty())
evaluated: source->isEmpty()
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:57
57-63
51 return defaultValue;
executed: return defaultValue;
Execution Count:63
63
52 step = qMin<qreal>(qMax<qreal>(step, 0), 1); -
53 -
54 if (step == 1)
evaluated: step == 1
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:50
7-50
55 return source->last().value;
executed: return source->last().value;
Execution Count:7
7
56 -
57 qreal stepBefore = 0; -
58 qreal stepAfter = 1; -
59 qreal valueBefore = source->first().step == 0 ? source->first().value : defaultValue;
partially evaluated: source->first().step == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:50
0-50
60 qreal valueAfter = source->last().value; -
61 -
62 -
63 for (int i = 0; i < source->size() && step >= source->at(i).step; ++i) {
partially evaluated: i < source->size()
TRUEFALSE
yes
Evaluation Count:50
no
Evaluation Count:0
partially evaluated: step >= source->at(i).step
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:50
0-50
64 stepBefore = source->at(i).step; -
65 valueBefore = source->at(i).value; -
66 }
never executed: }
0
67 -
68 -
69 for (int j = source->size() - 1; j >= 0 && step < source->at(j).step; --j) {
evaluated: j >= 0
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:50
partially evaluated: step < source->at(j).step
TRUEFALSE
yes
Evaluation Count:50
no
Evaluation Count:0
0-50
70 stepAfter = source->at(j).step; -
71 valueAfter = source->at(j).value; -
72 }
executed: }
Execution Count:50
50
73 -
74 -
75 return valueBefore + (valueAfter - valueBefore) * ((step - stepBefore) / (stepAfter - stepBefore));
executed: return valueBefore + (valueAfter - valueBefore) * ((step - stepBefore) / (stepAfter - stepBefore));
Execution Count:50
50
76} -
77 -
78void QGraphicsItemAnimationPrivate::insertUniquePair(qreal step, qreal value, QList<Pair> *binList, const char* method) -
79{ -
80 if (step < 0.0 || step > 1.0) {
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
evaluated: step > 1.0
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:41
0-43
81 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 171, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::%s: invalid step = %f", method, step); -
82 return;
executed: return;
Execution Count:2
2
83 } -
84 -
85 Pair pair(step, value); -
86 -
87 QList<Pair>::iterator result = qBinaryFind(binList->begin(), binList->end(), pair); -
88 if (result != binList->end())
evaluated: result != binList->end()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:23
18-23
89 result->value = value;
executed: result->value = value;
Execution Count:18
18
90 else { -
91 *binList << pair; -
92 qSort(binList->begin(), binList->end()); -
93 }
executed: }
Execution Count:23
23
94} -
95 -
96 -
97 -
98 -
99QGraphicsItemAnimation::QGraphicsItemAnimation(QObject *parent) -
100 : QObject(parent), d(new QGraphicsItemAnimationPrivate) -
101{ -
102 d->q = this; -
103}
executed: }
Execution Count:6
6
104 -
105 -
106 -
107 -
108QGraphicsItemAnimation::~QGraphicsItemAnimation() -
109{ -
110 delete d; -
111}
executed: }
Execution Count:6
6
112 -
113 -
114 -
115 -
116 -
117 -
118QGraphicsItem *QGraphicsItemAnimation::item() const -
119{ -
120 return d->item;
executed: return d->item;
Execution Count:1
1
121} -
122 -
123 -
124 -
125 -
126 -
127 -
128void QGraphicsItemAnimation::setItem(QGraphicsItem *item) -
129{ -
130 d->item = item; -
131 d->startPos = d->item->pos(); -
132}
never executed: }
0
133 -
134 -
135 -
136 -
137 -
138 -
139 -
140QTimeLine *QGraphicsItemAnimation::timeLine() const -
141{ -
142 return d->timeLine;
executed: return d->timeLine;
Execution Count:7
7
143} -
144 -
145 -
146 -
147 -
148 -
149 -
150 -
151void QGraphicsItemAnimation::setTimeLine(QTimeLine *timeLine) -
152{ -
153 if (d->timeLine == timeLine)
evaluated: d->timeLine == timeLine
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
154 return;
executed: return;
Execution Count:1
1
155 if (d->timeLine)
evaluated: d->timeLine
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
156 delete d->timeLine;
executed: delete d->timeLine;
Execution Count:1
1
157 if (!timeLine)
evaluated: !timeLine
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
158 return;
executed: return;
Execution Count:1
1
159 d->timeLine = timeLine; -
160 connect(timeLine, "2""valueChanged(qreal)", this, "1""setStep(qreal)"); -
161}
executed: }
Execution Count:2
2
162 -
163 -
164 -
165 -
166 -
167 -
168QPointF QGraphicsItemAnimation::posAt(qreal step) const -
169{ -
170 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48
evaluated: step > 1.0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:47
0-48
171 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 261, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::posAt: invalid step = %f", step);
executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 261, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::posAt: invalid step = %f", step);
Execution Count:1
1
172 -
173 return QPointF(d->linearValueForStep(step, &d->xPosition, d->startPos.x()), 48
174 d->linearValueForStep(step, &d->yPosition, d->startPos.y()));
executed: return QPointF(d->linearValueForStep(step, &d->xPosition, d->startPos.x()), d->linearValueForStep(step, &d->yPosition, d->startPos.y()));
Execution Count:48
48
175} -
176void QGraphicsItemAnimation::setPosAt(qreal step, const QPointF &pos) -
177{ -
178 d->insertUniquePair(step, pos.x(), &d->xPosition, "setPosAt"); -
179 d->insertUniquePair(step, pos.y(), &d->yPosition, "setPosAt"); -
180}
executed: }
Execution Count:7
7
181 -
182 -
183 -
184 -
185 -
186 -
187QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::posList() const -
188{ -
189 QList<QPair<qreal, QPointF> > list; -
190 for (int i = 0; i < d->xPosition.size(); ++i)
evaluated: i < d->xPosition.size()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:6
6-9
191 list << QPair<qreal, QPointF>(d->xPosition.at(i).step, QPointF(d->xPosition.at(i).value, d->yPosition.at(i).value));
executed: list << QPair<qreal, QPointF>(d->xPosition.at(i).step, QPointF(d->xPosition.at(i).value, d->yPosition.at(i).value));
Execution Count:9
9
192 -
193 return list;
executed: return list;
Execution Count:6
6
194} -
195 -
196 -
197 -
198 -
199QMatrix QGraphicsItemAnimation::matrixAt(qreal step) const -
200{ -
201 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
202 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 300, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::matrixAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 300, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::matrixAt: invalid step = %f", step);
0
203 -
204 QMatrix matrix; -
205 if (!d->rotation.isEmpty())
partially evaluated: !d->rotation.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
206 matrix.rotate(rotationAt(step));
never executed: matrix.rotate(rotationAt(step));
0
207 if (!d->verticalScale.isEmpty())
partially evaluated: !d->verticalScale.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
208 matrix.scale(horizontalScaleAt(step), verticalScaleAt(step));
never executed: matrix.scale(horizontalScaleAt(step), verticalScaleAt(step));
0
209 if (!d->verticalShear.isEmpty())
partially evaluated: !d->verticalShear.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
210 matrix.shear(horizontalShearAt(step), verticalShearAt(step));
never executed: matrix.shear(horizontalShearAt(step), verticalShearAt(step));
0
211 if (!d->xTranslation.isEmpty())
partially evaluated: !d->xTranslation.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
212 matrix.translate(xTranslationAt(step), yTranslationAt(step));
never executed: matrix.translate(xTranslationAt(step), yTranslationAt(step));
0
213 return matrix;
executed: return matrix;
Execution Count:3
3
214} -
215 -
216 -
217 -
218 -
219 -
220 -
221qreal QGraphicsItemAnimation::rotationAt(qreal step) const -
222{ -
223 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
224 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 322, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::rotationAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 322, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::rotationAt: invalid step = %f", step);
0
225 -
226 return d->linearValueForStep(step, &d->rotation);
executed: return d->linearValueForStep(step, &d->rotation);
Execution Count:14
14
227} -
228 -
229 -
230 -
231 -
232 -
233 -
234void QGraphicsItemAnimation::setRotationAt(qreal step, qreal angle) -
235{ -
236 d->insertUniquePair(step, angle, &d->rotation, "setRotationAt"); -
237}
executed: }
Execution Count:5
5
238 -
239 -
240 -
241 -
242 -
243 -
244QList<QPair<qreal, qreal> > QGraphicsItemAnimation::rotationList() const -
245{ -
246 QList<QPair<qreal, qreal> > list; -
247 for (int i = 0; i < d->rotation.size(); ++i)
evaluated: i < d->rotation.size()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5
248 list << QPair<qreal, qreal>(d->rotation.at(i).step, d->rotation.at(i).value);
executed: list << QPair<qreal, qreal>(d->rotation.at(i).step, d->rotation.at(i).value);
Execution Count:5
5
249 -
250 return list;
executed: return list;
Execution Count:5
5
251} -
252 -
253 -
254 -
255 -
256 -
257 -
258qreal QGraphicsItemAnimation::xTranslationAt(qreal step) const -
259{ -
260 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
261 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 359, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::xTranslationAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 359, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::xTranslationAt: invalid step = %f", step);
0
262 -
263 return d->linearValueForStep(step, &d->xTranslation);
executed: return d->linearValueForStep(step, &d->xTranslation);
Execution Count:3
3
264} -
265 -
266 -
267 -
268 -
269 -
270 -
271qreal QGraphicsItemAnimation::yTranslationAt(qreal step) const -
272{ -
273 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
274 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 372, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::yTranslationAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 372, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::yTranslationAt: invalid step = %f", step);
0
275 -
276 return d->linearValueForStep(step, &d->yTranslation);
executed: return d->linearValueForStep(step, &d->yTranslation);
Execution Count:3
3
277} -
278 -
279 -
280 -
281 -
282 -
283 -
284 -
285void QGraphicsItemAnimation::setTranslationAt(qreal step, qreal dx, qreal dy) -
286{ -
287 d->insertUniquePair(step, dx, &d->xTranslation, "setTranslationAt"); -
288 d->insertUniquePair(step, dy, &d->yTranslation, "setTranslationAt"); -
289}
executed: }
Execution Count:4
4
290 -
291 -
292 -
293 -
294 -
295 -
296QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::translationList() const -
297{ -
298 QList<QPair<qreal, QPointF> > list; -
299 for (int i = 0; i < d->xTranslation.size(); ++i)
evaluated: i < d->xTranslation.size()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5
300 list << QPair<qreal, QPointF>(d->xTranslation.at(i).step, QPointF(d->xTranslation.at(i).value, d->yTranslation.at(i).value));
executed: list << QPair<qreal, QPointF>(d->xTranslation.at(i).step, QPointF(d->xTranslation.at(i).value, d->yTranslation.at(i).value));
Execution Count:5
5
301 -
302 return list;
executed: return list;
Execution Count:5
5
303} -
304 -
305 -
306 -
307 -
308 -
309 -
310qreal QGraphicsItemAnimation::verticalScaleAt(qreal step) const -
311{ -
312 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
313 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 411, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::verticalScaleAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 411, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::verticalScaleAt: invalid step = %f", step);
0
314 -
315 return d->linearValueForStep(step, &d->verticalScale, 1);
executed: return d->linearValueForStep(step, &d->verticalScale, 1);
Execution Count:1
1
316} -
317 -
318 -
319 -
320 -
321 -
322 -
323qreal QGraphicsItemAnimation::horizontalScaleAt(qreal step) const -
324{ -
325 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
326 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 424, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::horizontalScaleAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 424, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::horizontalScaleAt: invalid step = %f", step);
0
327 -
328 return d->linearValueForStep(step, &d->horizontalScale, 1);
executed: return d->linearValueForStep(step, &d->horizontalScale, 1);
Execution Count:1
1
329} -
330 -
331 -
332 -
333 -
334 -
335 -
336 -
337void QGraphicsItemAnimation::setScaleAt(qreal step, qreal sx, qreal sy) -
338{ -
339 d->insertUniquePair(step, sx, &d->horizontalScale, "setScaleAt"); -
340 d->insertUniquePair(step, sy, &d->verticalScale, "setScaleAt"); -
341}
executed: }
Execution Count:4
4
342 -
343 -
344 -
345 -
346 -
347 -
348QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::scaleList() const -
349{ -
350 QList<QPair<qreal, QPointF> > list; -
351 for (int i = 0; i < d->horizontalScale.size(); ++i)
evaluated: i < d->horizontalScale.size()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5
352 list << QPair<qreal, QPointF>(d->horizontalScale.at(i).step, QPointF(d->horizontalScale.at(i).value, d->verticalScale.at(i).value));
executed: list << QPair<qreal, QPointF>(d->horizontalScale.at(i).step, QPointF(d->horizontalScale.at(i).value, d->verticalScale.at(i).value));
Execution Count:5
5
353 -
354 return list;
executed: return list;
Execution Count:5
5
355} -
356 -
357 -
358 -
359 -
360 -
361 -
362qreal QGraphicsItemAnimation::verticalShearAt(qreal step) const -
363{ -
364 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
365 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 463, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::verticalShearAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 463, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::verticalShearAt: invalid step = %f", step);
0
366 -
367 return d->linearValueForStep(step, &d->verticalShear, 0);
executed: return d->linearValueForStep(step, &d->verticalShear, 0);
Execution Count:1
1
368} -
369 -
370 -
371 -
372 -
373 -
374 -
375qreal QGraphicsItemAnimation::horizontalShearAt(qreal step) const -
376{ -
377 if (step < 0.0 || step > 1.0)
partially evaluated: step < 0.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: step > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
378 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 476, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::horizontalShearAt: invalid step = %f", step);
never executed: QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 476, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::horizontalShearAt: invalid step = %f", step);
0
379 -
380 return d->linearValueForStep(step, &d->horizontalShear, 0);
executed: return d->linearValueForStep(step, &d->horizontalShear, 0);
Execution Count:1
1
381} -
382 -
383 -
384 -
385 -
386 -
387 -
388 -
389void QGraphicsItemAnimation::setShearAt(qreal step, qreal sh, qreal sv) -
390{ -
391 d->insertUniquePair(step, sh, &d->horizontalShear, "setShearAt"); -
392 d->insertUniquePair(step, sv, &d->verticalShear, "setShearAt"); -
393}
executed: }
Execution Count:4
4
394 -
395 -
396 -
397 -
398 -
399 -
400QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::shearList() const -
401{ -
402 QList<QPair<qreal, QPointF> > list; -
403 for (int i = 0; i < d->horizontalShear.size(); ++i)
evaluated: i < d->horizontalShear.size()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5
404 list << QPair<qreal, QPointF>(d->horizontalShear.at(i).step, QPointF(d->horizontalShear.at(i).value, d->verticalShear.at(i).value));
executed: list << QPair<qreal, QPointF>(d->horizontalShear.at(i).step, QPointF(d->horizontalShear.at(i).value, d->verticalShear.at(i).value));
Execution Count:5
5
405 -
406 return list;
executed: return list;
Execution Count:5
5
407} -
408 -
409 -
410 -
411 -
412 -
413void QGraphicsItemAnimation::clear() -
414{ -
415 d->xPosition.clear(); -
416 d->yPosition.clear(); -
417 d->rotation.clear(); -
418 d->verticalScale.clear(); -
419 d->horizontalScale.clear(); -
420 d->verticalShear.clear(); -
421 d->horizontalShear.clear(); -
422 d->xTranslation.clear(); -
423 d->yTranslation.clear(); -
424}
executed: }
Execution Count:1
1
425 -
426 -
427 -
428 -
429 -
430 -
431 -
432void QGraphicsItemAnimation::setStep(qreal x) -
433{ -
434 if (x < 0.0 || x > 1.0) {
never evaluated: x < 0.0
never evaluated: x > 1.0
0
435 QMessageLogger("graphicsview/qgraphicsitemanimation.cpp", 533, __PRETTY_FUNCTION__).warning("QGraphicsItemAnimation::setStep: invalid step = %f", x); -
436 return;
never executed: return;
0
437 } -
438 -
439 beforeAnimationStep(x); -
440 -
441 d->step = x; -
442 if (d->item) {
never evaluated: d->item
0
443 if (!d->xPosition.isEmpty() || !d->yPosition.isEmpty())
never evaluated: !d->xPosition.isEmpty()
never evaluated: !d->yPosition.isEmpty()
0
444 d->item->setPos(posAt(x));
never executed: d->item->setPos(posAt(x));
0
445 if (!d->rotation.isEmpty()
never evaluated: !d->rotation.isEmpty()
0
446 || !d->verticalScale.isEmpty()
never evaluated: !d->verticalScale.isEmpty()
0
447 || !d->horizontalScale.isEmpty()
never evaluated: !d->horizontalScale.isEmpty()
0
448 || !d->verticalShear.isEmpty()
never evaluated: !d->verticalShear.isEmpty()
0
449 || !d->horizontalShear.isEmpty()
never evaluated: !d->horizontalShear.isEmpty()
0
450 || !d->xTranslation.isEmpty()
never evaluated: !d->xTranslation.isEmpty()
0
451 || !d->yTranslation.isEmpty()) {
never evaluated: !d->yTranslation.isEmpty()
0
452 d->item->setMatrix(d->startMatrix * matrixAt(x)); -
453 }
never executed: }
0
454 }
never executed: }
0
455 -
456 afterAnimationStep(x); -
457}
never executed: }
0
458void QGraphicsItemAnimation::reset() -
459{ -
460 if (!d->item)
never evaluated: !d->item
0
461 return;
never executed: return;
0
462 d->startPos = d->item->pos(); -
463 d->startMatrix = d->item->matrix(); -
464}
never executed: }
0
465void QGraphicsItemAnimation::beforeAnimationStep(qreal step) -
466{ -
467 (void)step;; -
468}
never executed: }
0
469void QGraphicsItemAnimation::afterAnimationStep(qreal step) -
470{ -
471 (void)step;; -
472}
never executed: }
0
473 -
474 -
475 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial