qline.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qline.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QDebug operator<<(QDebug dbg, const QLine &p)-
4{-
5 QDebugStateSaver saver(dbg);-
6 dbg.nospace() << "QLine(" << p.p1() << ',' << p.p2() << ')';-
7 return
executed 2 times by 2 tests: return dbg;
Executed by:
  • tst_QDebug
  • tst_QVariant
dbg;
executed 2 times by 2 tests: return dbg;
Executed by:
  • tst_QDebug
  • tst_QVariant
2
8}-
9QDataStream &operator<<(QDataStream &stream, const QLine &line)-
10{-
11 stream << line.p1() << line.p2();-
12 return
executed 3 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
stream;
executed 3 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
3
13}-
14QDataStream &operator>>(QDataStream &stream, QLine &line)-
15{-
16 QPoint p1, p2;-
17 stream >> p1;-
18 stream >> p2;-
19 line = QLine(p1, p2);-
20-
21 return
executed 7 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
stream;
executed 7 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
7
22}-
23qreal QLineF::length() const-
24{-
25 qreal x = pt2.x() - pt1.x();-
26 qreal y = pt2.y() - pt1.y();-
27 return
executed 133358 times by 22 tests: return qSqrt(x*x + y*y);
Executed by:
  • tst_QAccessibility
  • tst_QBrush
  • tst_QCheckBox
  • tst_QDataStream
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QPrinter
  • tst_QProgressBar
  • tst_QStyle
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
qSqrt(x*x + y*y);
executed 133358 times by 22 tests: return qSqrt(x*x + y*y);
Executed by:
  • tst_QAccessibility
  • tst_QBrush
  • tst_QCheckBox
  • tst_QDataStream
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QPrinter
  • tst_QProgressBar
  • tst_QStyle
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
133358
28}-
29qreal QLineF::angle() const-
30{-
31 const qreal dx = pt2.x() - pt1.x();-
32 const qreal dy = pt2.y() - pt1.y();-
33-
34 const qreal theta = qAtan2(-dy, dx) * 360.0 / 6.28318530717958647692528676655900576;-
35-
36 const qreal theta_normalized = theta < 0
theta < 0Description
TRUEevaluated 53865 times by 16 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 54312 times by 11 tests
Evaluated by:
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
? theta + 360 : theta;
53865-54312
37-
38 if (qFuzzyCompare(theta_normalized, qreal(360))
qFuzzyCompare(...d, qreal(360))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QLine
FALSEevaluated 108175 times by 16 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
2-108175
39 return
executed 2 times by 1 test: return qreal(0);
Executed by:
  • tst_QLine
qreal(0);
executed 2 times by 1 test: return qreal(0);
Executed by:
  • tst_QLine
2
40 else-
41 return
executed 108175 times by 16 tests: return theta_normalized;
Executed by:
  • tst_QCheckBox
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
theta_normalized;
executed 108175 times by 16 tests: return theta_normalized;
Executed by:
  • tst_QCheckBox
  • tst_QGestureRecognizer
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
108175
42}-
43void QLineF::setAngle(qreal angle)-
44{-
45 const qreal angleR = angle * 6.28318530717958647692528676655900576 / 360.0;-
46 const qreal l = length();-
47-
48 const qreal dx = qCos(angleR) * l;-
49 const qreal dy = -qSin(angleR) * l;-
50-
51 pt2.rx() = pt1.x() + dx;-
52 pt2.ry() = pt1.y() + dy;-
53}
executed 1804 times by 1 test: end of block
Executed by:
  • tst_QLine
1804
54QLineF QLineF::fromPolar(qreal length, qreal angle)-
55{-
56 const qreal angleR = angle * 6.28318530717958647692528676655900576 / 360.0;-
57 return
executed 4169 times by 2 tests: return QLineF(0, 0, qCos(angleR) * length, -qSin(angleR) * length);
Executed by:
  • tst_QLine
  • tst_QPainterPath
QLineF(0, 0, qCos(angleR) * length, -qSin(angleR) * length);
executed 4169 times by 2 tests: return QLineF(0, 0, qCos(angleR) * length, -qSin(angleR) * length);
Executed by:
  • tst_QLine
  • tst_QPainterPath
4169
58}-
59-
60-
61-
62-
63-
64-
65-
66QLineF QLineF::unitVector() const-
67{-
68 qreal x = pt2.x() - pt1.x();-
69 qreal y = pt2.y() - pt1.y();-
70-
71 qreal len = qSqrt(x*x + y*y);-
72 QLineF f(p1(), QPointF(pt1.x() + x/len, pt1.y() + y/len));-
73-
74-
75 if (qAbs(f.length() - 1) >= 0.001
qAbs(f.length() - 1) >= 0.001Description
TRUEnever evaluated
FALSEevaluated 102875 times by 16 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
0-102875
76 QMessageLogger(__FILE__, 641, __PRETTY_FUNCTION__).warning("QLine::unitVector: New line does not have unit length");
never executed: QMessageLogger(__FILE__, 641, __PRETTY_FUNCTION__).warning("QLine::unitVector: New line does not have unit length");
0
77-
78-
79 return
executed 102875 times by 16 tests: return f;
Executed by:
  • tst_QAccessibility
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
f;
executed 102875 times by 16 tests: return f;
Executed by:
  • tst_QAccessibility
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
102875
80}-
81QLineF::IntersectType QLineF::intersect(const QLineF &l, QPointF *intersectionPoint) const-
82{-
83-
84 const QPointF a = pt2 - pt1;-
85 const QPointF b = l.pt1 - l.pt2;-
86 const QPointF c = pt1 - l.pt1;-
87-
88 const qreal denominator = a.y() * b.x() - a.x() * b.y();-
89 if (denominator == 0
denominator == 0Description
TRUEevaluated 3700 times by 9 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsItem
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QLine
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
FALSEevaluated 53468 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
|| !qt_is_finite(denominator)
!qt_is_finite(denominator)Description
TRUEnever evaluated
FALSEevaluated 53468 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
0-53468
90 return
executed 3700 times by 9 tests: return NoIntersection;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsItem
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QLine
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
NoIntersection;
executed 3700 times by 9 tests: return NoIntersection;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsItem
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QLine
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
3700
91-
92 const qreal reciprocal = 1 / denominator;-
93 const qreal na = (b.y() * c.x() - b.x() * c.y()) * reciprocal;-
94 if (intersectionPoint
intersectionPointDescription
TRUEevaluated 53468 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
FALSEnever evaluated
)
0-53468
95 *
executed 53468 times by 15 tests: *intersectionPoint = pt1 + a * na;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
intersectionPoint = pt1 + a * na;
executed 53468 times by 15 tests: *intersectionPoint = pt1 + a * na;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
53468
96-
97 if (na < 0
na < 0Description
TRUEevaluated 36 times by 6 tests
Evaluated by:
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QTouchEvent
  • tst_QTreeWidget
FALSEevaluated 53432 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
|| na > 1
na > 1Description
TRUEevaluated 26230 times by 14 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 27202 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
36-53432
98 return
executed 26266 times by 14 tests: return UnboundedIntersection;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
UnboundedIntersection;
executed 26266 times by 14 tests: return UnboundedIntersection;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
26266
99-
100 const qreal nb = (a.x() * c.y() - a.y() * c.x()) * reciprocal;-
101 if (nb < 0
nb < 0Description
TRUEnever evaluated
FALSEevaluated 27202 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
|| nb > 1
nb > 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLine
FALSEevaluated 27201 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
0-27202
102 return
executed 1 time by 1 test: return UnboundedIntersection;
Executed by:
  • tst_QLine
UnboundedIntersection;
executed 1 time by 1 test: return UnboundedIntersection;
Executed by:
  • tst_QLine
1
103-
104 return
executed 27201 times by 15 tests: return BoundedIntersection;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
BoundedIntersection;
executed 27201 times by 15 tests: return BoundedIntersection;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
27201
105}-
106qreal QLineF::angleTo(const QLineF &l) const-
107{-
108 if (isNull()
isNull()Description
TRUEnever evaluated
FALSEevaluated 52787 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
|| l.isNull()
l.isNull()Description
TRUEnever evaluated
FALSEevaluated 52787 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
0-52787
109 return
never executed: return 0;
0;
never executed: return 0;
0
110-
111 const qreal a1 = angle();-
112 const qreal a2 = l.angle();-
113-
114 const qreal delta = a2 - a1;-
115 const qreal delta_normalized = delta < 0
delta < 0Description
TRUEevaluated 19559 times by 10 tests
Evaluated by:
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
FALSEevaluated 33228 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
? delta + 360 : delta;
19559-33228
116-
117 if (qFuzzyCompare(delta, qreal(360))
qFuzzyCompare(...a, qreal(360))Description
TRUEnever evaluated
FALSEevaluated 52787 times by 15 tests
Evaluated by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
)
0-52787
118 return
never executed: return 0;
0;
never executed: return 0;
0
119 else-
120 return
executed 52787 times by 15 tests: return delta_normalized;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
delta_normalized;
executed 52787 times by 15 tests: return delta_normalized;
Executed by:
  • tst_QCheckBox
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLine
  • tst_QMdiSubWindow
  • tst_QPainter
  • tst_QPainterPath
  • tst_QTouchEvent
  • tst_QTreeView
  • tst_QTreeWidget
52787
121}-
122qreal QLineF::angle(const QLineF &l) const-
123{-
124 if (isNull()
isNull()Description
TRUEnever evaluated
FALSEevaluated 183 times by 1 test
Evaluated by:
  • tst_QLine
|| l.isNull()
l.isNull()Description
TRUEnever evaluated
FALSEevaluated 183 times by 1 test
Evaluated by:
  • tst_QLine
)
0-183
125 return
never executed: return 0;
0;
never executed: return 0;
0
126 qreal cos_line = (dx()*l.dx() + dy()*l.dy()) / (length()*l.length());-
127 qreal rad = 0;-
128-
129 if (cos_line >= -1.0
cos_line >= -1.0Description
TRUEevaluated 183 times by 1 test
Evaluated by:
  • tst_QLine
FALSEnever evaluated
&& cos_line <= 1.0
cos_line <= 1.0Description
TRUEevaluated 182 times by 1 test
Evaluated by:
  • tst_QLine
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLine
) rad = qAcos( cos_line );
executed 182 times by 1 test: rad = qAcos( cos_line );
Executed by:
  • tst_QLine
0-183
130 return
executed 183 times by 1 test: return rad * 360 / 6.28318530717958647692528676655900576;
Executed by:
  • tst_QLine
rad * 360 / 6.28318530717958647692528676655900576;
executed 183 times by 1 test: return rad * 360 / 6.28318530717958647692528676655900576;
Executed by:
  • tst_QLine
183
131}-
132-
133-
134-
135QDebug operator<<(QDebug dbg, const QLineF &p)-
136{-
137 QDebugStateSaver saver(dbg);-
138 dbg.nospace() << "QLineF(" << p.p1() << ',' << p.p2() << ')';-
139 return
executed 2 times by 2 tests: return dbg;
Executed by:
  • tst_QDebug
  • tst_QVariant
dbg;
executed 2 times by 2 tests: return dbg;
Executed by:
  • tst_QDebug
  • tst_QVariant
2
140}-
141QDataStream &operator<<(QDataStream &stream, const QLineF &line)-
142{-
143 stream << line.p1() << line.p2();-
144 return
executed 3 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
stream;
executed 3 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
3
145}-
146QDataStream &operator>>(QDataStream &stream, QLineF &line)-
147{-
148 QPointF start, end;-
149 stream >> start;-
150 stream >> end;-
151 line = QLineF(start, end);-
152-
153 return
executed 7 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
stream;
executed 7 times by 2 tests: return stream;
Executed by:
  • tst_QMetaType
  • tst_QVariant
7
154}-
155-
156-
157-
158-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9