OpenCoverage

qquickhandlerpoint.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/handlers/qquickhandlerpoint.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3extern const QLoggingCategory &DBG_TOUCH_TARGET();-
4QQuickHandlerPoint::QQuickHandlerPoint()-
5 : m_id(0)-
6 , m_rotation(0)-
7 , m_pressure(0)-
8{}
executed 3062 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
3062
9-
10void QQuickHandlerPoint::reset()-
11{-
12 m_id = 0;-
13 m_uniqueId = QPointingDeviceUniqueId();-
14 m_position = QPointF();-
15 m_scenePosition = QPointF();-
16 m_pressPosition = QPointF();-
17 m_scenePressPosition = QPointF();-
18 m_sceneGrabPosition = QPointF();-
19 m_velocity = QVector2D();-
20 m_rotation = 0;-
21 m_pressure = 0;-
22 m_ellipseDiameters = QSizeF();-
23 m_pressedButtons = Qt::NoButton;-
24 m_pressedModifiers = Qt::NoModifier;-
25}
executed 548 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
548
26-
27void QQuickHandlerPoint::reset(const QQuickEventPoint *point)-
28{-
29 m_id = point->pointId();-
30 const QQuickPointerEvent *event = point->pointerEvent();-
31 switch (point->state()) {-
32 case
executed 234 times by 4 tests: case QQuickEventPoint::Pressed:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
QQuickEventPoint::Pressed:
executed 234 times by 4 tests: case QQuickEventPoint::Pressed:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
234
33 m_pressPosition = point->position();-
34 m_scenePressPosition = point->scenePosition();-
35 m_pressedButtons = event->buttons();-
36 break;
executed 234 times by 4 tests: break;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
234
37 case
executed 200 times by 4 tests: case QQuickEventPoint::Released:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
QQuickEventPoint::Released:
executed 200 times by 4 tests: case QQuickEventPoint::Released:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
200
38 reset();-
39 return;
executed 200 times by 4 tests: return;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
200
40 default
executed 1278 times by 4 tests: default:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
:
executed 1278 times by 4 tests: default:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1278
41 m_pressedButtons = event->buttons();-
42 break;
executed 1278 times by 4 tests: break;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1278
43 }-
44 m_pressedModifiers = event->modifiers();-
45 if (event->asPointerTouchEvent()
event->asPointerTouchEvent()Description
TRUEevaluated 1320 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 192 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
192-1320
46 const QQuickEventTouchPoint *tp = static_cast<const QQuickEventTouchPoint *>(point);-
47 m_uniqueId = tp->uniqueId();-
48 m_rotation = tp->rotation();-
49 m_pressure = tp->pressure();-
50 m_ellipseDiameters = tp->ellipseDiameters();-
51 }
executed 1320 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
else if (event->asPointerTabletEvent()
event->asPointerTabletEvent()Description
TRUEnever evaluated
FALSEevaluated 192 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
0-1320
52-
53 }
never executed: end of block
else {
0
54 m_uniqueId = event->device()->uniqueId();-
55 m_rotation = 0;-
56 m_pressure = event->buttons()
event->buttons()Description
TRUEevaluated 192 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEnever evaluated
? 1 : 0;
0-192
57 m_ellipseDiameters = QSizeF();-
58 }
executed 192 times by 3 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
192
59 m_position = point->position();-
60 m_scenePosition = point->scenePosition();-
61 if (point->state() == QQuickEventPoint::Updated
point->state()...Point::UpdatedDescription
TRUEevaluated 1266 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 246 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
)
246-1266
62 m_velocity = point->velocity();
executed 1266 times by 4 tests: m_velocity = point->velocity();
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1266
63}
executed 1512 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1512
64-
65void QQuickHandlerPoint::reset(const QVector<QQuickEventPoint *> &points)-
66{-
67 if (points.isEmpty()
points.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
) {
0-31
68 QMessageLogger(__FILE__, 139, __PRETTY_FUNCTION__).warning("reset: no points");-
69 return;
never executed: return;
0
70 }-
71 if (points.count() == 1
points.count() == 1Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
) {
0-31
72 reset(points.first());-
73 return;
never executed: return;
0
74 }-
75-
76 const QQuickPointerEvent *event = points.first()->pointerEvent();-
77 QPointF posSum;-
78 QPointF scenePosSum;-
79 QVector2D velocitySum;-
80 qreal pressureSum = 0;-
81 QSizeF ellipseDiameterSum;-
82 bool press = false;-
83 const QQuickPointerTouchEvent *touchEvent = event->asPointerTouchEvent();-
84 for (const QQuickEventPoint *point : qAsConst(points)) {-
85 posSum += point->position();-
86 scenePosSum += point->scenePosition();-
87 velocitySum += point->velocity();-
88 if (touchEvent
touchEventDescription
TRUEevaluated 93 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
FALSEnever evaluated
) {
0-93
89 pressureSum += static_cast<const QQuickEventTouchPoint *>(point)->pressure();-
90 ellipseDiameterSum += static_cast<const QQuickEventTouchPoint *>(point)->ellipseDiameters();-
91 }
executed 93 times by 1 test: end of block
Executed by:
  • tst_multipointtoucharea_interop
93
92 if (point->state() == QQuickEventPoint::Pressed
point->state()...Point::PressedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
FALSEevaluated 91 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
)
2-91
93 press = true;
executed 2 times by 1 test: press = true;
Executed by:
  • tst_multipointtoucharea_interop
2
94 }
executed 93 times by 1 test: end of block
Executed by:
  • tst_multipointtoucharea_interop
93
95 m_id = 0;-
96 m_uniqueId = QPointingDeviceUniqueId();-
97 m_pressedButtons = event->buttons();-
98 m_pressedModifiers = event->modifiers();-
99 m_position = posSum / points.size();-
100 m_scenePosition = scenePosSum / points.size();-
101 if (press
pressDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
FALSEevaluated 29 times by 1 test
Evaluated by:
  • tst_multipointtoucharea_interop
) {
2-29
102 m_pressPosition = m_position;-
103 m_scenePressPosition = m_scenePosition;-
104 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_multipointtoucharea_interop
2
105 m_velocity = velocitySum / points.size();-
106 m_rotation = 0;-
107 m_pressure = pressureSum / points.size();-
108 m_ellipseDiameters = ellipseDiameterSum / points.size();-
109}
executed 31 times by 1 test: end of block
Executed by:
  • tst_multipointtoucharea_interop
31
110-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0