OpenCoverage

qquickitemanimation.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickitemanimation.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7QQuickParentAnimation::QQuickParentAnimation(QObject *parent)-
8 : QQuickAnimationGroup(*(new QQuickParentAnimationPrivate), parent)-
9{-
10}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
11-
12QQuickParentAnimation::~QQuickParentAnimation()-
13{-
14}-
15QQuickItem *QQuickParentAnimation::target() const-
16{-
17 const QQuickParentAnimationPrivate * const d = d_func();-
18 return
never executed: return d->target;
d->target;
never executed: return d->target;
0
19}-
20-
21void QQuickParentAnimation::setTargetObject(QQuickItem *target)-
22{-
23 QQuickParentAnimationPrivate * const d = d_func();-
24 if (target == d->target
target == d->targetDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-2
25 return;
never executed: return;
0
26-
27 d->target = target;-
28 targetChanged();-
29}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
30QQuickItem *QQuickParentAnimation::newParent() const-
31{-
32 const QQuickParentAnimationPrivate * const d = d_func();-
33 return
never executed: return d->newParent;
d->newParent;
never executed: return d->newParent;
0
34}-
35-
36void QQuickParentAnimation::setNewParent(QQuickItem *newParent)-
37{-
38 QQuickParentAnimationPrivate * const d = d_func();-
39 if (newParent == d->newParent
newParent == d->newParentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
40 return;
never executed: return;
0
41-
42 d->newParent = newParent;-
43 newParentChanged();-
44}
never executed: end of block
0
45QQuickItem *QQuickParentAnimation::via() const-
46{-
47 const QQuickParentAnimationPrivate * const d = d_func();-
48 return
never executed: return d->via;
d->via;
never executed: return d->via;
0
49}-
50-
51void QQuickParentAnimation::setVia(QQuickItem *via)-
52{-
53 QQuickParentAnimationPrivate * const d = d_func();-
54 if (via == d->via
via == d->viaDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-2
55 return;
never executed: return;
0
56-
57 d->via = via;-
58 viaChanged();-
59}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
60-
61-
62QPointF QQuickParentAnimationPrivate::computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const-
63{-
64 switch (origin) {-
65 default
never executed: default:
:
never executed: default:
0
66 case
never executed: case QQuickItem::TopLeft:
QQuickItem::TopLeft:
never executed: case QQuickItem::TopLeft:
0
67 return
never executed: return QPointF(0, 0);
QPointF(0, 0);
never executed: return QPointF(0, 0);
0
68 case
never executed: case QQuickItem::Top:
QQuickItem::Top:
never executed: case QQuickItem::Top:
0
69 return
never executed: return QPointF(width / 2., 0);
QPointF(width / 2., 0);
never executed: return QPointF(width / 2., 0);
0
70 case
never executed: case QQuickItem::TopRight:
QQuickItem::TopRight:
never executed: case QQuickItem::TopRight:
0
71 return
never executed: return QPointF(width, 0);
QPointF(width, 0);
never executed: return QPointF(width, 0);
0
72 case
never executed: case QQuickItem::Left:
QQuickItem::Left:
never executed: case QQuickItem::Left:
0
73 return
never executed: return QPointF(0, height / 2.);
QPointF(0, height / 2.);
never executed: return QPointF(0, height / 2.);
0
74 case
executed 2 times by 1 test: case QQuickItem::Center:
Executed by:
  • tst_qquickanimations
QQuickItem::Center:
executed 2 times by 1 test: case QQuickItem::Center:
Executed by:
  • tst_qquickanimations
2
75 return
executed 2 times by 1 test: return QPointF(width / 2., height / 2.);
Executed by:
  • tst_qquickanimations
QPointF(width / 2., height / 2.);
executed 2 times by 1 test: return QPointF(width / 2., height / 2.);
Executed by:
  • tst_qquickanimations
2
76 case
never executed: case QQuickItem::Right:
QQuickItem::Right:
never executed: case QQuickItem::Right:
0
77 return
never executed: return QPointF(width, height / 2.);
QPointF(width, height / 2.);
never executed: return QPointF(width, height / 2.);
0
78 case
never executed: case QQuickItem::BottomLeft:
QQuickItem::BottomLeft:
never executed: case QQuickItem::BottomLeft:
0
79 return
never executed: return QPointF(0, height);
QPointF(0, height);
never executed: return QPointF(0, height);
0
80 case
never executed: case QQuickItem::Bottom:
QQuickItem::Bottom:
never executed: case QQuickItem::Bottom:
0
81 return
never executed: return QPointF(width / 2., height);
QPointF(width / 2., height);
never executed: return QPointF(width / 2., height);
0
82 case
never executed: case QQuickItem::BottomRight:
QQuickItem::BottomRight:
never executed: case QQuickItem::BottomRight:
0
83 return
never executed: return QPointF(width, height);
QPointF(width, height);
never executed: return QPointF(width, height);
0
84 }-
85}-
86-
87struct QQuickParentAnimationData : public QAbstractAnimationAction-
88{-
89 QQuickParentAnimationData() : reverse(false) {}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
90 ~QQuickParentAnimationData() { qDeleteAll(pc); }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
91-
92 QQuickStateActions actions;-
93-
94 bool reverse;-
95 QList<QQuickParentChange *> pc;-
96 void doAction() override-
97 {-
98 for (int ii = 0; ii < actions.count()
ii < actions.count()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
; ++ii) {
4
99 const QQuickStateAction &action = actions.at(ii);-
100 if (reverse
reverseDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-4
101 action.event->reverse();
never executed: action.event->reverse();
0
102 else-
103 action.event->execute();
executed 4 times by 1 test: action.event->execute();
Executed by:
  • tst_qquickanimations
4
104 }-
105 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
106};-
107-
108QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &actions,-
109 QQmlProperties &modified,-
110 TransitionDirection direction,-
111 QObject *defaultTarget)-
112{-
113 QQuickParentAnimationPrivate * const d = d_func();-
114-
115 QQuickParentAnimationData *data = new QQuickParentAnimationData;-
116 QQuickParentAnimationData *viaData = new QQuickParentAnimationData;-
117-
118 bool hasExplicit = false;-
119 if (d->target
d->targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& d->newParent
d->newParentDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-2
120 data->reverse = false;-
121 QQuickStateAction myAction;-
122 QQuickParentChange *pc = new QQuickParentChange;-
123 pc->setObject(d->target);-
124 pc->setParent(d->newParent);-
125 myAction.event = pc;-
126 data->pc << pc;-
127 data->actions << myAction;-
128 hasExplicit = true;-
129 if (d->via
d->viaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
130 viaData->reverse = false;-
131 QQuickStateAction myVAction;-
132 QQuickParentChange *vpc = new QQuickParentChange;-
133 vpc->setObject(d->target);-
134 vpc->setParent(d->via);-
135 myVAction.event = vpc;-
136 viaData->pc << vpc;-
137 viaData->actions << myVAction;-
138 }
never executed: end of block
0
139-
140-
141 }
never executed: end of block
0
142-
143 if (!hasExplicit
!hasExplicitDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
144 for (int i = 0; i < actions.size()
i < actions.size()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
; ++i) {
2
145 QQuickStateAction &action = actions[i];-
146 if (action.event
action.eventDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& action.event->type() == QQuickStateActionEvent::ParentChange
action.event->...::ParentChangeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
0-2
147 && (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
|| static_cast<
static_cast<QQ...) == d->targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
QQuickParentChange*>(action.event)->object() == d->target
static_cast<QQ...) == d->targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)) {
0-2
148-
149 QQuickParentChange *pc = static_cast<QQuickParentChange*>(action.event);-
150 QQuickStateAction myAction = action;-
151 data->reverse = action.reverseEvent;-
152-
153-
154-
155 if (d->newParent
d->newParentDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-2
156 QQuickParentChange *epc = new QQuickParentChange;-
157 epc->setObject(static_cast<QQuickParentChange*>(action.event)->object());-
158 epc->setParent(d->newParent);-
159 myAction.event = epc;-
160 data->pc << epc;-
161 data->actions << myAction;-
162 pc = epc;-
163 }
never executed: end of block
else {
0
164 action.actionDone = true;-
165 data->actions << myAction;-
166 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
167-
168 if (d->via
d->viaDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
169 viaData->reverse = false;-
170 QQuickStateAction myAction;-
171 QQuickParentChange *vpc = new QQuickParentChange;-
172 vpc->setObject(pc->object());-
173 vpc->setParent(d->via);-
174 myAction.event = vpc;-
175 viaData->pc << vpc;-
176 viaData->actions << myAction;-
177 QQuickStateAction dummyAction;-
178 QQuickStateAction &xAction = pc->xIsSet()
pc->xIsSet()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& i < actions.size()-1
i < actions.size()-1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
? actions[++i] : dummyAction;
0-2
179 QQuickStateAction &yAction = pc->yIsSet()
pc->yIsSet()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& i < actions.size()-1
i < actions.size()-1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
? actions[++i] : dummyAction;
0-2
180 QQuickStateAction &sAction = pc->scaleIsSet()
pc->scaleIsSet()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& i < actions.size()-1
i < actions.size()-1Description
TRUEnever evaluated
FALSEnever evaluated
? actions[++i] : dummyAction;
0-2
181 QQuickStateAction &rAction = pc->rotationIsSet()
pc->rotationIsSet()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& i < actions.size()-1
i < actions.size()-1Description
TRUEnever evaluated
FALSEnever evaluated
? actions[++i] : dummyAction;
0-2
182 QQuickItem *target = pc->object();-
183 QQuickItem *targetParent = action.reverseEvent
action.reverseEventDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
? pc->originalParent() : pc->parent();
0-2
184-
185-
186 bool ok;-
187 const QTransform &transform = targetParent->itemTransform(d->via, &ok);-
188 if (transform.type() >= QTransform::TxShear
transform.type...sform::TxShearDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
|| !ok
!okDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-2
189 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under complex transform");-
190 ok = false;-
191 }
never executed: end of block
0
192-
193 qreal scale = 1;-
194 qreal rotation = 0;-
195 bool isRotate = (
(transform.typ...orm::TxRotate)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
transform.type() == QTransform::TxRotate)
(transform.typ...orm::TxRotate)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
|| (
(transform.m11() < 0)Description
TRUEnever evaluated
FALSEnever evaluated
transform.m11() < 0)
(transform.m11() < 0)Description
TRUEnever evaluated
FALSEnever evaluated
;
0-2
196 if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& !isRotate
!isRotateDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-2
197 if (transform.m11() == transform.m22()
transform.m11(...ransform.m22()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
198 scale = transform.m11();
never executed: scale = transform.m11();
0
199 else {-
200 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under non-uniform scale");-
201 ok = false;-
202 }
never executed: end of block
0
203 } else if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& isRotate
isRotateDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
204 if (transform.m11() == transform.m22()
transform.m11(...ransform.m22()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
205 scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
executed 2 times by 1 test: scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
Executed by:
  • tst_qquickanimations
2
206 else {-
207 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under non-uniform scale");-
208 ok = false;-
209 }
never executed: end of block
0
210-
211 if (scale != 0
scale != 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
212 rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale));
executed 2 times by 1 test: rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale));
Executed by:
  • tst_qquickanimations
2
213 else {-
214 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under scale of 0");-
215 ok = false;-
216 }
never executed: end of block
0
217 }-
218-
219 const QPointF &point = transform.map(QPointF(xAction.toValue.toReal(),yAction.toValue.toReal()));-
220 qreal x = point.x();-
221 qreal y = point.y();-
222 if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& target->transformOrigin() != QQuickItem::TopLeft
target->transf...kItem::TopLeftDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
223 qreal w = target->width();-
224 qreal h = target->height();-
225 if (pc->widthIsSet()
pc->widthIsSet()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& i < actions.size() - 1
i < actions.size() - 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
226 w = actions.at(++i).toValue.toReal();
executed 2 times by 1 test: w = actions.at(++i).toValue.toReal();
Executed by:
  • tst_qquickanimations
2
227 if (pc->heightIsSet()
pc->heightIsSet()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& i < actions.size() - 1
i < actions.size() - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-2
228 h = actions.at(++i).toValue.toReal();
never executed: h = actions.at(++i).toValue.toReal();
0
229 const QPointF &transformOrigin-
230 = d->computeTransformOrigin(target->transformOrigin(), w,h);-
231 qreal tempxt = transformOrigin.x();-
232 qreal tempyt = transformOrigin.y();-
233 QTransform t;-
234 t.translate(-tempxt, -tempyt);-
235 t.rotate(rotation);-
236 t.scale(scale, scale);-
237 t.translate(tempxt, tempyt);-
238 const QPointF &offset = t.map(QPointF(0,0));-
239 x += offset.x();-
240 y += offset.y();-
241 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
242-
243 if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
244-
245 xAction.toValue = x;-
246 yAction.toValue = y;-
247 sAction.toValue = sAction.toValue.toReal() * scale;-
248 rAction.toValue = rAction.toValue.toReal() + rotation;-
249 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
250 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
251 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
252 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
253-
254 if (data->actions.count()
data->actions.count()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
255 QSequentialAnimationGroupJob *topLevelGroup = new QSequentialAnimationGroupJob;-
256 QActionAnimation *viaAction = d->via
d->viaDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
? new QActionAnimation : nullptr;
0-2
257 QActionAnimation *targetAction = new QActionAnimation;-
258-
259 QParallelAnimationGroupJob *ag = new QParallelAnimationGroupJob;-
260-
261 if (d->via
d->viaDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
262 viaAction->setAnimAction(viaData);
executed 2 times by 1 test: viaAction->setAnimAction(viaData);
Executed by:
  • tst_qquickanimations
2
263 targetAction->setAnimAction(data);-
264-
265-
266 bool valid = d->defaultProperty.isValid();-
267 QAbstractAnimationJob* anim;-
268 for (int ii = 0; ii < d->animations.count()
ii < d->animations.count()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
; ++ii) {
2
269 if (valid
validDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-2
270 d->animations.at(ii)->setDefaultTarget(d->defaultProperty);
never executed: d->animations.at(ii)->setDefaultTarget(d->defaultProperty);
0
271 anim = d->animations.at(ii)->transition(actions, modified, direction, defaultTarget);-
272 if (anim
animDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
273 ag->appendAnimation(anim);
executed 2 times by 1 test: ag->appendAnimation(anim);
Executed by:
  • tst_qquickanimations
2
274 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
275-
276-
277 bool forwards = direction == QQuickAbstractAnimation::Forward;-
278 if (forwards
forwardsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
279 topLevelGroup->appendAnimation(d->via ? viaAction : targetAction);-
280 topLevelGroup->appendAnimation(ag);-
281 if (d->via
d->viaDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-2
282 topLevelGroup->appendAnimation(targetAction);
executed 2 times by 1 test: topLevelGroup->appendAnimation(targetAction);
Executed by:
  • tst_qquickanimations
2
283 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
else {
2
284 if (d->via
d->viaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
285 topLevelGroup->appendAnimation(targetAction);
never executed: topLevelGroup->appendAnimation(targetAction);
0
286 topLevelGroup->appendAnimation(ag);-
287 topLevelGroup->appendAnimation(d->via ? viaAction : targetAction);-
288 }
never executed: end of block
0
289 return
executed 2 times by 1 test: return initInstance(topLevelGroup);
Executed by:
  • tst_qquickanimations
initInstance(topLevelGroup);
executed 2 times by 1 test: return initInstance(topLevelGroup);
Executed by:
  • tst_qquickanimations
2
290 } else {-
291 delete data;-
292 delete viaData;-
293 }
never executed: end of block
0
294 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
295}-
296QQuickAnchorAnimation::QQuickAnchorAnimation(QObject *parent)-
297: QQuickAbstractAnimation(*(new QQuickAnchorAnimationPrivate), parent)-
298{-
299}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
6
300-
301QQuickAnchorAnimation::~QQuickAnchorAnimation()-
302{-
303}-
304QQmlListProperty<QQuickItem> QQuickAnchorAnimation::targets()-
305{-
306 QQuickAnchorAnimationPrivate * const d = d_func();-
307 return
never executed: return QQmlListProperty<QQuickItem>(this, d->targets);
QQmlListProperty<QQuickItem>(this, d->targets);
never executed: return QQmlListProperty<QQuickItem>(this, d->targets);
0
308}-
309-
310-
311-
312-
313-
314-
315-
316int QQuickAnchorAnimation::duration() const-
317{-
318 const QQuickAnchorAnimationPrivate * const d = d_func();-
319 return
never executed: return d->duration;
d->duration;
never executed: return d->duration;
0
320}-
321-
322void QQuickAnchorAnimation::setDuration(int duration)-
323{-
324 if (duration < 0
duration < 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-4
325 qmlWarning(this) << tr("Cannot set a duration of < 0");-
326 return;
never executed: return;
0
327 }-
328-
329 QQuickAnchorAnimationPrivate * const d = d_func();-
330 if (d->duration == duration
d->duration == durationDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-4
331 return;
never executed: return;
0
332 d->duration = duration;-
333 durationChanged(duration);-
334}
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
4
335QEasingCurve QQuickAnchorAnimation::easing() const-
336{-
337 const QQuickAnchorAnimationPrivate * const d = d_func();-
338 return
never executed: return d->easing;
d->easing;
never executed: return d->easing;
0
339}-
340-
341void QQuickAnchorAnimation::setEasing(const QEasingCurve &e)-
342{-
343 QQuickAnchorAnimationPrivate * const d = d_func();-
344 if (d->easing == e
d->easing == eDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-2
345 return;
never executed: return;
0
346-
347 d->easing = e;-
348 easingChanged(e);-
349}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
350-
351QAbstractAnimationJob* QQuickAnchorAnimation::transition(QQuickStateActions &actions,-
352 QQmlProperties &modified,-
353 TransitionDirection direction,-
354 QObject *defaultTarget)-
355{-
356 (void)modified;;-
357 (void)defaultTarget;;-
358 QQuickAnchorAnimationPrivate * const d = d_func();-
359 QQuickAnimationPropertyUpdater *data = new QQuickAnimationPropertyUpdater;-
360 data->interpolatorType = QMetaType::QReal;-
361 data->interpolator = d->interpolator;-
362 data->reverse = direction == Backward
direction == BackwardDescription
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
? true : false;
0-12
363 data->fromSourced = false;-
364 data->fromDefined = false;-
365-
366 for (int ii = 0; ii < actions.count()
ii < actions.count()Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
; ++ii) {
10-12
367 QQuickStateAction &action = actions[ii];-
368 if (action.event
action.eventDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& action.event->type() == QQuickStateActionEvent::AnchorChanges
action.event->...:AnchorChangesDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
0-10
369 && (d->targets.isEmpty()
d->targets.isEmpty()Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
|| d->targets.contains(static_cast<QQuickAnchorChanges*>(action.event)->object())
d->targets.con...nt)->object())Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0-10
370 data->actions << static_cast<QQuickAnchorChanges*>(action.event)->additionalActions();-
371 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
372 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
373-
374 QQuickBulkValueAnimator *animator = new QQuickBulkValueAnimator;-
375 if (data->actions.count()
data->actions.count()Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
2-10
376 animator->setAnimValue(data);-
377 animator->setFromSourcedValue(&data->fromSourced);-
378 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else {
10
379 delete data;-
380 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
381-
382 animator->setDuration(d->duration);-
383 animator->setEasingCurve(d->easing);-
384 return
executed 12 times by 2 tests: return initInstance(animator);
Executed by:
  • tst_examples
  • tst_qquickanimations
initInstance(animator);
executed 12 times by 2 tests: return initInstance(animator);
Executed by:
  • tst_examples
  • tst_qquickanimations
12
385}-
386QQuickPathAnimation::QQuickPathAnimation(QObject *parent)-
387: QQuickAbstractAnimation(*(new QQuickPathAnimationPrivate), parent)-
388{-
389}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
16
390-
391QQuickPathAnimation::~QQuickPathAnimation()-
392{-
393 typedef QHash<QQuickItem*, QQuickPathAnimationAnimator* >::iterator ActiveAnimationsIt;-
394-
395 QQuickPathAnimationPrivate * const d = d_func();-
396 for (ActiveAnimationsIt it = d->activeAnimations.begin(), end = d->activeAnimations.end(); it != end
it != endDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
; ++it)
8-10
397 it.value()->clearTemplate();
executed 8 times by 1 test: it.value()->clearTemplate();
Executed by:
  • tst_qquickanimations
8
398}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
399-
400-
401-
402-
403-
404-
405-
406int QQuickPathAnimation::duration() const-
407{-
408 const QQuickPathAnimationPrivate * const d = d_func();-
409 return
executed 2 times by 1 test: return d->duration;
Executed by:
  • tst_qquickanimations
d->duration;
executed 2 times by 1 test: return d->duration;
Executed by:
  • tst_qquickanimations
2
410}-
411-
412void QQuickPathAnimation::setDuration(int duration)-
413{-
414 if (duration < 0
duration < 0Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-16
415 qmlWarning(this) << tr("Cannot set a duration of < 0");-
416 return;
never executed: return;
0
417 }-
418-
419 QQuickPathAnimationPrivate * const d = d_func();-
420 if (d->duration == duration
d->duration == durationDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-16
421 return;
never executed: return;
0
422 d->duration = duration;-
423 durationChanged(duration);-
424}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
16
425QEasingCurve QQuickPathAnimation::easing() const-
426{-
427 const QQuickPathAnimationPrivate * const d = d_func();-
428 return
executed 4 times by 2 tests: return d->easingCurve;
Executed by:
  • tst_examples
  • tst_qquickanimations
d->easingCurve;
executed 4 times by 2 tests: return d->easingCurve;
Executed by:
  • tst_examples
  • tst_qquickanimations
4
429}-
430-
431void QQuickPathAnimation::setEasing(const QEasingCurve &e)-
432{-
433 QQuickPathAnimationPrivate * const d = d_func();-
434 if (d->easingCurve == e
d->easingCurve == eDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-4
435 return;
never executed: return;
0
436-
437 d->easingCurve = e;-
438 easingChanged(e);-
439}
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
4
440-
441-
442-
443-
444-
445-
446-
447QQuickPath *QQuickPathAnimation::path() const-
448{-
449 const QQuickPathAnimationPrivate * const d = d_func();-
450 return
never executed: return d->path;
d->path;
never executed: return d->path;
0
451}-
452-
453void QQuickPathAnimation::setPath(QQuickPath *path)-
454{-
455 QQuickPathAnimationPrivate * const d = d_func();-
456 if (d->path == path
d->path == pathDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-16
457 return;
never executed: return;
0
458-
459 d->path = path;-
460 pathChanged();-
461}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
16
462-
463-
464-
465-
466-
467QQuickItem *QQuickPathAnimation::target() const-
468{-
469 const QQuickPathAnimationPrivate * const d = d_func();-
470 return
executed 2 times by 1 test: return d->target;
Executed by:
  • tst_qquickanimations
d->target;
executed 2 times by 1 test: return d->target;
Executed by:
  • tst_qquickanimations
2
471}-
472-
473void QQuickPathAnimation::setTargetObject(QQuickItem *target)-
474{-
475 QQuickPathAnimationPrivate * const d = d_func();-
476 if (d->target == target
d->target == targetDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-16
477 return;
never executed: return;
0
478-
479 d->target = target;-
480 targetChanged();-
481}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
16
482QQuickPathAnimation::Orientation QQuickPathAnimation::orientation() const-
483{-
484 const QQuickPathAnimationPrivate * const d = d_func();-
485 return
executed 4 times by 1 test: return d->orientation;
Executed by:
  • tst_qquickanimations
d->orientation;
executed 4 times by 1 test: return d->orientation;
Executed by:
  • tst_qquickanimations
4
486}-
487-
488void QQuickPathAnimation::setOrientation(Orientation orientation)-
489{-
490 QQuickPathAnimationPrivate * const d = d_func();-
491 if (d->orientation == orientation
d->orientation == orientationDescription
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-6
492 return;
never executed: return;
0
493-
494 d->orientation = orientation;-
495 orientationChanged(d->orientation);-
496}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
6
497QPointF QQuickPathAnimation::anchorPoint() const-
498{-
499 const QQuickPathAnimationPrivate * const d = d_func();-
500 return
never executed: return d->anchorPoint;
d->anchorPoint;
never executed: return d->anchorPoint;
0
501}-
502-
503void QQuickPathAnimation::setAnchorPoint(const QPointF &point)-
504{-
505 QQuickPathAnimationPrivate * const d = d_func();-
506 if (d->anchorPoint == point
d->anchorPoint == pointDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
)
0-2
507 return;
never executed: return;
0
508-
509 d->anchorPoint = point;-
510 anchorPointChanged(point);-
511}
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
512int QQuickPathAnimation::orientationEntryDuration() const-
513{-
514 const QQuickPathAnimationPrivate * const d = d_func();-
515 return
executed 2 times by 1 test: return d->entryDuration;
Executed by:
  • tst_qquickanimations
d->entryDuration;
executed 2 times by 1 test: return d->entryDuration;
Executed by:
  • tst_qquickanimations
2
516}-
517-
518void QQuickPathAnimation::setOrientationEntryDuration(int duration)-
519{-
520 QQuickPathAnimationPrivate * const d = d_func();-
521 if (d->entryDuration == duration
d->entryDuration == durationDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-2
522 return;
never executed: return;
0
523 d->entryDuration = duration;-
524 orientationEntryDurationChanged(duration);-
525}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
526int QQuickPathAnimation::orientationExitDuration() const-
527{-
528 const QQuickPathAnimationPrivate * const d = d_func();-
529 return
executed 2 times by 1 test: return d->exitDuration;
Executed by:
  • tst_qquickanimations
d->exitDuration;
executed 2 times by 1 test: return d->exitDuration;
Executed by:
  • tst_qquickanimations
2
530}-
531-
532void QQuickPathAnimation::setOrientationExitDuration(int duration)-
533{-
534 QQuickPathAnimationPrivate * const d = d_func();-
535 if (d->exitDuration == duration
d->exitDuration == durationDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-2
536 return;
never executed: return;
0
537 d->exitDuration = duration;-
538 orientationExitDurationChanged(duration);-
539}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
540qreal QQuickPathAnimation::endRotation() const-
541{-
542 const QQuickPathAnimationPrivate * const d = d_func();-
543 return
executed 2 times by 1 test: return d->endRotation.isNull ? qreal(0) : d->endRotation.value;
Executed by:
  • tst_qquickanimations
d->endRotation.isNull ? qreal(0) : d->endRotation.value;
executed 2 times by 1 test: return d->endRotation.isNull ? qreal(0) : d->endRotation.value;
Executed by:
  • tst_qquickanimations
2
544}-
545-
546void QQuickPathAnimation::setEndRotation(qreal rotation)-
547{-
548 QQuickPathAnimationPrivate * const d = d_func();-
549 if (!d->endRotation.isNull
!d->endRotation.isNullDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& d->endRotation == rotation
d->endRotation == rotationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-2
550 return;
never executed: return;
0
551-
552 d->endRotation = rotation;-
553 endRotationChanged(d->endRotation);-
554}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
555-
556QAbstractAnimationJob* QQuickPathAnimation::transition(QQuickStateActions &actions,-
557 QQmlProperties &modified,-
558 TransitionDirection direction,-
559 QObject *defaultTarget)-
560{-
561 QQuickPathAnimationPrivate * const d = d_func();-
562-
563 QQuickItem *target = d->target
d->targetDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
? d->target : qobject_cast<QQuickItem*>(defaultTarget);
0-24
564-
565 QQuickPathAnimationUpdater prevData;-
566 bool havePrevData = false;-
567 if (d->activeAnimations.contains(target)
d->activeAnima...ntains(target)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
8-16
568 havePrevData = true;-
569 prevData = *d->activeAnimations[target]->pathUpdater();-
570 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
571-
572 for (auto it = d->activeAnimations.begin(); it != d->activeAnimations.end()
it != d->activ...imations.end()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
;) {
8-24
573 QQuickPathAnimationAnimator *anim = it.value();-
574 if (anim->state() == QAbstractAnimationJob::Stopped
anim->state() ...onJob::StoppedDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-8
575 anim->clearTemplate();-
576 it = d->activeAnimations.erase(it);-
577 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
else {
8
578 ++it;-
579 }
never executed: end of block
0
580 }-
581-
582 QQuickPathAnimationUpdater *data = new QQuickPathAnimationUpdater();-
583 QQuickPathAnimationAnimator *pa = new QQuickPathAnimationAnimator(d);-
584-
585 d->activeAnimations[target] = pa;-
586-
587 data->orientation = d->orientation;-
588 data->anchorPoint = d->anchorPoint;-
589 data->entryInterval = d->duration
d->durationDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
? qreal(d->entryDuration) / d->duration : qreal(0);
0-24
590 data->exitInterval = d->duration
d->durationDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
? qreal(d->exitDuration) / d->duration : qreal(0);
0-24
591 data->endRotation = d->endRotation;-
592 data->reverse = direction == Backward
direction == BackwardDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
? true : false;
2-22
593 data->fromSourced = false;-
594 data->fromDefined = (d->path
d->pathDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& d->path->hasStartX()
d->path->hasStartX()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& d->path->hasStartY()
d->path->hasStartY()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) ? true : false;
0-24
595 data->toDefined = d->path
d->pathDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
? true : false;
0-24
596 int origModifiedSize = modified.count();-
597-
598 for (int i = 0; i < actions.count()
i < actions.count()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
; ++i) {
8-24
599 QQuickStateAction &action = actions[i];-
600 if (action.event
action.eventDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-8
601 continue;
never executed: continue;
0
602 if (action.specifiedObject == target
action.specifi...ject == targetDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& action.property.name() == QLatin1String("x")
action.propert...in1String("x")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-8
603 data->toX = action.toValue.toReal();-
604 modified << action.property;-
605 action.fromValue = action.toValue;-
606 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
607 if (action.specifiedObject == target
action.specifi...ject == targetDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& action.property.name() == QLatin1String("y")
action.propert...in1String("y")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-8
608 data->toY = action.toValue.toReal();-
609 modified << action.property;-
610 action.fromValue = action.toValue;-
611 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
612 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
613-
614 if (target
targetDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& d->path
d->pathDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&&
0-24
615 (modified.count() > origModifiedSize
modified.count...igModifiedSizeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
|| data->toDefined
data->toDefinedDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
)) {
0-20
616 data->target = target;-
617 data->path = d->path;-
618 data->path->invalidateSequentialHistory();-
619-
620 if (havePrevData
havePrevDataDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
8-16
621-
622 data->startRotation = prevData.startRotation;-
623-
624-
625 if ((data->reverse
data->reverseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimations
|| prevData.reverse
prevData.reverseDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimations
) && prevData.currentV > 0
prevData.currentV > 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& prevData.currentV < 1
prevData.currentV < 1Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-6
626 if (!data->fromDefined
!data->fromDefinedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !data->toDefined
!data->toDefinedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !prevData.painterPath.isEmpty()
!prevData.pain...Path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
627 QPointF pathPos = QQuickPath::sequentialPointAt(prevData.painterPath, prevData.pathLength, prevData.attributePoints, prevData.prevBez, prevData.currentV);-
628 if (!prevData.anchorPoint.isNull()
!prevData.anchorPoint.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
629 pathPos -= prevData.anchorPoint;
never executed: pathPos -= prevData.anchorPoint;
0
630 if (pathPos == data->target->position()
pathPos == dat...et->position()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
631 data->painterPath = prevData.painterPath;-
632 data->toDefined = data->fromDefined = data->fromSourced = true;-
633 data->prevBez.isValid = false;-
634 data->interruptStart = prevData.currentV;-
635 data->startRotation = prevData.startRotation;-
636 data->pathLength = prevData.pathLength;-
637 data->attributePoints = prevData.attributePoints;-
638 }
never executed: end of block
0
639 }
never executed: end of block
0
640 }
never executed: end of block
0
641 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
642 pa->setFromSourcedValue(&data->fromSourced);-
643 pa->setAnimValue(data);-
644 pa->setDuration(d->duration);-
645 pa->setEasingCurve(d->easingCurve);-
646 return
executed 24 times by 2 tests: return initInstance(pa);
Executed by:
  • tst_examples
  • tst_qquickanimations
initInstance(pa);
executed 24 times by 2 tests: return initInstance(pa);
Executed by:
  • tst_examples
  • tst_qquickanimations
24
647 } else {-
648 pa->setFromSourcedValue(nullptr);-
649 pa->setAnimValue(nullptr);-
650 delete pa;-
651 delete data;-
652 }
never executed: end of block
0
653 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
654}-
655-
656void QQuickPathAnimationUpdater::setValue(qreal v)-
657{-
658 v = qMin(qMax(v, (qreal)0.0), (qreal)1.0);;-
659-
660 if (interruptStart.isValid()
interruptStart.isValid()Description
TRUEnever evaluated
FALSEevaluated 287 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-287
661 if (reverse
reverseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
662 v = 1 - v;
never executed: v = 1 - v;
0
663 qreal end = reverse
reverseDescription
TRUEnever evaluated
FALSEnever evaluated
? 0.0 : 1.0;
0
664 v = interruptStart + v * (end-interruptStart);-
665 }
never executed: end of block
0
666 currentV = v;-
667 bool atStart = ((reverse
reverseDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 247 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& v == 1.0
v == 1.0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickanimations
) || (!reverse
!reverseDescription
TRUEevaluated 247 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& v == 0.0
v == 0.0Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 220 times by 1 test
Evaluated by:
  • tst_qquickanimations
));
2-247
668 if (!fromSourced
!fromSourcedDescription
TRUEevaluated 170 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 117 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& (!fromDefined
!fromDefinedDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquickanimations
|| !toDefined
!toDefinedDescription
TRUEnever evaluated
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquickanimations
)) {
0-170
669 qreal startX = reverse
reverseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
? toX + anchorPoint.x() : target->x() + anchorPoint.x();
2-8
670 qreal startY = reverse
reverseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
? toY + anchorPoint.y() : target->y() + anchorPoint.y();
2-8
671 qreal endX = reverse
reverseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
? target->x() + anchorPoint.x() : toX + anchorPoint.x();
2-8
672 qreal endY = reverse
reverseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
? target->y() + anchorPoint.y() : toY + anchorPoint.y();
2-8
673-
674 prevBez.isValid = false;-
675 painterPath = path->createPath(QPointF(startX, startY), QPointF(endX, endY), QStringList(), pathLength, attributePoints);-
676 fromSourced = true;-
677 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
10
678-
679 qreal angle;-
680 bool fixed = orientation == QQuickPathAnimation::Fixed;-
681 QPointF currentPos = !painterPath.isEmpty()
!painterPath.isEmpty()Description
TRUEevaluated 127 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquickanimations
? path->sequentialPointAt(painterPath, pathLength, attributePoints, prevBez, v, fixed ? nullptr : &angle) : path->sequentialPointAt(v, fixed ? nullptr : &angle);
127-160
682-
683-
684 if (!anchorPoint.isNull()
!anchorPoint.isNull()Description
TRUEnever evaluated
FALSEevaluated 287 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-287
685 currentPos -= anchorPoint;-
686 if (atStart
atStartDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
687 if (!anchorPoint.isNull()
!anchorPoint.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
&& !fixed
!fixedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
688 target->setTransformOriginPoint(anchorPoint);
never executed: target->setTransformOriginPoint(anchorPoint);
0
689 }
never executed: end of block
0
690 }
never executed: end of block
0
691-
692 target->setPosition(currentPos);-
693-
694-
695 if (!fixed
!fixedDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 275 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
12-275
696 switch (orientation) {-
697 case
executed 12 times by 1 test: case QQuickPathAnimation::RightFirst:
Executed by:
  • tst_qquickanimations
QQuickPathAnimation::RightFirst:
executed 12 times by 1 test: case QQuickPathAnimation::RightFirst:
Executed by:
  • tst_qquickanimations
12
698 angle = -angle;-
699 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qquickanimations
12
700 case
never executed: case QQuickPathAnimation::TopFirst:
QQuickPathAnimation::TopFirst:
never executed: case QQuickPathAnimation::TopFirst:
0
701 angle = -angle + 90;-
702 break;
never executed: break;
0
703 case
never executed: case QQuickPathAnimation::LeftFirst:
QQuickPathAnimation::LeftFirst:
never executed: case QQuickPathAnimation::LeftFirst:
0
704 angle = -angle + 180;-
705 break;
never executed: break;
0
706 case
never executed: case QQuickPathAnimation::BottomFirst:
QQuickPathAnimation::BottomFirst:
never executed: case QQuickPathAnimation::BottomFirst:
0
707 angle = -angle + 270;-
708 break;
never executed: break;
0
709 default
never executed: default:
:
never executed: default:
0
710 angle = 0;-
711 break;
never executed: break;
0
712 }-
713-
714 if (atStart
atStartDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& !reverse
!reverseDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-8
715 startRotation = target->rotation();-
716-
717-
718 qreal diff = angle - startRotation;-
719 while (diff > 180.0
diff > 180.0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-4
720 startRotation.value += 360.0;-
721 diff -= 360.0;-
722 }
never executed: end of block
0
723 while (diff < -180.0
diff < -180.0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
2-4
724 startRotation.value -= 360.0;-
725 diff += 360.0;-
726 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
727 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
728-
729-
730-
731 if (startRotation.isValid()
startRotation.isValid()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-12
732 if (reverse
reverseDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& v == 0.0
v == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0-12
733 angle = startRotation;
never executed: angle = startRotation;
0
734 else if (v < entryInterval
v < entryIntervalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
2-10
735 angle = angle * v / entryInterval + startRotation * (entryInterval - v) / entryInterval;
executed 2 times by 1 test: angle = angle * v / entryInterval + startRotation * (entryInterval - v) / entryInterval;
Executed by:
  • tst_qquickanimations
2
736 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
12
737 if (endRotation.isValid()
endRotation.isValid()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
6
738 qreal exitStart = 1 - entryInterval;-
739 if (!reverse
!reverseDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
&& v == 1.0
v == 1.0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-6
740 angle = endRotation;
executed 2 times by 1 test: angle = endRotation;
Executed by:
  • tst_qquickanimations
2
741 else if (v > exitStart
v > exitStartDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-4
742 angle = endRotation * (v - exitStart) / exitInterval + angle * (exitInterval - (v - exitStart)) / exitInterval;
never executed: angle = endRotation * (v - exitStart) / exitInterval + angle * (exitInterval - (v - exitStart)) / exitInterval;
0
743 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
6
744 target->setRotation(angle);-
745 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
12
746-
747-
748-
749-
750-
751-
752-
753 if ((reverse
reverseDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 247 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& v == 0.0
v == 0.0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickanimations
) || (!reverse
!reverseDescription
TRUEevaluated 247 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& v == 1.0
v == 1.0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 223 times by 1 test
Evaluated by:
  • tst_qquickanimations
)) {
2-247
754 if (!anchorPoint.isNull()
!anchorPoint.isNull()Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& !fixed
!fixedDescription
TRUEnever evaluated
FALSEnever evaluated
&& qFuzzyIsNull(angle)
qFuzzyIsNull(angle)Description
TRUEnever evaluated
FALSEnever evaluated
)
0-26
755 target->setTransformOriginPoint(QPointF());
never executed: target->setTransformOriginPoint(QPointF());
0
756 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
26
757}
executed 287 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
287
758-
759QQuickPathAnimationAnimator::QQuickPathAnimationAnimator(QQuickPathAnimationPrivate *priv)-
760 : animationTemplate(priv)-
761{-
762}
executed 24 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
24
763-
764QQuickPathAnimationAnimator::~QQuickPathAnimationAnimator()-
765{-
766 if (animationTemplate
animationTemplateDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickanimations
&& pathUpdater()
pathUpdater()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-14
767 QHash<QQuickItem*, QQuickPathAnimationAnimator* >::iterator it =-
768 animationTemplate->activeAnimations.find(pathUpdater()->target);-
769 if (it != animationTemplate->activeAnimations.end()
it != animatio...imations.end()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& it.value() == this
it.value() == thisDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-2
770 animationTemplate->activeAnimations.erase(it);
executed 2 times by 1 test: animationTemplate->activeAnimations.erase(it);
Executed by:
  • tst_examples
2
771 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
772}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
16
773-
774-
775-
776-
777-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0