OpenCoverage

qquicksinglepointhandler.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/handlers/qquicksinglepointhandler.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3extern const QLoggingCategory &DBG_TOUCH_TARGET();-
4QQuickSinglePointHandler::QQuickSinglePointHandler(QObject *parent)-
5 : QQuickPointerDeviceHandler(parent)-
6 , m_ignoreAdditionalPoints(false)-
7{-
8}
executed 1000 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1000
9-
10bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)-
11{-
12 if (!QQuickPointerDeviceHandler::wantsPointerEvent(event)
!QQuickPointer...erEvent(event)Description
TRUEnever evaluated
FALSEevaluated 2605 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
)
0-2605
13 return
never executed: return false;
false;
never executed: return false;
0
14 if (event->device()->pointerType() != QQuickPointerDevice::Finger
event->device(...Device::FingerDescription
TRUEevaluated 310 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 2295 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
&&
310-2295
15 (
(event->button...uttons()) == 0Description
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 252 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
event->buttons() & acceptedButtons()) == 0
(event->button...uttons()) == 0Description
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 252 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
&& (
(event->button...uttons()) == 0Description
TRUEnever evaluated
FALSEevaluated 58 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
event->button() & acceptedButtons()) == 0
(event->button...uttons()) == 0Description
TRUEnever evaluated
FALSEevaluated 58 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
)
0-252
16 return
never executed: return false;
false;
never executed: return false;
0
17-
18 if (m_pointInfo.m_id
m_pointInfo.m_idDescription
TRUEevaluated 1570 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 1035 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
1035-1570
19-
20-
21-
22 int candidatePointCount = 0;-
23 bool missing = true;-
24 QQuickEventPoint *point = nullptr;-
25 int c = event->pointCount();-
26 for (int i = 0; i < c
i < cDescription
TRUEevaluated 2532 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 1570 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
; ++i) {
1570-2532
27 QQuickEventPoint *p = event->point(i);-
28 const bool found = (p->pointId() == m_pointInfo.m_id);-
29 if (found
foundDescription
TRUEevaluated 1570 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 962 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
)
962-1570
30 missing = false;
executed 1570 times by 4 tests: missing = false;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1570
31 if (wantsEventPoint(p)
wantsEventPoint(p)Description
TRUEevaluated 1348 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 1184 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
1184-1348
32 ++candidatePointCount;-
33 if (found
foundDescription
TRUEevaluated 1286 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
)
62-1286
34 point = p;
executed 1286 times by 4 tests: point = p;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1286
35 }
executed 1348 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1348
36 }
executed 2532 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
2532
37 if (missing
missingDescription
TRUEnever evaluated
FALSEevaluated 1570 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
)
0-1570
38 for (bool qt_category_enabled = DBG_TOUCH_TARGET().isWarningEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 96, __PRETTY_FUNCTION__, DBG_TOUCH_TARGET().categoryName()).warning() << this << "pointId" << hex << m_pointInfo.m_id
never executed: QMessageLogger(__FILE__, 96, __PRETTY_FUNCTION__, DBG_TOUCH_TARGET().categoryName()).warning() << this << "pointId" << hex << m_pointInfo.m_id << "is missing from current event, but was neither canceled nor released";
0
39 << "is missing from current event, but was neither canceled nor released";
never executed: QMessageLogger(__FILE__, 96, __PRETTY_FUNCTION__, DBG_TOUCH_TARGET().categoryName()).warning() << this << "pointId" << hex << m_pointInfo.m_id << "is missing from current event, but was neither canceled nor released";
0
40 if (point
pointDescription
TRUEevaluated 1286 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 284 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
284-1286
41 if (candidatePointCount == 1
candidatePointCount == 1Description
TRUEevaluated 1260 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
|| (candidatePointCount > 1
candidatePointCount > 1Description
TRUEevaluated 26 times by 2 tests
Evaluated by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
FALSEnever evaluated
&& m_ignoreAdditionalPoints
m_ignoreAdditionalPointsDescription
TRUEnever evaluated
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
)) {
0-1260
42 point->setAccepted();-
43 return
executed 1260 times by 4 tests: return true;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
true;
executed 1260 times by 4 tests: return true;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1260
44 } else {-
45 point->cancelAllGrabs(this);-
46 }
executed 26 times by 2 tests: end of block
Executed by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
26
47 } else {-
48 return
executed 284 times by 3 tests: return false;
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
false;
executed 284 times by 3 tests: return false;
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
284
49 }-
50 } else {-
51-
52 int candidatePointCount = 0;-
53 int c = event->pointCount();-
54 QQuickEventPoint *chosen = nullptr;-
55 for (int i = 0; i < c
i < cDescription
TRUEevaluated 1937 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 1035 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
; ++i) {
1035-1937
56 QQuickEventPoint *p = event->point(i);-
57 if (!p->exclusiveGrabber()
!p->exclusiveGrabber()Description
TRUEevaluated 1506 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 431 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
&& wantsEventPoint(p)
wantsEventPoint(p)Description
TRUEevaluated 856 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 650 times by 3 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
431-1506
58 if (!chosen
!chosenDescription
TRUEevaluated 592 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 264 times by 2 tests
Evaluated by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
)
264-592
59 chosen = p;
executed 592 times by 4 tests: chosen = p;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
592
60 ++candidatePointCount;-
61 }
executed 856 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
856
62 }
executed 1937 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1937
63 if (chosen
chosenDescription
TRUEevaluated 592 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 443 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
&& candidatePointCount == 1
candidatePointCount == 1Description
TRUEevaluated 452 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 140 times by 2 tests
Evaluated by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
) {
140-592
64 setPointId(chosen->pointId());-
65 chosen->setAccepted();-
66 }
executed 452 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
452
67 }
executed 1035 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1035
68 return
executed 1061 times by 4 tests: return m_pointInfo.m_id;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
m_pointInfo.m_id;
executed 1061 times by 4 tests: return m_pointInfo.m_id;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1061
69}-
70-
71void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)-
72{-
73 QQuickPointerDeviceHandler::handlePointerEventImpl(event);-
74 QQuickEventPoint *currentPoint = event->pointById(m_pointInfo.m_id);-
75 ((currentPoint) ? static_cast<void>(0) : qt_assert("currentPoint", __FILE__, 133));-
76 if (!m_pointInfo.m_id
!m_pointInfo.m_idDescription
TRUEnever evaluated
FALSEevaluated 1712 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
|| !currentPoint->isAccepted()
!currentPoint->isAccepted()Description
TRUEnever evaluated
FALSEevaluated 1712 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
0-1712
77 reset();-
78 }
never executed: end of block
else {
0
79 m_pointInfo.reset(currentPoint);-
80 handleEventPoint(currentPoint);-
81 if (currentPoint->state() == QQuickEventPoint::Released
currentPoint->...oint::ReleasedDescription
TRUEevaluated 200 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
FALSEevaluated 1512 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
) {
200-1512
82 setExclusiveGrab(currentPoint, false);-
83 reset();-
84 }
executed 200 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
200
85 pointChanged();-
86 }
executed 1712 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
1712
87}-
88-
89void QQuickSinglePointHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabState stateChange, QQuickEventPoint *point)-
90{-
91 if (grabber != this
grabber != thisDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
FALSEevaluated 498 times by 4 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
)
22-498
92 return;
executed 22 times by 2 tests: return;
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
22
93 switch (stateChange) {-
94 case
executed 124 times by 4 tests: case QQuickEventPoint::GrabExclusive:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
QQuickEventPoint::GrabExclusive:
executed 124 times by 4 tests: case QQuickEventPoint::GrabExclusive:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
124
95 m_pointInfo.m_sceneGrabPosition = point->sceneGrabPosition();-
96 setActive(true);-
97 QQuickPointerHandler::onGrabChanged(grabber, stateChange, point);-
98 break;
executed 124 times by 4 tests: break;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
124
99 case
executed 176 times by 4 tests: case QQuickEventPoint::GrabPassive:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
QQuickEventPoint::GrabPassive:
executed 176 times by 4 tests: case QQuickEventPoint::GrabPassive:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
176
100 m_pointInfo.m_sceneGrabPosition = point->sceneGrabPosition();-
101 QQuickPointerHandler::onGrabChanged(grabber, stateChange, point);-
102 break;
executed 176 times by 4 tests: break;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
176
103 case
executed 50 times by 2 tests: case QQuickEventPoint::OverrideGrabPassive:
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
QQuickEventPoint::OverrideGrabPassive:
executed 50 times by 2 tests: case QQuickEventPoint::OverrideGrabPassive:
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
50
104 return;
executed 50 times by 2 tests: return;
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
50
105 case
never executed: case QQuickEventPoint::UngrabPassive:
QQuickEventPoint::UngrabPassive:
never executed: case QQuickEventPoint::UngrabPassive:
0
106 case
executed 114 times by 4 tests: case QQuickEventPoint::UngrabExclusive:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
QQuickEventPoint::UngrabExclusive:
executed 114 times by 4 tests: case QQuickEventPoint::UngrabExclusive:
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
114
107 case
executed 26 times by 2 tests: case QQuickEventPoint::CancelGrabPassive:
Executed by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
QQuickEventPoint::CancelGrabPassive:
executed 26 times by 2 tests: case QQuickEventPoint::CancelGrabPassive:
Executed by:
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
26
108 case
executed 8 times by 1 test: case QQuickEventPoint::CancelGrabExclusive:
Executed by:
  • tst_flickableinterop
QQuickEventPoint::CancelGrabExclusive:
executed 8 times by 1 test: case QQuickEventPoint::CancelGrabExclusive:
Executed by:
  • tst_flickableinterop
8
109-
110 QQuickPointerHandler::onGrabChanged(grabber, stateChange, point);-
111 reset();-
112 break;
executed 148 times by 4 tests: break;
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
148
113 }-
114 singlePointGrabChanged();-
115}
executed 448 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
448
116-
117void QQuickSinglePointHandler::setIgnoreAdditionalPoints(bool v)-
118{-
119 m_ignoreAdditionalPoints = v;-
120}
never executed: end of block
0
121-
122void QQuickSinglePointHandler::moveTarget(QPointF pos, QQuickEventPoint *point)-
123{-
124 target()->setPosition(pos);-
125 m_pointInfo.m_scenePosition = point->scenePosition();-
126 m_pointInfo.m_position = target()->mapFromScene(m_pointInfo.m_scenePosition);-
127}
executed 372 times by 3 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
372
128-
129void QQuickSinglePointHandler::setPointId(int id)-
130{-
131 m_pointInfo.m_id = id;-
132}
executed 452 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
452
133-
134void QQuickSinglePointHandler::reset()-
135{-
136 setActive(false);-
137 m_pointInfo.reset();-
138}
executed 348 times by 4 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquicktaphandler
348
139-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0