Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickpathinterpolator.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | QQuickPathInterpolator::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:
| 10 | ||||||
8 | - | |||||||
9 | - | |||||||
10 | - | |||||||
11 | - | |||||||
12 | - | |||||||
13 | - | |||||||
14 | - | |||||||
15 | QQuickPath *QQuickPathInterpolator::path() const | - | ||||||
16 | { | - | ||||||
17 | return never executed: _path;return _path; never executed: return _path; | 0 | ||||||
18 | } | - | ||||||
19 | - | |||||||
20 | void QQuickPathInterpolator::setPath(QQuickPath *path) | - | ||||||
21 | { | - | ||||||
22 | if (_path == path
| 0-10 | ||||||
23 | return; never executed: return; | 0 | ||||||
24 | if (_path
| 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:
| 10 | ||||||
30 | qreal QQuickPathInterpolator::progress() const | - | ||||||
31 | { | - | ||||||
32 | return executed 24 times by 1 test: _progress;return _progress; Executed by:
executed 24 times by 1 test: return _progress; Executed by:
| 24 | ||||||
33 | } | - | ||||||
34 | - | |||||||
35 | void QQuickPathInterpolator::setProgress(qreal progress) | - | ||||||
36 | { | - | ||||||
37 | progress = qMin(qMax(progress, (qreal)0.0), (qreal)1.0); | - | ||||||
38 | - | |||||||
39 | if (progress == _progress
| 4-16 | ||||||
40 | return; executed 4 times by 2 tests: return; Executed by:
| 4 | ||||||
41 | _progress = progress; | - | ||||||
42 | progressChanged(); | - | ||||||
43 | _q_pathUpdated(); | - | ||||||
44 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||
45 | - | |||||||
46 | - | |||||||
47 | - | |||||||
48 | - | |||||||
49 | - | |||||||
50 | - | |||||||
51 | - | |||||||
52 | qreal QQuickPathInterpolator::x() const | - | ||||||
53 | { | - | ||||||
54 | return executed 26 times by 2 tests: _x;return _x; Executed by:
executed 26 times by 2 tests: return _x; Executed by:
| 26 | ||||||
55 | } | - | ||||||
56 | - | |||||||
57 | qreal QQuickPathInterpolator::y() const | - | ||||||
58 | { | - | ||||||
59 | return executed 26 times by 2 tests: _y;return _y; Executed by:
executed 26 times by 2 tests: return _y; Executed by:
| 26 | ||||||
60 | } | - | ||||||
61 | qreal QQuickPathInterpolator::angle() const | - | ||||||
62 | { | - | ||||||
63 | return executed 24 times by 2 tests: _angle;return _angle; Executed by:
executed 24 times by 2 tests: return _angle; Executed by:
| 24 | ||||||
64 | } | - | ||||||
65 | - | |||||||
66 | void QQuickPathInterpolator::_q_pathUpdated() | - | ||||||
67 | { | - | ||||||
68 | if (! _path
| 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()
| 2-24 | ||||||
75 | _x = pt.x(); | - | ||||||
76 | xChanged(); | - | ||||||
77 | } executed 24 times by 2 tests: end of block Executed by:
| 24 | ||||||
78 | - | |||||||
79 | if (_y != pt.y()
| 4-22 | ||||||
80 | _y = pt.y(); | - | ||||||
81 | yChanged(); | - | ||||||
82 | } executed 22 times by 2 tests: end of block Executed by:
| 22 | ||||||
83 | - | |||||||
84 | - | |||||||
85 | angle = qreal(360) - angle; | - | ||||||
86 | if (qFuzzyCompare(angle, qreal(360))
| 12-14 | ||||||
87 | angle = qreal(0); executed 12 times by 2 tests: angle = qreal(0); Executed by:
| 12 | ||||||
88 | - | |||||||
89 | if (angle != _angle
| 8-18 | ||||||
90 | _angle = angle; | - | ||||||
91 | angleChanged(); | - | ||||||
92 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||
93 | } executed 26 times by 2 tests: end of block Executed by:
| 26 | ||||||
94 | - | |||||||
95 | - | |||||||
96 | - | |||||||
Switch to Source code | Preprocessed file |