OpenCoverage

qquickstateoperations.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickstateoperations.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6class QQuickParentChangePrivate : public QQuickStateOperationPrivate-
7{-
8 inline QQuickParentChange* q_func() { return static_cast<QQuickParentChange *>(q_ptr); } inline const QQuickParentChange* q_func() const { return static_cast<const QQuickParentChange *>(q_ptr); } friend class QQuickParentChange;-
9public:-
10 QQuickParentChangePrivate() : target(nullptr), parent(nullptr), origParent(nullptr), origStackBefore(nullptr),-
11 rewindParent(nullptr), rewindStackBefore(nullptr) {}
executed 124 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
124
12-
13 QQuickItem *target;-
14 QPointer<QQuickItem> parent;-
15 QPointer<QQuickItem> origParent;-
16 QPointer<QQuickItem> origStackBefore;-
17 QQuickItem *rewindParent;-
18 QQuickItem *rewindStackBefore;-
19-
20 QQmlNullableValue<QQmlScriptString> xString;-
21 QQmlNullableValue<QQmlScriptString> yString;-
22 QQmlNullableValue<QQmlScriptString> widthString;-
23 QQmlNullableValue<QQmlScriptString> heightString;-
24 QQmlNullableValue<QQmlScriptString> scaleString;-
25 QQmlNullableValue<QQmlScriptString> rotationString;-
26-
27 void doChange(QQuickItem *targetParent, QQuickItem *stackBefore = nullptr);-
28};-
29-
30void QQuickParentChangePrivate::doChange(QQuickItem *targetParent, QQuickItem *stackBefore)-
31{-
32 if (targetParent
targetParentDescription
TRUEevaluated 136 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
FALSEnever evaluated
&& target
targetDescription
TRUEevaluated 136 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
FALSEnever evaluated
&& target->parentItem()
target->parentItem()Description
TRUEevaluated 104 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
0-136
33 QQuickParentChange * const q = q_func();-
34 bool ok;-
35 const QTransform &transform = target->parentItem()->itemTransform(targetParent, &ok);-
36 if (transform.type() >= QTransform::TxShear
transform.type...sform::TxShearDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
|| !ok
!okDescription
TRUEnever evaluated
FALSEevaluated 102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
0-102
37 qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under complex transform");-
38 ok = false;-
39 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstates
2
40-
41 qreal scale = 1;-
42 qreal rotation = 0;-
43 bool isRotate = (
(transform.typ...orm::TxRotate)Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 94 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
transform.type() == QTransform::TxRotate)
(transform.typ...orm::TxRotate)Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 94 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
|| (
(transform.m11() < 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 92 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
transform.m11() < 0)
(transform.m11() < 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 92 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
;
2-94
44 if (ok
okDescription
TRUEevaluated 102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
&& !isRotate
!isRotateDescription
TRUEevaluated 90 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
) {
2-102
45 if (transform.m11() == transform.m22()
transform.m11(...ransform.m22()Description
TRUEevaluated 88 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
)
2-88
46 scale = transform.m11();
executed 88 times by 3 tests: scale = transform.m11();
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
88
47 else {-
48 qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under non-uniform scale");-
49 ok = false;-
50 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstates
2
51 } else if (ok
okDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
&& isRotate
isRotateDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
) {
0-12
52 if (transform.m11() == transform.m22()
transform.m11(...ransform.m22()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
)
0-12
53 scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
executed 12 times by 2 tests: scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
12
54 else {-
55 qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under non-uniform scale");-
56 ok = false;-
57 }
never executed: end of block
0
58-
59 if (scale != 0
scale != 0Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
)
0-12
60 rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale));
executed 12 times by 2 tests: rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale));
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
12
61 else {-
62 qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under scale of 0");-
63 ok = false;-
64 }
never executed: end of block
0
65 }-
66-
67 const QPointF &point = transform.map(QPointF(target->x(),target->y()));-
68 qreal x = point.x();-
69 qreal y = point.y();-
70-
71-
72 target->setParentItem(targetParent);-
73-
74 if (ok
okDescription
TRUEevaluated 100 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstates
&& target->transformOrigin() != QQuickItem::TopLeft
target->transf...kItem::TopLeftDescription
TRUEevaluated 100 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEnever evaluated
) {
0-100
75 qreal tempxt = target->transformOriginPoint().x();-
76 qreal tempyt = target->transformOriginPoint().y();-
77 QTransform t;-
78 t.translate(-tempxt, -tempyt);-
79 t.rotate(rotation);-
80 t.scale(scale, scale);-
81 t.translate(tempxt, tempyt);-
82 const QPointF &offset = t.map(QPointF(0,0));-
83 x += offset.x();-
84 y += offset.y();-
85 }
executed 100 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
100
86-
87 if (ok
okDescription
TRUEevaluated 100 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstates
) {
4-100
88-
89 target->setPosition(QPointF(x, y));-
90 target->setRotation(target->rotation() + rotation);-
91 target->setScale(target->scale() * scale);-
92 }
executed 100 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
100
93 }
executed 104 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
else if (target
targetDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-104
94 target->setParentItem(targetParent);-
95 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
32
96-
97-
98-
99 if (target
targetDescription
TRUEevaluated 136 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
FALSEnever evaluated
&& stackBefore
stackBeforeDescription
TRUEnever evaluated
FALSEevaluated 136 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
)
0-136
100 target->stackBefore(stackBefore);
never executed: target->stackBefore(stackBefore);
0
101}
executed 136 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
136
102QQuickParentChange::QQuickParentChange(QObject *parent)-
103 : QQuickStateOperation(*(new QQuickParentChangePrivate), parent)-
104{-
105}
executed 124 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
124
106-
107QQuickParentChange::~QQuickParentChange()-
108{-
109}-
110QQmlScriptString QQuickParentChange::x() const-
111{-
112 const QQuickParentChangePrivate * const d = d_func();-
113 return
never executed: return d->xString.value;
d->xString.value;
never executed: return d->xString.value;
0
114}-
115-
116void QQuickParentChange::setX(QQmlScriptString x)-
117{-
118 QQuickParentChangePrivate * const d = d_func();-
119 d->xString = x;-
120}
executed 90 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
90
121-
122bool QQuickParentChange::xIsSet() const-
123{-
124 const QQuickParentChangePrivate * const d = d_func();-
125 return
executed 2 times by 1 test: return d->xString.isValid();
Executed by:
  • tst_qquickanimations
d->xString.isValid();
executed 2 times by 1 test: return d->xString.isValid();
Executed by:
  • tst_qquickanimations
2
126}-
127-
128QQmlScriptString QQuickParentChange::y() const-
129{-
130 const QQuickParentChangePrivate * const d = d_func();-
131 return
never executed: return d->yString.value;
d->yString.value;
never executed: return d->yString.value;
0
132}-
133-
134void QQuickParentChange::setY(QQmlScriptString y)-
135{-
136 QQuickParentChangePrivate * const d = d_func();-
137 d->yString = y;-
138}
executed 90 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
90
139-
140bool QQuickParentChange::yIsSet() const-
141{-
142 const QQuickParentChangePrivate * const d = d_func();-
143 return
executed 2 times by 1 test: return d->yString.isValid();
Executed by:
  • tst_qquickanimations
d->yString.isValid();
executed 2 times by 1 test: return d->yString.isValid();
Executed by:
  • tst_qquickanimations
2
144}-
145-
146QQmlScriptString QQuickParentChange::width() const-
147{-
148 const QQuickParentChangePrivate * const d = d_func();-
149 return
never executed: return d->widthString.value;
d->widthString.value;
never executed: return d->widthString.value;
0
150}-
151-
152void QQuickParentChange::setWidth(QQmlScriptString width)-
153{-
154 QQuickParentChangePrivate * const d = d_func();-
155 d->widthString = width;-
156}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
157-
158bool QQuickParentChange::widthIsSet() const-
159{-
160 const QQuickParentChangePrivate * const d = d_func();-
161 return
executed 2 times by 1 test: return d->widthString.isValid();
Executed by:
  • tst_qquickanimations
d->widthString.isValid();
executed 2 times by 1 test: return d->widthString.isValid();
Executed by:
  • tst_qquickanimations
2
162}-
163-
164QQmlScriptString QQuickParentChange::height() const-
165{-
166 const QQuickParentChangePrivate * const d = d_func();-
167 return
never executed: return d->heightString.value;
d->heightString.value;
never executed: return d->heightString.value;
0
168}-
169-
170void QQuickParentChange::setHeight(QQmlScriptString height)-
171{-
172 QQuickParentChangePrivate * const d = d_func();-
173 d->heightString = height;-
174}
never executed: end of block
0
175-
176bool QQuickParentChange::heightIsSet() const-
177{-
178 const QQuickParentChangePrivate * const d = d_func();-
179 return
executed 2 times by 1 test: return d->heightString.isValid();
Executed by:
  • tst_qquickanimations
d->heightString.isValid();
executed 2 times by 1 test: return d->heightString.isValid();
Executed by:
  • tst_qquickanimations
2
180}-
181-
182QQmlScriptString QQuickParentChange::scale() const-
183{-
184 const QQuickParentChangePrivate * const d = d_func();-
185 return
never executed: return d->scaleString.value;
d->scaleString.value;
never executed: return d->scaleString.value;
0
186}-
187-
188void QQuickParentChange::setScale(QQmlScriptString scale)-
189{-
190 QQuickParentChangePrivate * const d = d_func();-
191 d->scaleString = scale;-
192}
never executed: end of block
0
193-
194bool QQuickParentChange::scaleIsSet() const-
195{-
196 const QQuickParentChangePrivate * const d = d_func();-
197 return
executed 2 times by 1 test: return d->scaleString.isValid();
Executed by:
  • tst_qquickanimations
d->scaleString.isValid();
executed 2 times by 1 test: return d->scaleString.isValid();
Executed by:
  • tst_qquickanimations
2
198}-
199-
200QQmlScriptString QQuickParentChange::rotation() const-
201{-
202 const QQuickParentChangePrivate * const d = d_func();-
203 return
never executed: return d->rotationString.value;
d->rotationString.value;
never executed: return d->rotationString.value;
0
204}-
205-
206void QQuickParentChange::setRotation(QQmlScriptString rotation)-
207{-
208 QQuickParentChangePrivate * const d = d_func();-
209 d->rotationString = rotation;-
210}
never executed: end of block
0
211-
212bool QQuickParentChange::rotationIsSet() const-
213{-
214 const QQuickParentChangePrivate * const d = d_func();-
215 return
executed 2 times by 1 test: return d->rotationString.isValid();
Executed by:
  • tst_qquickanimations
d->rotationString.isValid();
executed 2 times by 1 test: return d->rotationString.isValid();
Executed by:
  • tst_qquickanimations
2
216}-
217-
218QQuickItem *QQuickParentChange::originalParent() const-
219{-
220 const QQuickParentChangePrivate * const d = d_func();-
221 return
never executed: return d->origParent;
d->origParent;
never executed: return d->origParent;
0
222}-
223-
224-
225-
226-
227-
228QQuickItem *QQuickParentChange::object() const-
229{-
230 const QQuickParentChangePrivate * const d = d_func();-
231 return
executed 6 times by 1 test: return d->target;
Executed by:
  • tst_qquickanimations
d->target;
executed 6 times by 1 test: return d->target;
Executed by:
  • tst_qquickanimations
6
232}-
233-
234void QQuickParentChange::setObject(QQuickItem *target)-
235{-
236 QQuickParentChangePrivate * const d = d_func();-
237 d->target = target;-
238}
executed 126 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
126
239-
240-
241-
242-
243-
244QQuickItem *QQuickParentChange::parent() const-
245{-
246 const QQuickParentChangePrivate * const d = d_func();-
247 return
executed 4 times by 2 tests: return d->parent;
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
d->parent;
executed 4 times by 2 tests: return d->parent;
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
4
248}-
249-
250void QQuickParentChange::setParent(QQuickItem *parent)-
251{-
252 QQuickParentChangePrivate * const d = d_func();-
253 d->parent = parent;-
254}
executed 124 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
124
255-
256QQuickStateOperation::ActionList QQuickParentChange::actions()-
257{-
258 QQuickParentChangePrivate * const d = d_func();-
259 if (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 124 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
|| !d->parent
!d->parentDescription
TRUEnever evaluated
FALSEevaluated 124 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
)
0-124
260 return
never executed: return ActionList();
ActionList();
never executed: return ActionList();
0
261-
262 ActionList actions;-
263-
264 QQuickStateAction a;-
265 a.event = this;-
266 actions << a;-
267-
268 if (d->xString.isValid()
d->xString.isValid()Description
TRUEevaluated 92 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
FALSEevaluated 32 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
) {
32-92
269 bool ok = false;-
270 qreal x = d->xString.value.numberLiteral(&ok);-
271 if (ok
okDescription
TRUEevaluated 92 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
FALSEnever evaluated
) {
0-92
272 QQuickStateAction xa(d->target, QLatin1String("x"), x);-
273 actions << xa;-
274 }
executed 92 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
else {
92
275 QQmlProperty property(d->target, QLatin1String("x"));-
276 QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->xString.value, d->target, qmlContext(this));-
277 newBinding->setTarget(property);-
278 QQuickStateAction xa;-
279 xa.property = property;-
280 xa.toBinding = newBinding;-
281 xa.fromValue = xa.property.read();-
282 xa.deletableToBinding = true;-
283 actions << xa;-
284 }
never executed: end of block
0
285 }-
286-
287 if (d->yString.isValid()
d->yString.isValid()Description
TRUEevaluated 92 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
FALSEevaluated 32 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
) {
32-92
288 bool ok = false;-
289 qreal y = d->yString.value.numberLiteral(&ok);-
290 if (ok
okDescription
TRUEevaluated 92 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
FALSEnever evaluated
) {
0-92
291 QQuickStateAction ya(d->target, QLatin1String("y"), y);-
292 actions << ya;-
293 }
executed 92 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
else {
92
294 QQmlProperty property(d->target, QLatin1String("y"));-
295 QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->yString.value, d->target, qmlContext(this));-
296 newBinding->setTarget(property);-
297 QQuickStateAction ya;-
298 ya.property = property;-
299 ya.toBinding = newBinding;-
300 ya.fromValue = ya.property.read();-
301 ya.deletableToBinding = true;-
302 actions << ya;-
303 }
never executed: end of block
0
304 }-
305-
306 if (d->scaleString.isValid()
d->scaleString.isValid()Description
TRUEnever evaluated
FALSEevaluated 124 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
) {
0-124
307 bool ok = false;-
308 qreal scale = d->scaleString.value.numberLiteral(&ok);-
309 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
310 QQuickStateAction sa(d->target, QLatin1String("scale"), scale);-
311 actions << sa;-
312 }
never executed: end of block
else {
0
313 QQmlProperty property(d->target, QLatin1String("scale"));-
314 QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->scaleString.value, d->target, qmlContext(this));-
315 newBinding->setTarget(property);-
316 QQuickStateAction sa;-
317 sa.property = property;-
318 sa.toBinding = newBinding;-
319 sa.fromValue = sa.property.read();-
320 sa.deletableToBinding = true;-
321 actions << sa;-
322 }
never executed: end of block
0
323 }-
324-
325 if (d->rotationString.isValid()
d->rotationString.isValid()Description
TRUEnever evaluated
FALSEevaluated 124 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
) {
0-124
326 bool ok = false;-
327 qreal rotation = d->rotationString.value.numberLiteral(&ok);-
328 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
329 QQuickStateAction ra(d->target, QLatin1String("rotation"), rotation);-
330 actions << ra;-
331 }
never executed: end of block
else {
0
332 QQmlProperty property(d->target, QLatin1String("rotation"));-
333 QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->rotationString.value, d->target, qmlContext(this));-
334 newBinding->setTarget(property);-
335 QQuickStateAction ra;-
336 ra.property = property;-
337 ra.toBinding = newBinding;-
338 ra.fromValue = ra.property.read();-
339 ra.deletableToBinding = true;-
340 actions << ra;-
341 }
never executed: end of block
0
342 }-
343-
344 if (d->widthString.isValid()
d->widthString.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 122 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
) {
2-122
345 bool ok = false;-
346 qreal width = d->widthString.value.numberLiteral(&ok);-
347 if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-2
348 QQuickStateAction wa(d->target, QLatin1String("width"), width);-
349 actions << wa;-
350 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
else {
2
351 QQmlProperty property(d->target, QLatin1String("width"));-
352 QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->widthString.value, d->target, qmlContext(this));-
353 newBinding->setTarget(property);-
354 QQuickStateAction wa;-
355 wa.property = property;-
356 wa.toBinding = newBinding;-
357 wa.fromValue = wa.property.read();-
358 wa.deletableToBinding = true;-
359 actions << wa;-
360 }
never executed: end of block
0
361 }-
362-
363 if (d->heightString.isValid()
d->heightString.isValid()Description
TRUEnever evaluated
FALSEevaluated 124 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
) {
0-124
364 bool ok = false;-
365 qreal height = d->heightString.value.numberLiteral(&ok);-
366 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
367 QQuickStateAction ha(d->target, QLatin1String("height"), height);-
368 actions << ha;-
369 }
never executed: end of block
else {
0
370 QQmlProperty property(d->target, QLatin1String("height"));-
371 QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->heightString.value, d->target, qmlContext(this));-
372 newBinding->setTarget(property);-
373 QQuickStateAction ha;-
374 ha.property = property;-
375 ha.toBinding = newBinding;-
376 ha.fromValue = ha.property.read();-
377 ha.deletableToBinding = true;-
378 actions << ha;-
379 }
never executed: end of block
0
380 }-
381-
382 return
executed 124 times by 5 tests: return actions;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
actions;
executed 124 times by 5 tests: return actions;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
124
383}-
384-
385void QQuickParentChange::saveOriginals()-
386{-
387 QQuickParentChangePrivate * const d = d_func();-
388 saveCurrentValues();-
389 d->origParent = d->rewindParent;-
390 d->origStackBefore = d->rewindStackBefore;-
391}
executed 124 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
124
392void QQuickParentChange::execute()-
393{-
394 QQuickParentChangePrivate * const d = d_func();-
395 d->doChange(d->parent);-
396}
executed 126 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
126
397-
398bool QQuickParentChange::isReversable()-
399{-
400 return
executed 276 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
true;
executed 276 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
276
401}-
402-
403void QQuickParentChange::reverse()-
404{-
405 QQuickParentChangePrivate * const d = d_func();-
406 d->doChange(d->origParent, d->origStackBefore);-
407}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickstates
10
408-
409QQuickStateActionEvent::EventType QQuickParentChange::type() const-
410{-
411 return
executed 6 times by 2 tests: return ParentChange;
Executed by:
  • tst_qquickanimations
  • tst_qquicklistview
ParentChange;
executed 6 times by 2 tests: return ParentChange;
Executed by:
  • tst_qquickanimations
  • tst_qquicklistview
6
412}-
413-
414bool QQuickParentChange::mayOverride(QQuickStateActionEvent*other)-
415{-
416 QQuickParentChangePrivate * const d = d_func();-
417 if (other->type() != ParentChange
other->type() != ParentChangeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
418 return
never executed: return false;
false;
never executed: return false;
0
419 if (QQuickParentChange *otherPC = static_cast<QQuickParentChange*>(other)
QQuickParentCh...hange*>(other)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
420 return
never executed: return (d->target == otherPC->object());
(d->target == otherPC->object());
never executed: return (d->target == otherPC->object());
0
421 return
never executed: return false;
false;
never executed: return false;
0
422}-
423-
424void QQuickParentChange::saveCurrentValues()-
425{-
426 QQuickParentChangePrivate * const d = d_func();-
427 if (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 134 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstates
) {
0-134
428 d->rewindParent = nullptr;-
429 d->rewindStackBefore = nullptr;-
430 return;
never executed: return;
0
431 }-
432-
433 d->rewindParent = d->target->parentItem();-
434 d->rewindStackBefore = nullptr;-
435-
436 if (!d->rewindParent
!d->rewindParentDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
)
32-102
437 return;
executed 32 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
32
438-
439 QList<QQuickItem *> children = d->rewindParent->childItems();-
440 for (int ii = 0; ii < children.count() - 1
ii < children.count() - 1Description
TRUEevaluated 156 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 94 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickstates
; ++ii) {
94-156
441 if (children.at(ii) == d->target
children.at(ii) == d->targetDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 148 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
) {
8-148
442 d->rewindStackBefore = children.at(ii + 1);-
443 break;
executed 8 times by 2 tests: break;
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
8
444 }-
445 }
executed 148 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
148
446}
executed 102 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
102
447-
448void QQuickParentChange::rewind()-
449{-
450 QQuickParentChangePrivate * const d = d_func();-
451 d->doChange(d->rewindParent, d->rewindStackBefore);-
452}
never executed: end of block
0
453class QQuickAnchorSetPrivate : public QObjectPrivate-
454{-
455 inline QQuickAnchorSet* q_func() { return static_cast<QQuickAnchorSet *>(q_ptr); } inline const QQuickAnchorSet* q_func() const { return static_cast<const QQuickAnchorSet *>(q_ptr); } friend class QQuickAnchorSet;-
456public:-
457 QQuickAnchorSetPrivate()-
458 : usedAnchors(nullptr), resetAnchors(nullptr)-
459 {-
460 }
executed 36 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
36
461-
462 QQuickAnchors::Anchors usedAnchors;-
463 QQuickAnchors::Anchors resetAnchors;-
464-
465 QQmlScriptString leftScript;-
466 QQmlScriptString rightScript;-
467 QQmlScriptString topScript;-
468 QQmlScriptString bottomScript;-
469 QQmlScriptString hCenterScript;-
470 QQmlScriptString vCenterScript;-
471 QQmlScriptString baselineScript;-
472};-
473-
474QQuickAnchorSet::QQuickAnchorSet(QObject *parent)-
475 : QObject(*new QQuickAnchorSetPrivate, parent)-
476{-
477}
executed 36 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
36
478-
479QQuickAnchorSet::~QQuickAnchorSet()-
480{-
481}-
482-
483QQmlScriptString QQuickAnchorSet::top() const-
484{-
485 const QQuickAnchorSetPrivate * const d = d_func();-
486 return
executed 2 times by 1 test: return d->topScript;
Executed by:
  • tst_qquickstates
d->topScript;
executed 2 times by 1 test: return d->topScript;
Executed by:
  • tst_qquickstates
2
487}-
488-
489void QQuickAnchorSet::setTop(const QQmlScriptString &edge)-
490{-
491 QQuickAnchorSetPrivate * const d = d_func();-
492 d->usedAnchors |= QQuickAnchors::TopAnchor;-
493 d->topScript = edge;-
494 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickitem2
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
4-10
495 resetTop();
executed 4 times by 1 test: resetTop();
Executed by:
  • tst_qquickitem2
4
496}
executed 14 times by 3 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
14
497-
498void QQuickAnchorSet::resetTop()-
499{-
500 QQuickAnchorSetPrivate * const d = d_func();-
501 d->usedAnchors &= ~QQuickAnchors::TopAnchor;-
502 d->resetAnchors |= QQuickAnchors::TopAnchor;-
503}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickitem2
4
504-
505QQmlScriptString QQuickAnchorSet::bottom() const-
506{-
507 const QQuickAnchorSetPrivate * const d = d_func();-
508 return
executed 2 times by 1 test: return d->bottomScript;
Executed by:
  • tst_qquickstates
d->bottomScript;
executed 2 times by 1 test: return d->bottomScript;
Executed by:
  • tst_qquickstates
2
509}-
510-
511void QQuickAnchorSet::setBottom(const QQmlScriptString &edge)-
512{-
513 QQuickAnchorSetPrivate * const d = d_func();-
514 d->usedAnchors |= QQuickAnchors::BottomAnchor;-
515 d->bottomScript = edge;-
516 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
0-10
517 resetBottom();
never executed: resetBottom();
0
518}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
10
519-
520void QQuickAnchorSet::resetBottom()-
521{-
522 QQuickAnchorSetPrivate * const d = d_func();-
523 d->usedAnchors &= ~QQuickAnchors::BottomAnchor;-
524 d->resetAnchors |= QQuickAnchors::BottomAnchor;-
525}
never executed: end of block
0
526-
527QQmlScriptString QQuickAnchorSet::verticalCenter() const-
528{-
529 const QQuickAnchorSetPrivate * const d = d_func();-
530 return
executed 2 times by 1 test: return d->vCenterScript;
Executed by:
  • tst_qquickstates
d->vCenterScript;
executed 2 times by 1 test: return d->vCenterScript;
Executed by:
  • tst_qquickstates
2
531}-
532-
533void QQuickAnchorSet::setVerticalCenter(const QQmlScriptString &edge)-
534{-
535 QQuickAnchorSetPrivate * const d = d_func();-
536 d->usedAnchors |= QQuickAnchors::VCenterAnchor;-
537 d->vCenterScript = edge;-
538 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquickstates
)
4-6
539 resetVerticalCenter();
executed 4 times by 1 test: resetVerticalCenter();
Executed by:
  • tst_qquicklistview
4
540}
executed 10 times by 3 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
10
541-
542void QQuickAnchorSet::resetVerticalCenter()-
543{-
544 QQuickAnchorSetPrivate * const d = d_func();-
545 d->usedAnchors &= ~QQuickAnchors::VCenterAnchor;-
546 d->resetAnchors |= QQuickAnchors::VCenterAnchor;-
547}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
548-
549QQmlScriptString QQuickAnchorSet::baseline() const-
550{-
551 const QQuickAnchorSetPrivate * const d = d_func();-
552 return
executed 2 times by 1 test: return d->baselineScript;
Executed by:
  • tst_qquickstates
d->baselineScript;
executed 2 times by 1 test: return d->baselineScript;
Executed by:
  • tst_qquickstates
2
553}-
554-
555void QQuickAnchorSet::setBaseline(const QQmlScriptString &edge)-
556{-
557 QQuickAnchorSetPrivate * const d = d_func();-
558 d->usedAnchors |= QQuickAnchors::BaselineAnchor;-
559 d->baselineScript = edge;-
560 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
)
0-2
561 resetBaseline();
never executed: resetBaseline();
0
562}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstates
2
563-
564void QQuickAnchorSet::resetBaseline()-
565{-
566 QQuickAnchorSetPrivate * const d = d_func();-
567 d->usedAnchors &= ~QQuickAnchors::BaselineAnchor;-
568 d->resetAnchors |= QQuickAnchors::BaselineAnchor;-
569}
never executed: end of block
0
570-
571QQmlScriptString QQuickAnchorSet::left() const-
572{-
573 const QQuickAnchorSetPrivate * const d = d_func();-
574 return
executed 4 times by 1 test: return d->leftScript;
Executed by:
  • tst_qquickstates
d->leftScript;
executed 4 times by 1 test: return d->leftScript;
Executed by:
  • tst_qquickstates
4
575}-
576-
577void QQuickAnchorSet::setLeft(const QQmlScriptString &edge)-
578{-
579 QQuickAnchorSetPrivate * const d = d_func();-
580 d->usedAnchors |= QQuickAnchors::LeftAnchor;-
581 d->leftScript = edge;-
582 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 12 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
)
12
583 resetLeft();
executed 12 times by 2 tests: resetLeft();
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
12
584}
executed 24 times by 3 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
24
585-
586void QQuickAnchorSet::resetLeft()-
587{-
588 QQuickAnchorSetPrivate * const d = d_func();-
589 d->usedAnchors &= ~QQuickAnchors::LeftAnchor;-
590 d->resetAnchors |= QQuickAnchors::LeftAnchor;-
591}
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
12
592-
593QQmlScriptString QQuickAnchorSet::right() const-
594{-
595 const QQuickAnchorSetPrivate * const d = d_func();-
596 return
executed 2 times by 1 test: return d->rightScript;
Executed by:
  • tst_qquickstates
d->rightScript;
executed 2 times by 1 test: return d->rightScript;
Executed by:
  • tst_qquickstates
2
597}-
598-
599void QQuickAnchorSet::setRight(const QQmlScriptString &edge)-
600{-
601 QQuickAnchorSetPrivate * const d = d_func();-
602 d->usedAnchors |= QQuickAnchors::RightAnchor;-
603 d->rightScript = edge;-
604 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 20 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
)
2-20
605 resetRight();
executed 2 times by 1 test: resetRight();
Executed by:
  • tst_qquickanimations
2
606}
executed 22 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
22
607-
608void QQuickAnchorSet::resetRight()-
609{-
610 QQuickAnchorSetPrivate * const d = d_func();-
611 d->usedAnchors &= ~QQuickAnchors::RightAnchor;-
612 d->resetAnchors |= QQuickAnchors::RightAnchor;-
613}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
614-
615QQmlScriptString QQuickAnchorSet::horizontalCenter() const-
616{-
617 const QQuickAnchorSetPrivate * const d = d_func();-
618 return
executed 2 times by 1 test: return d->hCenterScript;
Executed by:
  • tst_qquickstates
d->hCenterScript;
executed 2 times by 1 test: return d->hCenterScript;
Executed by:
  • tst_qquickstates
2
619}-
620-
621void QQuickAnchorSet::setHorizontalCenter(const QQmlScriptString &edge)-
622{-
623 QQuickAnchorSetPrivate * const d = d_func();-
624 d->usedAnchors |= QQuickAnchors::HCenterAnchor;-
625 d->hCenterScript = edge;-
626 if (edge.isUndefinedLiteral()
edge.isUndefinedLiteral()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstates
)
4-8
627 resetHorizontalCenter();
executed 8 times by 2 tests: resetHorizontalCenter();
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
8
628}
executed 12 times by 3 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
12
629-
630void QQuickAnchorSet::resetHorizontalCenter()-
631{-
632 QQuickAnchorSetPrivate * const d = d_func();-
633 d->usedAnchors &= ~QQuickAnchors::HCenterAnchor;-
634 d->resetAnchors |= QQuickAnchors::HCenterAnchor;-
635}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
8
636-
637class QQuickAnchorChangesPrivate : public QQuickStateOperationPrivate-
638{-
639public:-
640 QQuickAnchorChangesPrivate()-
641 : target(nullptr), anchorSet(new QQuickAnchorSet)-
642 {-
643-
644 }
executed 36 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
36
645 ~QQuickAnchorChangesPrivate() { delete anchorSet; }
executed 36 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
36
646-
647 QQuickItem *target;-
648 QQuickAnchorSet *anchorSet;-
649-
650 QExplicitlySharedDataPointer<QQmlBinding> leftBinding;-
651 QExplicitlySharedDataPointer<QQmlBinding> rightBinding;-
652 QExplicitlySharedDataPointer<QQmlBinding> hCenterBinding;-
653 QExplicitlySharedDataPointer<QQmlBinding> topBinding;-
654 QExplicitlySharedDataPointer<QQmlBinding> bottomBinding;-
655 QExplicitlySharedDataPointer<QQmlBinding> vCenterBinding;-
656 QExplicitlySharedDataPointer<QQmlBinding> baselineBinding;-
657-
658 QQmlAbstractBinding::Ptr origLeftBinding;-
659 QQmlAbstractBinding::Ptr origRightBinding;-
660 QQmlAbstractBinding::Ptr origHCenterBinding;-
661 QQmlAbstractBinding::Ptr origTopBinding;-
662 QQmlAbstractBinding::Ptr origBottomBinding;-
663 QQmlAbstractBinding::Ptr origVCenterBinding;-
664 QQmlAbstractBinding::Ptr origBaselineBinding;-
665-
666 QQuickAnchorLine rewindLeft;-
667 QQuickAnchorLine rewindRight;-
668 QQuickAnchorLine rewindHCenter;-
669 QQuickAnchorLine rewindTop;-
670 QQuickAnchorLine rewindBottom;-
671 QQuickAnchorLine rewindVCenter;-
672 QQuickAnchorLine rewindBaseline;-
673-
674 qreal fromX;-
675 qreal fromY;-
676 qreal fromWidth;-
677 qreal fromHeight;-
678-
679 qreal toX;-
680 qreal toY;-
681 qreal toWidth;-
682 qreal toHeight;-
683-
684 qreal rewindX;-
685 qreal rewindY;-
686 qreal rewindWidth;-
687 qreal rewindHeight;-
688-
689 bool applyOrigLeft;-
690 bool applyOrigRight;-
691 bool applyOrigHCenter;-
692 bool applyOrigTop;-
693 bool applyOrigBottom;-
694 bool applyOrigVCenter;-
695 bool applyOrigBaseline;-
696-
697 QQmlNullableValue<qreal> origWidth;-
698 QQmlNullableValue<qreal> origHeight;-
699 qreal origX;-
700 qreal origY;-
701-
702 QQmlProperty leftProp;-
703 QQmlProperty rightProp;-
704 QQmlProperty hCenterProp;-
705 QQmlProperty topProp;-
706 QQmlProperty bottomProp;-
707 QQmlProperty vCenterProp;-
708 QQmlProperty baselineProp;-
709};-
710-
711QQuickAnchorChanges::QQuickAnchorChanges(QObject *parent)-
712 : QQuickStateOperation(*(new QQuickAnchorChangesPrivate), parent)-
713{-
714}
executed 36 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
36
715-
716QQuickAnchorChanges::~QQuickAnchorChanges()-
717{-
718}-
719-
720QQuickAnchorChanges::ActionList QQuickAnchorChanges::actions()-
721{-
722 QQuickAnchorChangesPrivate * const d = d_func();-
723-
724 d->leftBinding = d->rightBinding = d->hCenterBinding = d->topBinding-
725 = d->bottomBinding = d->vCenterBinding = d->baselineBinding = nullptr;-
726-
727 d->leftProp = QQmlProperty(d->target, QLatin1String("anchors.left"));-
728 d->rightProp = QQmlProperty(d->target, QLatin1String("anchors.right"));-
729 d->hCenterProp = QQmlProperty(d->target, QLatin1String("anchors.horizontalCenter"));-
730 d->topProp = QQmlProperty(d->target, QLatin1String("anchors.top"));-
731 d->bottomProp = QQmlProperty(d->target, QLatin1String("anchors.bottom"));-
732 d->vCenterProp = QQmlProperty(d->target, QLatin1String("anchors.verticalCenter"));-
733 d->baselineProp = QQmlProperty(d->target, QLatin1String("anchors.baseline"));-
734-
735 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::LeftAnchor
d->anchorSet->...rs::LeftAnchorDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
FALSEevaluated 26 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
14-26
736 d->leftBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->leftProp)->core, d->anchorSet->d_func()->leftScript, d->target, qmlContext(this));-
737 d->leftBinding->setTarget(d->leftProp);-
738 }
executed 14 times by 3 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
14
739 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::RightAnchor
d->anchorSet->...s::RightAnchorDescription
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
18-22
740 d->rightBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->rightProp)->core, d->anchorSet->d_func()->rightScript, d->target, qmlContext(this));-
741 d->rightBinding->setTarget(d->rightProp);-
742 }
executed 22 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
22
743 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::HCenterAnchor
d->anchorSet->...:HCenterAnchorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
4-36
744 d->hCenterBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->hCenterProp)->core, d->anchorSet->d_func()->hCenterScript, d->target, qmlContext(this));-
745 d->hCenterBinding->setTarget(d->hCenterProp);-
746 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickstates
4
747 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::TopAnchor
d->anchorSet->...ors::TopAnchorDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 26 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
14-26
748 d->topBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->topProp)->core, d->anchorSet->d_func()->topScript, d->target, qmlContext(this));-
749 d->topBinding->setTarget(d->topProp);-
750 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
14
751 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::BottomAnchor
d->anchorSet->...::BottomAnchorDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 26 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
14-26
752 d->bottomBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->bottomProp)->core, d->anchorSet->d_func()->bottomScript, d->target, qmlContext(this));-
753 d->bottomBinding->setTarget(d->bottomProp);-
754 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
14
755 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::VCenterAnchor
d->anchorSet->...:VCenterAnchorDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquickstates
FALSEevaluated 34 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
6-34
756 d->vCenterBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->vCenterProp)->core, d->anchorSet->d_func()->vCenterScript, d->target, qmlContext(this));-
757 d->vCenterBinding->setTarget(d->vCenterProp);-
758 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquickstates
6
759 if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::BaselineAnchor
d->anchorSet->...BaselineAnchorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 38 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
2-38
760 d->baselineBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->baselineProp)->core, d->anchorSet->d_func()->baselineScript, d->target, qmlContext(this));-
761 d->baselineBinding->setTarget(d->baselineProp);-
762 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstates
2
763-
764 QQuickStateAction a;-
765 a.event = this;-
766 return
executed 40 times by 5 tests: return ActionList() << a;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
ActionList() << a;
executed 40 times by 5 tests: return ActionList() << a;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
40
767}-
768-
769QQuickAnchorSet *QQuickAnchorChanges::anchors() const-
770{-
771 const QQuickAnchorChangesPrivate * const d = d_func();-
772 return
executed 52 times by 5 tests: return d->anchorSet;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
d->anchorSet;
executed 52 times by 5 tests: return d->anchorSet;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
52
773}-
774-
775-
776-
777-
778-
779QQuickItem *QQuickAnchorChanges::object() const-
780{-
781 const QQuickAnchorChangesPrivate * const d = d_func();-
782 return
executed 80 times by 2 tests: return d->target;
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
d->target;
executed 80 times by 2 tests: return d->target;
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
80
783}-
784-
785void QQuickAnchorChanges::setObject(QQuickItem *target)-
786{-
787 QQuickAnchorChangesPrivate * const d = d_func();-
788 d->target = target;-
789}
executed 34 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
34
790void QQuickAnchorChanges::execute()-
791{-
792 QQuickAnchorChangesPrivate * const d = d_func();-
793 if (!d->target
!d->targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 44 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
2-44
794 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickstates
2
795-
796 QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target);-
797-
798 if (d->applyOrigLeft
d->applyOrigLeftDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
8-36
799 if (!d->origLeftBinding
!d->origLeftBindingDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-8
800 targetPrivate->anchors()->resetLeft();
never executed: targetPrivate->anchors()->resetLeft();
0
801 QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding.data());-
802 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
803 if (d->applyOrigRight
d->applyOrigRightDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
8-36
804 if (!d->origRightBinding
!d->origRightBindingDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-8
805 targetPrivate->anchors()->resetRight();
never executed: targetPrivate->anchors()->resetRight();
0
806 QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding.data());-
807 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
808 if (d->applyOrigHCenter
d->applyOrigHCenterDescription
TRUEnever evaluated
FALSEevaluated 44 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
0-44
809 if (!d->origHCenterBinding
!d->origHCenterBindingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
810 targetPrivate->anchors()->resetHorizontalCenter();
never executed: targetPrivate->anchors()->resetHorizontalCenter();
0
811 QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding.data());-
812 }
never executed: end of block
0
813 if (d->applyOrigTop
d->applyOrigTopDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
8-36
814 if (!d->origTopBinding
!d->origTopBindingDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-8
815 targetPrivate->anchors()->resetTop();
never executed: targetPrivate->anchors()->resetTop();
0
816 QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding.data());-
817 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
818 if (d->applyOrigBottom
d->applyOrigBottomDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
8-36
819 if (!d->origBottomBinding
!d->origBottomBindingDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-8
820 targetPrivate->anchors()->resetBottom();
never executed: targetPrivate->anchors()->resetBottom();
0
821 QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding.data());-
822 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
823 if (d->applyOrigVCenter
d->applyOrigVCenterDescription
TRUEnever evaluated
FALSEevaluated 44 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
0-44
824 if (!d->origVCenterBinding
!d->origVCenterBindingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
825 targetPrivate->anchors()->resetVerticalCenter();
never executed: targetPrivate->anchors()->resetVerticalCenter();
0
826 QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding.data());-
827 }
never executed: end of block
0
828 if (d->applyOrigBaseline
d->applyOrigBaselineDescription
TRUEnever evaluated
FALSEevaluated 44 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
0-44
829 if (!d->origBaselineBinding
!d->origBaselineBindingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
830 targetPrivate->anchors()->resetBaseline();
never executed: targetPrivate->anchors()->resetBaseline();
0
831 QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding.data());-
832 }
never executed: end of block
0
833-
834-
835 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::LeftAnchor
d->anchorSet->...rs::LeftAnchorDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 26 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
18-26
836 targetPrivate->anchors()->resetLeft();-
837 QQmlPropertyPrivate::removeBinding(d->leftProp);-
838 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
18
839 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::RightAnchor
d->anchorSet->...s::RightAnchorDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
8-36
840 targetPrivate->anchors()->resetRight();-
841 QQmlPropertyPrivate::removeBinding(d->rightProp);-
842 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
843 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::HCenterAnchor
d->anchorSet->...:HCenterAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicklistview
FALSEevaluated 36 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
) {
8-36
844 targetPrivate->anchors()->resetHorizontalCenter();-
845 QQmlPropertyPrivate::removeBinding(d->hCenterProp);-
846 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
8
847 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::TopAnchor
d->anchorSet->...ors::TopAnchorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickitem2
FALSEevaluated 40 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
4-40
848 targetPrivate->anchors()->resetTop();-
849 QQmlPropertyPrivate::removeBinding(d->topProp);-
850 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickitem2
4
851 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::BottomAnchor
d->anchorSet->...::BottomAnchorDescription
TRUEnever evaluated
FALSEevaluated 44 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
0-44
852 targetPrivate->anchors()->resetBottom();-
853 QQmlPropertyPrivate::removeBinding(d->bottomProp);-
854 }
never executed: end of block
0
855 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::VCenterAnchor
d->anchorSet->...:VCenterAnchorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 40 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
) {
4-40
856 targetPrivate->anchors()->resetVerticalCenter();-
857 QQmlPropertyPrivate::removeBinding(d->vCenterProp);-
858 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
859 if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::BaselineAnchor
d->anchorSet->...BaselineAnchorDescription
TRUEnever evaluated
FALSEevaluated 44 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
) {
0-44
860 targetPrivate->anchors()->resetBaseline();-
861 QQmlPropertyPrivate::removeBinding(d->baselineProp);-
862 }
never executed: end of block
0
863-
864-
865 if (d->leftBinding
d->leftBindingDescription
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
FALSEevaluated 28 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
)
16-28
866 QQmlPropertyPrivate::setBinding(d->leftBinding.data());
executed 16 times by 3 tests: QQmlPropertyPrivate::setBinding(d->leftBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
16
867 if (d->rightBinding
d->rightBindingDescription
TRUEevaluated 24 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 20 times by 4 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
20-24
868 QQmlPropertyPrivate::setBinding(d->rightBinding.data());
executed 24 times by 3 tests: QQmlPropertyPrivate::setBinding(d->rightBinding.data());
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
24
869 if (d->hCenterBinding
d->hCenterBindingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 40 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
4-40
870 QQmlPropertyPrivate::setBinding(d->hCenterBinding.data());
executed 4 times by 1 test: QQmlPropertyPrivate::setBinding(d->hCenterBinding.data());
Executed by:
  • tst_qquickstates
4
871 if (d->topBinding
d->topBindingDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 26 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
18-26
872 QQmlPropertyPrivate::setBinding(d->topBinding.data());
executed 18 times by 2 tests: QQmlPropertyPrivate::setBinding(d->topBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
18
873 if (d->bottomBinding
d->bottomBindingDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 24 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
20-24
874 QQmlPropertyPrivate::setBinding(d->bottomBinding.data());
executed 20 times by 2 tests: QQmlPropertyPrivate::setBinding(d->bottomBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
20
875 if (d->vCenterBinding
d->vCenterBindingDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquickstates
FALSEevaluated 38 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
)
6-38
876 QQmlPropertyPrivate::setBinding(d->vCenterBinding.data());
executed 6 times by 2 tests: QQmlPropertyPrivate::setBinding(d->vCenterBinding.data());
Executed by:
  • tst_qquickitem2
  • tst_qquickstates
6
877 if (d->baselineBinding
d->baselineBindingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 42 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
2-42
878 QQmlPropertyPrivate::setBinding(d->baselineBinding.data());
executed 2 times by 1 test: QQmlPropertyPrivate::setBinding(d->baselineBinding.data());
Executed by:
  • tst_qquickstates
2
879}
executed 44 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
44
880-
881bool QQuickAnchorChanges::isReversable()-
882{-
883 return
executed 104 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
true;
executed 104 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
104
884}-
885-
886void QQuickAnchorChanges::reverse()-
887{-
888 QQuickAnchorChangesPrivate * const d = d_func();-
889 if (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
)
0-24
890 return;
never executed: return;
0
891-
892 QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target);-
893-
894 if (d->leftBinding
d->leftBindingDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
) {
10-14
895 targetPrivate->anchors()->resetLeft();-
896 QQmlPropertyPrivate::removeBinding(d->leftBinding.data());-
897 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
10
898 if (d->rightBinding
d->rightBindingDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
) {
4-20
899 targetPrivate->anchors()->resetRight();-
900 QQmlPropertyPrivate::removeBinding(d->rightBinding.data());-
901 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
20
902 if (d->hCenterBinding
d->hCenterBindingDescription
TRUEnever evaluated
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
0-24
903 targetPrivate->anchors()->resetHorizontalCenter();-
904 QQmlPropertyPrivate::removeBinding(d->hCenterBinding.data());-
905 }
never executed: end of block
0
906 if (d->topBinding
d->topBindingDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
) {
8-16
907 targetPrivate->anchors()->resetTop();-
908 QQmlPropertyPrivate::removeBinding(d->topBinding.data());-
909 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
8
910 if (d->bottomBinding
d->bottomBindingDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
) {
10-14
911 targetPrivate->anchors()->resetBottom();-
912 QQmlPropertyPrivate::removeBinding(d->bottomBinding.data());-
913 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
10
914 if (d->vCenterBinding
d->vCenterBindingDescription
TRUEnever evaluated
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
0-24
915 targetPrivate->anchors()->resetVerticalCenter();-
916 QQmlPropertyPrivate::removeBinding(d->vCenterBinding.data());-
917 }
never executed: end of block
0
918 if (d->baselineBinding
d->baselineBindingDescription
TRUEnever evaluated
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
) {
0-24
919 targetPrivate->anchors()->resetBaseline();-
920 QQmlPropertyPrivate::removeBinding(d->baselineBinding.data());-
921 }
never executed: end of block
0
922-
923-
924 if (d->origLeftBinding
d->origLeftBindingDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
)
6-18
925 QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding.data());
executed 18 times by 2 tests: QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
18
926 if (d->origRightBinding
d->origRightBindingDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
)
8-16
927 QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding.data());
executed 8 times by 2 tests: QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
8
928 if (d->origHCenterBinding
d->origHCenterBindingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
4-20
929 QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding.data());
executed 4 times by 1 test: QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding.data());
Executed by:
  • tst_qquicklistview
4
930 if (d->origTopBinding
d->origTopBindingDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
)
8-16
931 QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding.data());
executed 8 times by 2 tests: QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
8
932 if (d->origBottomBinding
d->origBottomBindingDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
)
10-14
933 QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding.data());
executed 10 times by 2 tests: QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding.data());
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
10
934 if (d->origVCenterBinding
d->origVCenterBindingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
4-20
935 QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding.data());
executed 4 times by 1 test: QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding.data());
Executed by:
  • tst_qquicklistview
4
936 if (d->origBaselineBinding
d->origBaselineBindingDescription
TRUEnever evaluated
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
)
0-24
937 QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding.data());
never executed: QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding.data());
0
938-
939-
940 QQuickAnchors::Anchors stateVAnchors = d->anchorSet->d_func()->usedAnchors & QQuickAnchors::Vertical_Mask;-
941 QQuickAnchors::Anchors origVAnchors = targetPrivate->anchors()->usedAnchors() & QQuickAnchors::Vertical_Mask;-
942 QQuickAnchors::Anchors stateHAnchors = d->anchorSet->d_func()->usedAnchors & QQuickAnchors::Horizontal_Mask;-
943 QQuickAnchors::Anchors origHAnchors = targetPrivate->anchors()->usedAnchors() & QQuickAnchors::Horizontal_Mask;-
944-
945 bool stateSetWidth = (stateHAnchors &&-
946 stateHAnchors != QQuickAnchors::LeftAnchor
stateHAnchors ...rs::LeftAnchorDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
&&
0-20
947 stateHAnchors != QQuickAnchors::RightAnchor
stateHAnchors ...s::RightAnchorDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstates
&&
10
948 stateHAnchors != QQuickAnchors::HCenterAnchor
stateHAnchors ...:HCenterAnchorDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
);
0-10
949 bool origSetWidth = (origHAnchors &&-
950 origHAnchors != QQuickAnchors::LeftAnchor
origHAnchors !...rs::LeftAnchorDescription
TRUEevaluated 12 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstates
&&
10-12
951 origHAnchors != QQuickAnchors::RightAnchor
origHAnchors !...s::RightAnchorDescription
TRUEevaluated 12 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEnever evaluated
&&
0-12
952 origHAnchors != QQuickAnchors::HCenterAnchor
origHAnchors !...:HCenterAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
);
4-8
953 if (d->origWidth.isValid()
d->origWidth.isValid()Description
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
&& stateSetWidth
stateSetWidthDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
&& !origSetWidth
!origSetWidthDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
2-22
954 d->target->setWidth(d->origWidth.value);
executed 2 times by 1 test: d->target->setWidth(d->origWidth.value);
Executed by:
  • tst_qquickstates
2
955-
956 bool stateSetHeight = (stateVAnchors &&-
957 stateVAnchors != QQuickAnchors::TopAnchor
stateVAnchors ...ors::TopAnchorDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
&&
0-10
958 stateVAnchors != QQuickAnchors::BottomAnchor
stateVAnchors ...::BottomAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
&&
2-8
959 stateVAnchors != QQuickAnchors::VCenterAnchor
stateVAnchors ...:VCenterAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
&&
0-8
960 stateVAnchors != QQuickAnchors::BaselineAnchor
stateVAnchors ...BaselineAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
);
0-8
961 bool origSetHeight = (origVAnchors &&-
962 origVAnchors != QQuickAnchors::TopAnchor
origVAnchors !...ors::TopAnchorDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEnever evaluated
&&
0-14
963 origVAnchors != QQuickAnchors::BottomAnchor
origVAnchors !...::BottomAnchorDescription
TRUEevaluated 12 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
&&
2-12
964 origVAnchors != QQuickAnchors::VCenterAnchor
origVAnchors !...:VCenterAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
&&
4-8
965 origVAnchors != QQuickAnchors::BaselineAnchor
origVAnchors !...BaselineAnchorDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEnever evaluated
);
0-8
966 if (d->origHeight.isValid()
d->origHeight.isValid()Description
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
&& stateSetHeight
stateSetHeightDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickstates
&& !origSetHeight
!origSetHeightDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
0-22
967 d->target->setHeight(d->origHeight.value);
never executed: d->target->setHeight(d->origHeight.value);
0
968-
969 if (stateHAnchors && !origHAnchors
!origHAnchorsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
2-18
970 d->target->setX(d->origX);
executed 2 times by 1 test: d->target->setX(d->origX);
Executed by:
  • tst_qquickstates
2
971-
972 if (stateVAnchors && !origVAnchors
!origVAnchorsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickstates
)
2-8
973 d->target->setY(d->origY);
executed 2 times by 1 test: d->target->setY(d->origY);
Executed by:
  • tst_qquickstates
2
974}
executed 24 times by 3 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickstates
24
975-
976QQuickStateActionEvent::EventType QQuickAnchorChanges::type() const-
977{-
978 return
executed 26 times by 3 tests: return AnchorChanges;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
AnchorChanges;
executed 26 times by 3 tests: return AnchorChanges;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquicklistview
26
979}-
980-
981QList<QQuickStateAction> QQuickAnchorChanges::additionalActions() const-
982{-
983 const QQuickAnchorChangesPrivate * const d = d_func();-
984 QList<QQuickStateAction> extra;-
985-
986 QQuickAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors;-
987 bool hChange = combined & QQuickAnchors::Horizontal_Mask;-
988 bool vChange = combined & QQuickAnchors::Vertical_Mask;-
989-
990 if (d->target
d->targetDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-10
991 QQuickStateAction a;-
992 if (hChange
hChangeDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& d->fromX != d->toX
d->fromX != d->toXDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-10
993 a.property = QQmlProperty(d->target, QLatin1String("x"));-
994 a.toValue = d->toX;-
995 extra << a;-
996 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
8
997 if (vChange
vChangeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
&& d->fromY != d->toY
d->fromY != d->toYDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-8
998 a.property = QQmlProperty(d->target, QLatin1String("y"));-
999 a.toValue = d->toY;-
1000 extra << a;-
1001 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
1002 if (hChange
hChangeDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& d->fromWidth != d->toWidth
d->fromWidth != d->toWidthDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-10
1003 a.property = QQmlProperty(d->target, QLatin1String("width"));-
1004 a.toValue = d->toWidth;-
1005 extra << a;-
1006 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
6
1007 if (vChange
vChangeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
&& d->fromHeight != d->toHeight
d->fromHeight != d->toHeightDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
) {
0-8
1008 a.property = QQmlProperty(d->target, QLatin1String("height"));-
1009 a.toValue = d->toHeight;-
1010 extra << a;-
1011 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
8
1012 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
1013-
1014 return
executed 10 times by 2 tests: return extra;
Executed by:
  • tst_examples
  • tst_qquickanimations
extra;
executed 10 times by 2 tests: return extra;
Executed by:
  • tst_examples
  • tst_qquickanimations
10
1015}-
1016-
1017bool QQuickAnchorChanges::changesBindings()-
1018{-
1019 return
executed 124 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
true;
executed 124 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
124
1020}-
1021-
1022void QQuickAnchorChanges::saveOriginals()-
1023{-
1024 QQuickAnchorChangesPrivate * const d = d_func();-
1025 if (!d->target
!d->targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 34 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
2-34
1026 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickstates
2
1027-
1028 d->origLeftBinding = QQmlPropertyPrivate::binding(d->leftProp);-
1029 d->origRightBinding = QQmlPropertyPrivate::binding(d->rightProp);-
1030 d->origHCenterBinding = QQmlPropertyPrivate::binding(d->hCenterProp);-
1031 d->origTopBinding = QQmlPropertyPrivate::binding(d->topProp);-
1032 d->origBottomBinding = QQmlPropertyPrivate::binding(d->bottomProp);-
1033 d->origVCenterBinding = QQmlPropertyPrivate::binding(d->vCenterProp);-
1034 d->origBaselineBinding = QQmlPropertyPrivate::binding(d->baselineProp);-
1035-
1036 QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target);-
1037 if (targetPrivate->widthValid
targetPrivate->widthValidDescription
TRUEevaluated 28 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstates
)
6-28
1038 d->origWidth = d->target->width();
executed 28 times by 5 tests: d->origWidth = d->target->width();
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
28
1039 if (targetPrivate->heightValid
targetPrivate->heightValidDescription
TRUEevaluated 28 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstates
)
6-28
1040 d->origHeight = d->target->height();
executed 28 times by 5 tests: d->origHeight = d->target->height();
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
28
1041 d->origX = d->target->x();-
1042 d->origY = d->target->y();-
1043-
1044 d->applyOrigLeft = d->applyOrigRight = d->applyOrigHCenter = d->applyOrigTop-
1045 = d->applyOrigBottom = d->applyOrigVCenter = d->applyOrigBaseline = false;-
1046-
1047 saveCurrentValues();-
1048}
executed 34 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
34
1049-
1050void QQuickAnchorChanges::copyOriginals(QQuickStateActionEvent *other)-
1051{-
1052 QQuickAnchorChangesPrivate * const d = d_func();-
1053 QQuickAnchorChanges *ac = static_cast<QQuickAnchorChanges*>(other);-
1054 QQuickAnchorChangesPrivate *acp = ac->d_func();-
1055-
1056 QQuickAnchors::Anchors combined = acp->anchorSet->d_func()->usedAnchors |-
1057 acp->anchorSet->d_func()->resetAnchors;-
1058-
1059-
1060 d->applyOrigLeft = (combined & QQuickAnchors::LeftAnchor);-
1061 d->applyOrigRight = (combined & QQuickAnchors::RightAnchor);-
1062 d->applyOrigHCenter = (combined & QQuickAnchors::HCenterAnchor);-
1063 d->applyOrigTop = (combined & QQuickAnchors::TopAnchor);-
1064 d->applyOrigBottom = (combined & QQuickAnchors::BottomAnchor);-
1065 d->applyOrigVCenter = (combined & QQuickAnchors::VCenterAnchor);-
1066 d->applyOrigBaseline = (combined & QQuickAnchors::BaselineAnchor);-
1067-
1068 d->origLeftBinding = acp->origLeftBinding;-
1069 d->origRightBinding = acp->origRightBinding;-
1070 d->origHCenterBinding = acp->origHCenterBinding;-
1071 d->origTopBinding = acp->origTopBinding;-
1072 d->origBottomBinding = acp->origBottomBinding;-
1073 d->origVCenterBinding = acp->origVCenterBinding;-
1074 d->origBaselineBinding = acp->origBaselineBinding;-
1075-
1076 d->origWidth = acp->origWidth;-
1077 d->origHeight = acp->origHeight;-
1078 d->origX = acp->origX;-
1079 d->origY = acp->origY;-
1080-
1081-
1082-
1083 acp->leftBinding = nullptr;-
1084 acp->rightBinding = nullptr;-
1085 acp->hCenterBinding = nullptr;-
1086 acp->topBinding = nullptr;-
1087 acp->bottomBinding = nullptr;-
1088 acp->vCenterBinding = nullptr;-
1089 acp->baselineBinding = nullptr;-
1090 acp->origLeftBinding = nullptr;-
1091 acp->origRightBinding = nullptr;-
1092 acp->origHCenterBinding = nullptr;-
1093 acp->origTopBinding = nullptr;-
1094 acp->origBottomBinding = nullptr;-
1095 acp->origVCenterBinding = nullptr;-
1096 acp->origBaselineBinding = nullptr;-
1097-
1098 saveCurrentValues();-
1099}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
4
1100-
1101void QQuickAnchorChanges::clearBindings()-
1102{-
1103 QQuickAnchorChangesPrivate * const d = d_func();-
1104 if (!d->target
!d->targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstates
FALSEevaluated 80 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
2-80
1105 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickstates
2
1106-
1107-
1108 d->fromX = d->target->x();-
1109 d->fromY = d->target->y();-
1110 d->fromWidth = d->target->width();-
1111 d->fromHeight = d->target->height();-
1112-
1113 QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target);-
1114-
1115-
1116-
1117 QQuickAnchors::Anchors combined = d->anchorSet->d_func()->resetAnchors |-
1118 d->anchorSet->d_func()->usedAnchors;-
1119 if (d->applyOrigLeft
d->applyOrigLeftDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 68 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::LeftAnchor)) {
12-68
1120 targetPrivate->anchors()->resetLeft();-
1121 QQmlPropertyPrivate::removeBinding(d->leftProp);-
1122 }
executed 62 times by 3 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
62
1123 if (d->applyOrigRight
d->applyOrigRightDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 68 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::RightAnchor)) {
12-68
1124 targetPrivate->anchors()->resetRight();-
1125 QQmlPropertyPrivate::removeBinding(d->rightProp);-
1126 }
executed 64 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickstates
64
1127 if (d->applyOrigHCenter
d->applyOrigHCenterDescription
TRUEnever evaluated
FALSEevaluated 80 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::HCenterAnchor)) {
0-80
1128 targetPrivate->anchors()->resetHorizontalCenter();-
1129 QQmlPropertyPrivate::removeBinding(d->hCenterProp);-
1130 }
executed 16 times by 3 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
16
1131 if (d->applyOrigTop
d->applyOrigTopDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 68 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::TopAnchor)) {
12-68
1132 targetPrivate->anchors()->resetTop();-
1133 QQmlPropertyPrivate::removeBinding(d->topProp);-
1134 }
executed 38 times by 3 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquickstates
38
1135 if (d->applyOrigBottom
d->applyOrigBottomDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 68 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::BottomAnchor)) {
12-68
1136 targetPrivate->anchors()->resetBottom();-
1137 QQmlPropertyPrivate::removeBinding(d->bottomProp);-
1138 }
executed 38 times by 2 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickstates
38
1139 if (d->applyOrigVCenter
d->applyOrigVCenterDescription
TRUEnever evaluated
FALSEevaluated 80 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::VCenterAnchor)) {
0-80
1140 targetPrivate->anchors()->resetVerticalCenter();-
1141 QQmlPropertyPrivate::removeBinding(d->vCenterProp);-
1142 }
executed 14 times by 3 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
14
1143 if (d->applyOrigBaseline
d->applyOrigBaselineDescription
TRUEnever evaluated
FALSEevaluated 80 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
|| (combined & QQuickAnchors::BaselineAnchor)) {
0-80
1144 targetPrivate->anchors()->resetBaseline();-
1145 QQmlPropertyPrivate::removeBinding(d->baselineProp);-
1146 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstates
2
1147}
executed 80 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
80
1148-
1149bool QQuickAnchorChanges::mayOverride(QQuickStateActionEvent*other)-
1150{-
1151 if (other->type() != AnchorChanges
other->type() != AnchorChangesDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-4
1152 return
never executed: return false;
false;
never executed: return false;
0
1153 if (static_cast<
static_cast<QQ...this) == otherDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
QQuickStateActionEvent*>(this) == other
static_cast<QQ...this) == otherDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
0-4
1154 return
never executed: return true;
true;
never executed: return true;
0
1155 if (static_cast<
static_cast<QQ...() == object()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
QQuickAnchorChanges*>(other)->object() == object()
static_cast<QQ...() == object()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEnever evaluated
)
0-4
1156 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickanimations
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickanimations
4
1157 return
never executed: return false;
false;
never executed: return false;
0
1158}-
1159-
1160void QQuickAnchorChanges::rewind()-
1161{-
1162 QQuickAnchorChangesPrivate * const d = d_func();-
1163 if (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-10
1164 return;
never executed: return;
0
1165-
1166 QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target);-
1167-
1168-
1169 d->target->setX(d->rewindX);-
1170 d->target->setY(d->rewindY);-
1171 if (targetPrivate->widthValid
targetPrivate->widthValidDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-10
1172 d->target->setWidth(d->rewindWidth);-
1173 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
1174 if (targetPrivate->heightValid
targetPrivate->heightValidDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-10
1175 d->target->setHeight(d->rewindHeight);-
1176 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
1177}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
1178-
1179void QQuickAnchorChanges::saveCurrentValues()-
1180{-
1181 QQuickAnchorChangesPrivate * const d = d_func();-
1182 if (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 60 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
)
0-60
1183 return;
never executed: return;
0
1184-
1185 QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target);-
1186 d->rewindLeft = targetPrivate->anchors()->left();-
1187 d->rewindRight = targetPrivate->anchors()->right();-
1188 d->rewindHCenter = targetPrivate->anchors()->horizontalCenter();-
1189 d->rewindTop = targetPrivate->anchors()->top();-
1190 d->rewindBottom = targetPrivate->anchors()->bottom();-
1191 d->rewindVCenter = targetPrivate->anchors()->verticalCenter();-
1192 d->rewindBaseline = targetPrivate->anchors()->baseline();-
1193-
1194 d->rewindX = d->target->x();-
1195 d->rewindY = d->target->y();-
1196 d->rewindWidth = d->target->width();-
1197 d->rewindHeight = d->target->height();-
1198}
executed 60 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
60
1199-
1200void QQuickAnchorChanges::saveTargetValues()-
1201{-
1202 QQuickAnchorChangesPrivate * const d = d_func();-
1203 if (!d->target
!d->targetDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-10
1204 return;
never executed: return;
0
1205-
1206 d->toX = d->target->x();-
1207 d->toY = d->target->y();-
1208 d->toWidth = d->target->width();-
1209 d->toHeight = d->target->height();-
1210}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
1211-
1212-
1213-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0