OpenCoverage

qquicktranslate.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktranslate.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4class QQuickTranslatePrivate : public QQuickTransformPrivate-
5{-
6public:-
7 QQuickTranslatePrivate()-
8 : x(0), y(0) {}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem2
6
9-
10 qreal x;-
11 qreal y;-
12};-
13QQuickTranslate::QQuickTranslate(QObject *parent)-
14: QQuickTransform(*new QQuickTranslatePrivate, parent)-
15{-
16}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem2
6
17-
18-
19QQuickTranslate::~QQuickTranslate()-
20{-
21}-
22-
23-
24-
25-
26-
27-
28-
29qreal QQuickTranslate::x() const-
30{-
31 const QQuickTranslatePrivate * const d = d_func();-
32 return
never executed: return d->x;
d->x;
never executed: return d->x;
0
33}-
34-
35void QQuickTranslate::setX(qreal x)-
36{-
37 QQuickTranslatePrivate * const d = d_func();-
38 if (d->x == x
d->x == xDescription
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
)
0-6
39 return;
never executed: return;
0
40 d->x = x;-
41 update();-
42 xChanged();-
43}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem2
6
44qreal QQuickTranslate::y() const-
45{-
46 const QQuickTranslatePrivate * const d = d_func();-
47 return
never executed: return d->y;
d->y;
never executed: return d->y;
0
48}-
49void QQuickTranslate::setY(qreal y)-
50{-
51 QQuickTranslatePrivate * const d = d_func();-
52 if (d->y == y
d->y == yDescription
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
)
0-6
53 return;
never executed: return;
0
54 d->y = y;-
55 update();-
56 yChanged();-
57}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem2
6
58-
59void QQuickTranslate::applyTo(QMatrix4x4 *matrix) const-
60{-
61 const QQuickTranslatePrivate * const d = d_func();-
62 matrix->translate(d->x, d->y, 0);-
63}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem2
6
64-
65class QQuickScalePrivate : public QQuickTransformPrivate-
66{-
67public:-
68 QQuickScalePrivate()-
69 : xScale(1), yScale(1), zScale(1) {}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickstates
8
70 QVector3D origin;-
71 qreal xScale;-
72 qreal yScale;-
73 qreal zScale;-
74};-
75QQuickScale::QQuickScale(QObject *parent)-
76 : QQuickTransform(*new QQuickScalePrivate, parent)-
77{-
78}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickstates
8
79-
80QQuickScale::~QQuickScale()-
81{-
82}-
83QVector3D QQuickScale::origin() const-
84{-
85 const QQuickScalePrivate * const d = d_func();-
86 return
never executed: return d->origin;
d->origin;
never executed: return d->origin;
0
87}-
88void QQuickScale::setOrigin(const QVector3D &point)-
89{-
90 QQuickScalePrivate * const d = d_func();-
91 if (d->origin == point
d->origin == pointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
92 return;
never executed: return;
0
93 d->origin = point;-
94 update();-
95 originChanged();-
96}
never executed: end of block
0
97qreal QQuickScale::xScale() const-
98{-
99 const QQuickScalePrivate * const d = d_func();-
100 return
never executed: return d->xScale;
d->xScale;
never executed: return d->xScale;
0
101}-
102void QQuickScale::setXScale(qreal scale)-
103{-
104 QQuickScalePrivate * const d = d_func();-
105 if (d->xScale == scale
d->xScale == scaleDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickitem
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquickstates
)
2-6
106 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickitem
2
107 d->xScale = scale;-
108 update();-
109 xScaleChanged();-
110 scaleChanged();-
111}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquickstates
6
112qreal QQuickScale::yScale() const-
113{-
114 const QQuickScalePrivate * const d = d_func();-
115 return
never executed: return d->yScale;
d->yScale;
never executed: return d->yScale;
0
116}-
117void QQuickScale::setYScale(qreal scale)-
118{-
119 QQuickScalePrivate * const d = d_func();-
120 if (d->yScale == scale
d->yScale == scaleDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickitem
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquickstates
)
2-6
121 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickitem
2
122 d->yScale = scale;-
123 update();-
124 yScaleChanged();-
125 scaleChanged();-
126}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquickstates
6
127-
128qreal QQuickScale::zScale() const-
129{-
130 const QQuickScalePrivate * const d = d_func();-
131 return
never executed: return d->zScale;
d->zScale;
never executed: return d->zScale;
0
132}-
133void QQuickScale::setZScale(qreal scale)-
134{-
135 QQuickScalePrivate * const d = d_func();-
136 if (d->zScale == scale
d->zScale == scaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
137 return;
never executed: return;
0
138 d->zScale = scale;-
139 update();-
140 zScaleChanged();-
141 scaleChanged();-
142}
never executed: end of block
0
143-
144void QQuickScale::applyTo(QMatrix4x4 *matrix) const-
145{-
146 const QQuickScalePrivate * const d = d_func();-
147 matrix->translate(d->origin);-
148 matrix->scale(d->xScale, d->yScale, d->zScale);-
149 matrix->translate(-d->origin);-
150}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquickstates
6
151-
152class QQuickRotationPrivate : public QQuickTransformPrivate-
153{-
154public:-
155 QQuickRotationPrivate()-
156 : angle(0), axis(0, 0, 1) {}
executed 838 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickpathview
  • tst_qquickstates
838
157 QVector3D origin;-
158 qreal angle;-
159 QVector3D axis;-
160};-
161QQuickRotation::QQuickRotation(QObject *parent)-
162 : QQuickTransform(*new QQuickRotationPrivate, parent)-
163{-
164}
executed 838 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickpathview
  • tst_qquickstates
838
165-
166QQuickRotation::~QQuickRotation()-
167{-
168}-
169QVector3D QQuickRotation::origin() const-
170{-
171 const QQuickRotationPrivate * const d = d_func();-
172 return
executed 2468 times by 3 tests: return d->origin;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
d->origin;
executed 2468 times by 3 tests: return d->origin;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
2468
173}-
174-
175void QQuickRotation::setOrigin(const QVector3D &point)-
176{-
177 QQuickRotationPrivate * const d = d_func();-
178 if (d->origin == point
d->origin == pointDescription
TRUEevaluated 822 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
FALSEevaluated 1646 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
)
822-1646
179 return;
executed 822 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
822
180 d->origin = point;-
181 update();-
182 originChanged();-
183}
executed 1646 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
1646
184-
185-
186-
187-
188-
189-
190qreal QQuickRotation::angle() const-
191{-
192 const QQuickRotationPrivate * const d = d_func();-
193 return
executed 8 times by 2 tests: return d->angle;
Executed by:
  • tst_examples
  • tst_qquickflipable
d->angle;
executed 8 times by 2 tests: return d->angle;
Executed by:
  • tst_examples
  • tst_qquickflipable
8
194}-
195void QQuickRotation::setAngle(qreal angle)-
196{-
197 QQuickRotationPrivate * const d = d_func();-
198 if (d->angle == angle
d->angle == angleDescription
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickpathview
  • tst_qquickstates
)
18-88
199 return;
executed 18 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
18
200 d->angle = angle;-
201 update();-
202 angleChanged();-
203}
executed 88 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickpathview
  • tst_qquickstates
88
204QVector3D QQuickRotation::axis() const-
205{-
206 const QQuickRotationPrivate * const d = d_func();-
207 return
executed 838 times by 4 tests: return d->axis;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
  • tst_qquickstates
d->axis;
executed 838 times by 4 tests: return d->axis;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
  • tst_qquickstates
838
208}-
209void QQuickRotation::setAxis(const QVector3D &axis)-
210{-
211 QQuickRotationPrivate * const d = d_func();-
212 if (d->axis == axis
d->axis == axisDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 834 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
  • tst_qquickstates
)
4-834
213 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_examples
4
214 d->axis = axis;-
215 update();-
216 axisChanged();-
217}
executed 834 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
  • tst_qquickstates
834
218-
219void QQuickRotation::setAxis(Qt::Axis axis)-
220{-
221 switch (axis)-
222 {-
223 case
never executed: case Qt::XAxis:
Qt::XAxis:
never executed: case Qt::XAxis:
0
224 setAxis(QVector3D(1, 0, 0));-
225 break;
never executed: break;
0
226 case
never executed: case Qt::YAxis:
Qt::YAxis:
never executed: case Qt::YAxis:
0
227 setAxis(QVector3D(0, 1, 0));-
228 break;
never executed: break;
0
229 case
never executed: case Qt::ZAxis:
Qt::ZAxis:
never executed: case Qt::ZAxis:
0
230 setAxis(QVector3D(0, 0, 1));-
231 break;
never executed: break;
0
232 }-
233}
never executed: end of block
0
234-
235class QGraphicsRotation {-
236public:-
237 static inline void projectedRotate(QMatrix4x4 *matrix, qreal angle, qreal x, qreal y, qreal z)-
238 {-
239 matrix->projectedRotate(angle, x, y, z);-
240 }
executed 41 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickstates
41
241};-
242-
243void QQuickRotation::applyTo(QMatrix4x4 *matrix) const-
244{-
245 const QQuickRotationPrivate * const d = d_func();-
246-
247 if (d->angle == 0.
d->angle == 0.Description
TRUEevaluated 338 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
FALSEevaluated 41 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickstates
|| d->axis.isNull()
d->axis.isNull()Description
TRUEnever evaluated
FALSEevaluated 41 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickstates
)
0-338
248 return;
executed 338 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickpathview
338
249-
250 matrix->translate(d->origin);-
251 QGraphicsRotation::projectedRotate(matrix, d->angle, d->axis.x(), d->axis.y(), d->axis.z());-
252 matrix->translate(-d->origin);-
253}
executed 41 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflipable
  • tst_qquickitem2
  • tst_qquickstates
41
254-
255class QQuickMatrix4x4Private : public QQuickTransformPrivate-
256{-
257public:-
258 QQuickMatrix4x4Private()-
259 : matrix() {}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_multipointtoucharea_interop
  • tst_qquickitem2
6
260 QMatrix4x4 matrix;-
261};-
262QQuickMatrix4x4::QQuickMatrix4x4(QObject *parent)-
263 : QQuickTransform(*new QQuickMatrix4x4Private, parent)-
264{-
265}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_multipointtoucharea_interop
  • tst_qquickitem2
6
266-
267QQuickMatrix4x4::~QQuickMatrix4x4()-
268{-
269}-
270-
271-
272-
273-
274-
275-
276QMatrix4x4 QQuickMatrix4x4::matrix() const-
277{-
278 const QQuickMatrix4x4Private * const d = d_func();-
279 return
never executed: return d->matrix;
d->matrix;
never executed: return d->matrix;
0
280}-
281-
282void QQuickMatrix4x4::setMatrix(const QMatrix4x4 &matrix)-
283{-
284 QQuickMatrix4x4Private * const d = d_func();-
285 if (d->matrix == matrix
d->matrix == matrixDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickitem2
)
0-2
286 return;
never executed: return;
0
287 d->matrix = matrix;-
288 update();-
289 matrixChanged();-
290}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickitem2
2
291-
292void QQuickMatrix4x4::applyTo(QMatrix4x4 *matrix) const-
293{-
294 const QQuickMatrix4x4Private * const d = d_func();-
295 *matrix *= d->matrix;-
296}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickitem2
2
297-
298-
299-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0