OpenCoverage

qquickpathinterpolator.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickpathinterpolator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QQuickPathInterpolator::QQuickPathInterpolator(QObject *parent) :-
5 QObject(parent), _path(nullptr), _x(0), _y(0), _angle(0), _progress(0)-
6{-
7}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
8-
9-
10-
11-
12-
13-
14-
15QQuickPath *QQuickPathInterpolator::path() const-
16{-
17 return
never executed: return _path;
_path;
never executed: return _path;
0
18}-
19-
20void QQuickPathInterpolator::setPath(QQuickPath *path)-
21{-
22 if (_path == path
_path == pathDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-10
23 return;
never executed: return;
0
24 if (_path
_pathDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-10
25 disconnect(_path, qFlagLocation("2""changed()" "\0" __FILE__ ":" "82"), this, qFlagLocation("1""_q_pathUpdated()" "\0" __FILE__ ":" "82"));
never executed: disconnect(_path, qFlagLocation("2""changed()" "\0" __FILE__ ":" "82"), this, qFlagLocation("1""_q_pathUpdated()" "\0" __FILE__ ":" "82"));
0
26 _path = path;-
27 connect(_path, qFlagLocation("2""changed()" "\0" __FILE__ ":" "84"), this, qFlagLocation("1""_q_pathUpdated()" "\0" __FILE__ ":" "84"));-
28 pathChanged();-
29}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
10
30qreal QQuickPathInterpolator::progress() const-
31{-
32 return
executed 24 times by 1 test: return _progress;
Executed by:
  • tst_qquickanimations
_progress;
executed 24 times by 1 test: return _progress;
Executed by:
  • tst_qquickanimations
24
33}-
34-
35void QQuickPathInterpolator::setProgress(qreal progress)-
36{-
37 progress = qMin(qMax(progress, (qreal)0.0), (qreal)1.0);-
38-
39 if (progress == _progress
progress == _progressDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
4-16
40 return;
executed 4 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimations
4
41 _progress = progress;-
42 progressChanged();-
43 _q_pathUpdated();-
44}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
16
45-
46-
47-
48-
49-
50-
51-
52qreal QQuickPathInterpolator::x() const-
53{-
54 return
executed 26 times by 2 tests: return _x;
Executed by:
  • tst_examples
  • tst_qquickanimations
_x;
executed 26 times by 2 tests: return _x;
Executed by:
  • tst_examples
  • tst_qquickanimations
26
55}-
56-
57qreal QQuickPathInterpolator::y() const-
58{-
59 return
executed 26 times by 2 tests: return _y;
Executed by:
  • tst_examples
  • tst_qquickanimations
_y;
executed 26 times by 2 tests: return _y;
Executed by:
  • tst_examples
  • tst_qquickanimations
26
60}-
61qreal QQuickPathInterpolator::angle() const-
62{-
63 return
executed 24 times by 2 tests: return _angle;
Executed by:
  • tst_examples
  • tst_qquickanimations
_angle;
executed 24 times by 2 tests: return _angle;
Executed by:
  • tst_examples
  • tst_qquickanimations
24
64}-
65-
66void QQuickPathInterpolator::_q_pathUpdated()-
67{-
68 if (! _path
! _pathDescription
TRUEnever evaluated
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-26
69 return;
never executed: return;
0
70-
71 qreal angle = 0;-
72 const QPointF pt = _path->sequentialPointAt(_progress, &angle);-
73-
74 if (_x != pt.x()
_x != pt.x()Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
) {
2-24
75 _x = pt.x();-
76 xChanged();-
77 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
24
78-
79 if (_y != pt.y()
_y != pt.y()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
4-22
80 _y = pt.y();-
81 yChanged();-
82 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
22
83-
84-
85 angle = qreal(360) - angle;-
86 if (qFuzzyCompare(angle, qreal(360))
qFuzzyCompare(...e, qreal(360))Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
12-14
87 angle = qreal(0);
executed 12 times by 2 tests: angle = qreal(0);
Executed by:
  • tst_examples
  • tst_qquickanimations
12
88-
89 if (angle != _angle
angle != _angleDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
8-18
90 _angle = angle;-
91 angleChanged();-
92 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
18
93}
executed 26 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
26
94-
95-
96-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0