kernel/qgesturemanager.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3QGestureManager::QGestureManager(QObject *parent) -
4 : QObject(parent), state(NotGesture), m_lastCustomGestureId(Qt::CustomGesture) -
5{ -
6 qRegisterMetaType<Qt::GestureState>(); -
7 -
8 -
9 -
10 -
11 -
12 -
13 registerGestureRecognizer(new QPanGestureRecognizer); -
14 registerGestureRecognizer(new QPinchGestureRecognizer); -
15 registerGestureRecognizer(new QSwipeGestureRecognizer); -
16 registerGestureRecognizer(new QTapGestureRecognizer); -
17 -
18 -
19 -
20 -
21 -
22 -
23 -
24 registerGestureRecognizer(new QTapAndHoldGestureRecognizer); -
25 -
26}
executed: }
Execution Count:56
56
27 -
28QGestureManager::~QGestureManager() -
29{ -
30 qDeleteAll(m_recognizers.values()); -
31 for (QForeachContainer<__typeof__(m_obsoleteGestures.keys())> _container_(m_obsoleteGestures.keys()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGestureRecognizer *recognizer = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
32 qDeleteAll(m_obsoleteGestures.value(recognizer)); -
33 delete recognizer; -
34 }
executed: }
Execution Count:16
16
35 m_obsoleteGestures.clear(); -
36}
executed: }
Execution Count:56
56
37 -
38Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *recognizer) -
39{ -
40 QGesture *dummy = recognizer->create(0); -
41 if (!dummy) {
partially evaluated: !dummy
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:299
0-299
42 QMessageLogger("kernel/qgesturemanager.cpp", 113, __PRETTY_FUNCTION__).warning("QGestureManager::registerGestureRecognizer: " -
43 "the recognizer fails to create a gesture object, skipping registration."); -
44 return Qt::GestureType(0);
never executed: return Qt::GestureType(0);
0
45 } -
46 Qt::GestureType type = dummy->gestureType(); -
47 if (type == Qt::CustomGesture) {
evaluated: type == Qt::CustomGesture
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:282
17-282
48 -
49 ++m_lastCustomGestureId; -
50 type = Qt::GestureType(m_lastCustomGestureId); -
51 }
executed: }
Execution Count:17
17
52 m_recognizers.insertMulti(type, recognizer); -
53 delete dummy; -
54 return type;
executed: return type;
Execution Count:299
299
55} -
56 -
57void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type) -
58{ -
59 QList<QGestureRecognizer *> list = m_recognizers.values(type); -
60 while (QGestureRecognizer *recognizer = m_recognizers.take(type)) {
evaluated: QGestureRecognizer *recognizer = m_recognizers.take(type)
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:21
16-21
61 if (!m_obsoleteGestures.contains(recognizer)) {
partially evaluated: !m_obsoleteGestures.contains(recognizer)
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
62 -
63 m_obsoleteGestures.insert(recognizer, QSet<QGesture *>()); -
64 }
executed: }
Execution Count:16
16
65 }
executed: }
Execution Count:16
16
66 for (QForeachContainer<__typeof__(m_gestureToRecognizer.keys())> _container_(m_gestureToRecognizer.keys()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *g = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
67 QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g); -
68 if (list.contains(recognizer)) {
evaluated: list.contains(recognizer)
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:47
17-47
69 m_deletedRecognizers.insert(g, recognizer); -
70 }
executed: }
Execution Count:17
17
71 }
executed: }
Execution Count:64
64
72 -
73 QMap<ObjectGesture, QList<QGesture *> >::const_iterator iter = m_objectGestures.constBegin(); -
74 while (iter != m_objectGestures.constEnd()) {
evaluated: iter != m_objectGestures.constEnd()
TRUEFALSE
yes
Evaluation Count:96
yes
Evaluation Count:21
21-96
75 ObjectGesture objectGesture = iter.key(); -
76 if (objectGesture.gesture == type) {
evaluated: objectGesture.gesture == type
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:80
16-80
77 for (QForeachContainer<__typeof__(iter.value())> _container_(iter.value()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *g = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
78 if (QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g)) {
partially evaluated: QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g)
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-17
79 m_gestureToRecognizer.remove(g); -
80 m_obsoleteGestures[recognizer].insert(g); -
81 }
executed: }
Execution Count:17
17
82 }
executed: }
Execution Count:17
17
83 }
executed: }
Execution Count:16
16
84 ++iter; -
85 }
executed: }
Execution Count:96
96
86}
executed: }
Execution Count:21
21
87 -
88void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType type) -
89{ -
90 QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin(); -
91 while (iter != m_objectGestures.end()) {
evaluated: iter != m_objectGestures.end()
TRUEFALSE
yes
Evaluation Count:12171
yes
Evaluation Count:5516
5516-12171
92 ObjectGesture objectGesture = iter.key(); -
93 if (objectGesture.gesture == type && target == objectGesture.object) {
evaluated: objectGesture.gesture == type
TRUEFALSE
yes
Evaluation Count:11984
yes
Evaluation Count:187
evaluated: target == objectGesture.object
TRUEFALSE
yes
Evaluation Count:4588
yes
Evaluation Count:7396
187-11984
94 QSet<QGesture *> gestures = iter.value().toSet(); -
95 for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator -
96 it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:999
yes
Evaluation Count:4588
999-4588
97 it.value() -= gestures; -
98 }
executed: }
Execution Count:999
999
99 for (QForeachContainer<__typeof__(gestures)> _container_(gestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *g = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
100 m_deletedRecognizers.remove(g); -
101 m_gestureToRecognizer.remove(g); -
102 m_maybeGestures.remove(g); -
103 m_activeGestures.remove(g); -
104 m_gestureOwners.remove(g); -
105 m_gestureTargets.remove(g); -
106 m_gesturesToDelete.insert(g); -
107 }
executed: }
Execution Count:4589
4589
108 -
109 iter = m_objectGestures.erase(iter); -
110 } else {
executed: }
Execution Count:4588
4588
111 ++iter; -
112 }
executed: }
Execution Count:7583
7583
113 } -
114}
executed: }
Execution Count:5516
5516
115 -
116 -
117QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recognizer, Qt::GestureType type) -
118{ -
119 -
120 -
121 -
122 if (object->isWidgetType()) {
evaluated: object->isWidgetType()
TRUEFALSE
yes
Evaluation Count:60487
yes
Evaluation Count:488
488-60487
123 if (static_cast<QWidget *>(object)->d_func()->data.in_destructor)
partially evaluated: static_cast<QWidget *>(object)->d_func()->data.in_destructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60487
0-60487
124 return 0;
never executed: return 0;
0
125 } else if (QGesture *g = qobject_cast<QGesture *>(object)) {
executed: }
Execution Count:60487
partially evaluated: QGesture *g = qobject_cast<QGesture *>(object)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:488
0-60487
126 return g;
never executed: return g;
0
127 -
128 } else { -
129 qt_noop(); -
130 QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(object); -
131 if (graphicsObject->QGraphicsItem::d_func()->inDestructor)
partially evaluated: graphicsObject->QGraphicsItem::d_func()->inDestructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:488
0-488
132 return 0;
never executed: return 0;
0
133 -
134 }
executed: }
Execution Count:488
488
135 -
136 -
137 for (QForeachContainer<__typeof__(m_objectGestures.value(QGestureManager::ObjectGesture(object, type)))> _container_(m_objectGestures.value(QGestureManager::ObjectGesture(object, type))); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *state = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
138 if (m_gestureToRecognizer.value(state) == recognizer)
evaluated: m_gestureToRecognizer.value(state) == recognizer
TRUEFALSE
yes
Evaluation Count:55741
yes
Evaluation Count:1
1-55741
139 return state;
executed: return state;
Execution Count:55741
55741
140 }
executed: }
Execution Count:1
1
141 -
142 qt_noop(); -
143 QGesture *state = recognizer->create(object); -
144 if (!state)
partially evaluated: !state
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5234
0-5234
145 return 0;
never executed: return 0;
0
146 state->setParent(this); -
147 if (state->gestureType() == Qt::CustomGesture) {
evaluated: state->gestureType() == Qt::CustomGesture
TRUEFALSE
yes
Evaluation Count:115
yes
Evaluation Count:5119
115-5119
148 -
149 -
150 state->d_func()->gestureType = type; -
151 -
152 -
153 -
154 }
executed: }
Execution Count:115
115
155 m_objectGestures[QGestureManager::ObjectGesture(object, type)].append(state); -
156 m_gestureToRecognizer[state] = recognizer; -
157 m_gestureOwners[state] = object; -
158 -
159 return state;
executed: return state;
Execution Count:5234
5234
160} -
161 -
162bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, -
163 Qt::GestureType> &contexts, -
164 QEvent *event) -
165{ -
166 QSet<QGesture *> triggeredGestures; -
167 QSet<QGesture *> finishedGestures; -
168 QSet<QGesture *> newMaybeGestures; -
169 QSet<QGesture *> notGestures; -
170 -
171 -
172 -
173 -
174 bool consumeEventHint = false; -
175 -
176 -
177 typedef QMultiMap<QObject *, Qt::GestureType>::const_iterator ContextIterator; -
178 ContextIterator contextEnd = contexts.end(); -
179 for (ContextIterator context = contexts.begin(); context != contextEnd; ++context) {
evaluated: context != contextEnd
TRUEFALSE
yes
Evaluation Count:61027
yes
Evaluation Count:60419
60419-61027
180 Qt::GestureType gestureType = context.value(); -
181 const QMap<Qt::GestureType, QGestureRecognizer *> &const_recognizers = m_recognizers; -
182 QMap<Qt::GestureType, QGestureRecognizer *>::const_iterator -
183 typeToRecognizerIterator = const_recognizers.lowerBound(gestureType), -
184 typeToRecognizerEnd = const_recognizers.upperBound(gestureType); -
185 for (; typeToRecognizerIterator != typeToRecognizerEnd; ++typeToRecognizerIterator) {
evaluated: typeToRecognizerIterator != typeToRecognizerEnd
TRUEFALSE
yes
Evaluation Count:60975
yes
Evaluation Count:61027
60975-61027
186 QGestureRecognizer *recognizer = typeToRecognizerIterator.value(); -
187 QObject *target = context.key(); -
188 QGesture *state = getState(target, recognizer, gestureType); -
189 if (!state)
partially evaluated: !state
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60975
0-60975
190 continue;
never executed: continue;
0
191 QGestureRecognizer::Result recognizerResult = recognizer->recognize(state, target, event); -
192 QGestureRecognizer::Result recognizerState = recognizerResult & QGestureRecognizer::ResultState_Mask; -
193 QGestureRecognizer::Result resultHint = recognizerResult & QGestureRecognizer::ResultHint_Mask; -
194 if (recognizerState == QGestureRecognizer::TriggerGesture) {
evaluated: recognizerState == QGestureRecognizer::TriggerGesture
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:60770
205-60770
195 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 266, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: gesture triggered: " << state;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 266, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: gesture triggered: " << state;
0-205
196 triggeredGestures << state; -
197 } else if (recognizerState == QGestureRecognizer::FinishGesture) {
evaluated: recognizerState == QGestureRecognizer::FinishGesture
TRUEFALSE
yes
Evaluation Count:75
yes
Evaluation Count:60695
executed: }
Execution Count:205
75-60695
198 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 269, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: gesture finished: " << state;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 269, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: gesture finished: " << state;
0-75
199 finishedGestures << state; -
200 } else if (recognizerState == QGestureRecognizer::MayBeGesture) {
evaluated: recognizerState == QGestureRecognizer::MayBeGesture
TRUEFALSE
yes
Evaluation Count:133
yes
Evaluation Count:60562
executed: }
Execution Count:75
75-60562
201 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 272, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: maybe gesture: " << state;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:133
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 272, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: maybe gesture: " << state;
0-133
202 newMaybeGestures << state; -
203 } else if (recognizerState == QGestureRecognizer::CancelGesture) {
evaluated: recognizerState == QGestureRecognizer::CancelGesture
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:60560
executed: }
Execution Count:133
2-60560
204 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 275, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: not gesture: " << state;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 275, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: not gesture: " << state;
0-2
205 notGestures << state; -
206 } else if (recognizerState == QGestureRecognizer::Ignore) {
partially evaluated: recognizerState == QGestureRecognizer::Ignore
TRUEFALSE
yes
Evaluation Count:60560
no
Evaluation Count:0
executed: }
Execution Count:2
0-60560
207 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 278, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: ignored the event: " << state;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60560
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 278, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: ignored the event: " << state;
0-60560
208 } else {
executed: }
Execution Count:60560
60560
209 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 280, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: hm, lets assume the recognizer"
never evaluated: 0
0
210 << "ignored the event: " << state;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 280, __PRETTY_FUNCTION__).debug() << "QGestureManager:Recognizer: hm, lets assume the recognizer" << "ignored the event: " << state;
0
211 }
never executed: }
0
212 if (resultHint & QGestureRecognizer::ConsumeEventHint) {
evaluated: resultHint & QGestureRecognizer::ConsumeEventHint
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:60963
12-60963
213 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 284, __PRETTY_FUNCTION__).debug() << "QGestureManager: we were asked to consume the event: "
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
214 << state;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 284, __PRETTY_FUNCTION__).debug() << "QGestureManager: we were asked to consume the event: " << state;
0
215 consumeEventHint = true; -
216 }
executed: }
Execution Count:12
12
217 }
executed: }
Execution Count:60975
60975
218 }
executed: }
Execution Count:61027
61027
219 if (!triggeredGestures.isEmpty() || !finishedGestures.isEmpty()
evaluated: !triggeredGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:173
yes
Evaluation Count:60246
evaluated: !finishedGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:60183
63-60246
220 || !newMaybeGestures.isEmpty() || !notGestures.isEmpty()) {
evaluated: !newMaybeGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:113
yes
Evaluation Count:60070
evaluated: !notGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:60068
2-60070
221 QSet<QGesture *> startedGestures = triggeredGestures - m_activeGestures; -
222 triggeredGestures &= m_activeGestures; -
223 -
224 -
225 QSet<QGesture *> activeToMaybeGestures = m_activeGestures & newMaybeGestures; -
226 -
227 -
228 QSet<QGesture *> maybeToCanceledGestures = m_maybeGestures & notGestures; -
229 -
230 -
231 -
232 QSet<QGesture *> canceledGestures = m_activeGestures & notGestures; -
233 -
234 -
235 m_maybeGestures += newMaybeGestures; -
236 -
237 -
238 QSet<QGesture *> notMaybeGestures = (startedGestures | triggeredGestures -
239 | finishedGestures | canceledGestures -
240 | notGestures); -
241 m_maybeGestures -= notMaybeGestures; -
242 -
243 qt_noop(); -
244 qt_noop(); -
245 qt_noop(); -
246 qt_noop(); -
247 qt_noop(); -
248 qt_noop(); -
249 -
250 QSet<QGesture *> notStarted = finishedGestures - m_activeGestures; -
251 if (!notStarted.isEmpty()) {
evaluated: !notStarted.isEmpty()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:342
9-342
252 -
253 -
254 for (QForeachContainer<__typeof__(notStarted)> _container_(notStarted); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
255 gesture->d_func()->state = Qt::GestureStarted;
executed: gesture->d_func()->state = Qt::GestureStarted;
Execution Count:9
9
256 QSet<QGesture *> undeliveredGestures; -
257 deliverEvents(notStarted, &undeliveredGestures); -
258 finishedGestures -= undeliveredGestures; -
259 }
executed: }
Execution Count:9
9
260 -
261 m_activeGestures += startedGestures; -
262 -
263 qt_noop(); -
264 m_activeGestures -= finishedGestures; -
265 m_activeGestures -= activeToMaybeGestures; -
266 m_activeGestures -= canceledGestures; -
267 -
268 -
269 for (QForeachContainer<__typeof__(startedGestures)> _container_(startedGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
270 gesture->d_func()->state = Qt::GestureStarted;
executed: gesture->d_func()->state = Qt::GestureStarted;
Execution Count:78
78
271 for (QForeachContainer<__typeof__(triggeredGestures)> _container_(triggeredGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
272 gesture->d_func()->state = Qt::GestureUpdated;
executed: gesture->d_func()->state = Qt::GestureUpdated;
Execution Count:127
127
273 for (QForeachContainer<__typeof__(finishedGestures)> _container_(finishedGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
274 gesture->d_func()->state = Qt::GestureFinished;
executed: gesture->d_func()->state = Qt::GestureFinished;
Execution Count:74
74
275 for (QForeachContainer<__typeof__(canceledGestures)> _container_(canceledGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
276 gesture->d_func()->state = Qt::GestureCanceled;
never executed: gesture->d_func()->state = Qt::GestureCanceled;
0
277 for (QForeachContainer<__typeof__(activeToMaybeGestures)> _container_(activeToMaybeGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
278 gesture->d_func()->state = Qt::GestureFinished;
never executed: gesture->d_func()->state = Qt::GestureFinished;
0
279 -
280 if (!m_activeGestures.isEmpty() || !m_maybeGestures.isEmpty() ||
evaluated: !m_activeGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:173
yes
Evaluation Count:178
evaluated: !m_maybeGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:113
yes
Evaluation Count:65
65-178
281 !startedGestures.isEmpty() || !triggeredGestures.isEmpty() ||
partially evaluated: !startedGestures.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:65
partially evaluated: !triggeredGestures.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:65
0-65
282 !finishedGestures.isEmpty() || !canceledGestures.isEmpty()) {
evaluated: !finishedGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:62
yes
Evaluation Count:3
partially evaluated: !canceledGestures.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-62
283 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 354, __PRETTY_FUNCTION__).debug() << "QGestureManager::filterEventThroughContexts:"
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:348
0-348
284 << "\n\tactiveGestures:" << m_activeGestures 0
285 << "\n\tmaybeGestures:" << m_maybeGestures 0
286 << "\n\tstarted:" << startedGestures 0
287 << "\n\ttriggered:" << triggeredGestures 0
288 << "\n\tfinished:" << finishedGestures 0
289 << "\n\tcanceled:" << canceledGestures 0
290 << "\n\tmaybe-canceled:" << maybeToCanceledGestures;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 354, __PRETTY_FUNCTION__).debug() << "QGestureManager::filterEventThroughContexts:" << "\n\tactiveGestures:" << m_activeGestures << "\n\tmaybeGestures:" << m_maybeGestures << "\n\tstarted:" << startedGestures << "\n\ttriggered:" << triggeredGestures << "\n\tfinished:" << finishedGestures << "\n\tcanceled:" << canceledGestures << "\n\tmaybe-canceled:" << maybeToCanceledGestures;
0
291 }
executed: }
Execution Count:348
348
292 -
293 QSet<QGesture *> undeliveredGestures; -
294 deliverEvents(startedGestures+triggeredGestures+finishedGestures+canceledGestures, -
295 &undeliveredGestures); -
296 -
297 for (QForeachContainer<__typeof__(startedGestures)> _container_(startedGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *g = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
298 if (undeliveredGestures.contains(g))
evaluated: undeliveredGestures.contains(g)
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:70
8-70
299 continue;
executed: continue;
Execution Count:8
8
300 if (g->gestureCancelPolicy() == QGesture::CancelAllInContext) {
evaluated: g->gestureCancelPolicy() == QGesture::CancelAllInContext
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:67
3-67
301 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 372, __PRETTY_FUNCTION__).debug() << "lets try to cancel some";
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 372, __PRETTY_FUNCTION__).debug() << "lets try to cancel some";
0-3
302 -
303 cancelGesturesForChildren(g); -
304 }
executed: }
Execution Count:3
3
305 }
executed: }
Execution Count:70
70
306 -
307 m_activeGestures -= undeliveredGestures; -
308 -
309 -
310 QSet<QGesture *> endedGestures = -
311 finishedGestures + canceledGestures + undeliveredGestures + maybeToCanceledGestures; -
312 for (QForeachContainer<__typeof__(endedGestures)> _container_(endedGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
313 recycle(gesture); -
314 m_gestureTargets.remove(gesture); -
315 }
executed: }
Execution Count:84
84
316 }
executed: }
Execution Count:351
351
317 -
318 qDeleteAll(m_gesturesToDelete); -
319 m_gesturesToDelete.clear(); -
320 -
321 return consumeEventHint;
executed: return consumeEventHint;
Execution Count:60419
60419
322} -
323 -
324 -
325void QGestureManager::cancelGesturesForChildren(QGesture *original) -
326{ -
327 qt_noop(); -
328 QWidget *originatingWidget = m_gestureTargets.value(original); -
329 qt_noop(); -
330 -
331 -
332 -
333 -
334 -
335 QSet<QGesture*> cancelledGestures; -
336 QSet<QGesture*>::Iterator iter = m_activeGestures.begin(); -
337 while (iter != m_activeGestures.end()) {
evaluated: iter != m_activeGestures.end()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
338 QWidget *widget = m_gestureTargets.value(*iter); -
339 -
340 if (widget != originatingWidget && originatingWidget->isAncestorOf(widget)) {
evaluated: widget != originatingWidget
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
partially evaluated: originatingWidget->isAncestorOf(widget)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-3
341 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 412, __PRETTY_FUNCTION__).debug() << " found a gesture to cancel" << (*iter);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 412, __PRETTY_FUNCTION__).debug() << " found a gesture to cancel" << (*iter);
0-1
342 (*iter)->d_func()->state = Qt::GestureCanceled; -
343 cancelledGestures << *iter; -
344 iter = m_activeGestures.erase(iter); -
345 } else {
executed: }
Execution Count:1
1
346 ++iter; -
347 }
executed: }
Execution Count:3
3
348 } -
349 -
350 -
351 -
352 -
353 QSet<QGesture *> almostCanceledGestures = cancelledGestures; -
354 while (!almostCanceledGestures.isEmpty()) {
evaluated: !almostCanceledGestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
355 QWidget *target = 0; -
356 QSet<QGesture*> gestures; -
357 iter = almostCanceledGestures.begin(); -
358 -
359 while (iter != almostCanceledGestures.end()) {
evaluated: iter != almostCanceledGestures.end()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
360 QWidget *widget = m_gestureTargets.value(*iter); -
361 if (target == 0)
partially evaluated: target == 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
362 target = widget;
executed: target = widget;
Execution Count:1
1
363 if (target == widget) {
partially evaluated: target == widget
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
364 gestures << *iter; -
365 iter = almostCanceledGestures.erase(iter); -
366 } else {
executed: }
Execution Count:1
1
367 ++iter; -
368 }
never executed: }
0
369 } -
370 qt_noop(); -
371 -
372 QSet<QGesture*> undeliveredGestures; -
373 deliverEvents(gestures, &undeliveredGestures); -
374 }
executed: }
Execution Count:1
1
375 -
376 for (iter = cancelledGestures.begin(); iter != cancelledGestures.end(); ++iter)
evaluated: iter != cancelledGestures.end()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
377 recycle(*iter);
executed: recycle(*iter);
Execution Count:1
1
378}
executed: }
Execution Count:3
3
379 -
380void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture) -
381{ -
382 QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture); -
383 if(!recognizer)
never evaluated: !recognizer
0
384 return;
never executed: return;
0
385 m_deletedRecognizers.remove(gesture); -
386 if (m_deletedRecognizers.keys(recognizer).isEmpty()) {
never evaluated: m_deletedRecognizers.keys(recognizer).isEmpty()
0
387 -
388 qDeleteAll(m_obsoleteGestures.value(recognizer)); -
389 m_obsoleteGestures.remove(recognizer); -
390 delete recognizer; -
391 }
never executed: }
0
392}
never executed: }
0
393 -
394 -
395bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event) -
396{ -
397 QMap<Qt::GestureType, int> types; -
398 QMultiMap<QObject *, Qt::GestureType> contexts; -
399 QWidget *w = receiver; -
400 typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator; -
401 if (!w->d_func()->gestureContext.isEmpty()) {
evaluated: !w->d_func()->gestureContext.isEmpty()
TRUEFALSE
yes
Evaluation Count:45908
yes
Evaluation Count:304808
45908-304808
402 for(ContextIterator it = w->d_func()->gestureContext.constBegin(), -
403 e = w->d_func()->gestureContext.constEnd(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:46398
yes
Evaluation Count:45908
45908-46398
404 types.insert(it.key(), 0); -
405 contexts.insertMulti(w, it.key()); -
406 }
executed: }
Execution Count:46398
46398
407 }
executed: }
Execution Count:45908
45908
408 -
409 w = w->isWindow() ? 0 : w->parentWidget();
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:76407
yes
Evaluation Count:274309
76407-274309
410 while (w)
evaluated: w
TRUEFALSE
yes
Evaluation Count:522561
yes
Evaluation Count:76407
76407-522561
411 { -
412 for (ContextIterator it = w->d_func()->gestureContext.constBegin(), -
413 e = w->d_func()->gestureContext.constEnd(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:16381
yes
Evaluation Count:522561
16381-522561
414 if (!(it.value() & Qt::DontStartGestureOnChildren)) {
evaluated: !(it.value() & Qt::DontStartGestureOnChildren)
TRUEFALSE
yes
Evaluation Count:16358
yes
Evaluation Count:23
23-16358
415 if (!types.contains(it.key())) {
evaluated: !types.contains(it.key())
TRUEFALSE
yes
Evaluation Count:14141
yes
Evaluation Count:2217
2217-14141
416 types.insert(it.key(), 0); -
417 contexts.insertMulti(w, it.key()); -
418 }
executed: }
Execution Count:14141
14141
419 }
executed: }
Execution Count:16358
16358
420 }
executed: }
Execution Count:16381
16381
421 if (w->isWindow())
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:274309
yes
Evaluation Count:248252
248252-274309
422 break;
executed: break;
Execution Count:274309
274309
423 w = w->parentWidget(); -
424 }
executed: }
Execution Count:248252
248252
425 return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event);
executed: return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event);
Execution Count:350716
350716
426} -
427 -
428 -
429bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event) -
430{ -
431 QMap<Qt::GestureType, int> types; -
432 QMultiMap<QObject *, Qt::GestureType> contexts; -
433 QGraphicsObject *item = receiver; -
434 if (!item->QGraphicsItem::d_func()->gestureContext.isEmpty()) {
evaluated: !item->QGraphicsItem::d_func()->gestureContext.isEmpty()
TRUEFALSE
yes
Evaluation Count:460
yes
Evaluation Count:245
245-460
435 typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator; -
436 for(ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.constBegin(), -
437 e = item->QGraphicsItem::d_func()->gestureContext.constEnd(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:460
yes
Evaluation Count:460
460
438 types.insert(it.key(), 0); -
439 contexts.insertMulti(item, it.key()); -
440 }
executed: }
Execution Count:460
460
441 }
executed: }
Execution Count:460
460
442 -
443 item = item->parentObject(); -
444 while (item)
evaluated: item
TRUEFALSE
yes
Evaluation Count:180
yes
Evaluation Count:705
180-705
445 { -
446 typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator; -
447 for (ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.constBegin(), -
448 e = item->QGraphicsItem::d_func()->gestureContext.constEnd(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:85
yes
Evaluation Count:180
85-180
449 if (!(it.value() & Qt::DontStartGestureOnChildren)) {
evaluated: !(it.value() & Qt::DontStartGestureOnChildren)
TRUEFALSE
yes
Evaluation Count:80
yes
Evaluation Count:5
5-80
450 if (!types.contains(it.key())) {
evaluated: !types.contains(it.key())
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:52
28-52
451 types.insert(it.key(), 0); -
452 contexts.insertMulti(item, it.key()); -
453 }
executed: }
Execution Count:28
28
454 }
executed: }
Execution Count:80
80
455 }
executed: }
Execution Count:85
85
456 item = item->parentObject(); -
457 }
executed: }
Execution Count:180
180
458 return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event);
executed: return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event);
Execution Count:705
705
459} -
460 -
461 -
462bool QGestureManager::filterEvent(QObject *receiver, QEvent *event) -
463{ -
464 -
465 -
466 QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(receiver); -
467 -
468 if (widgetWindow)
evaluated: widgetWindow
TRUEFALSE
yes
Evaluation Count:15170
yes
Evaluation Count:23393
15170-23393
469 return filterEvent(widgetWindow->widget(), event);
executed: return filterEvent(widgetWindow->widget(), event);
Execution Count:15170
15170
470 -
471 if (!m_gestureToRecognizer.contains(static_cast<QGesture *>(receiver)))
partially evaluated: !m_gestureToRecognizer.contains(static_cast<QGesture *>(receiver))
TRUEFALSE
yes
Evaluation Count:23393
no
Evaluation Count:0
0-23393
472 return false;
executed: return false;
Execution Count:23393
23393
473 QGesture *state = static_cast<QGesture *>(receiver); -
474 QMultiMap<QObject *, Qt::GestureType> contexts; -
475 contexts.insert(state, state->gestureType()); -
476 return filterEventThroughContexts(contexts, event);
never executed: return filterEventThroughContexts(contexts, event);
0
477} -
478 -
479void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures, -
480 QHash<QWidget *, QList<QGesture *> > *conflicts, -
481 QHash<QWidget *, QList<QGesture *> > *normal) -
482{ -
483 typedef QHash<Qt::GestureType, QHash<QWidget *, QGesture *> > GestureByTypes; -
484 GestureByTypes gestureByTypes; -
485 -
486 -
487 for (QForeachContainer<__typeof__(gestures)> _container_(gestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
488 QWidget *receiver = m_gestureTargets.value(gesture, 0); -
489 qt_noop(); -
490 gestureByTypes[gesture->gestureType()].insert(receiver, gesture); -
491 }
executed: }
Execution Count:78
78
492 -
493 -
494 for (QForeachContainer<__typeof__(gestureByTypes.keys())> _container_(gestureByTypes.keys()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (Qt::GestureType type = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
495 QHash<QWidget *, QGesture *> gestures = gestureByTypes.value(type); -
496 for (QForeachContainer<__typeof__(gestures.keys())> _container_(gestures.keys()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QWidget *widget = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
497 QWidget *w = widget->parentWidget(); -
498 while (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:16
16-68
499 QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator it -
500 = w->d_func()->gestureContext.constFind(type); -
501 if (it != w->d_func()->gestureContext.constEnd()) {
evaluated: it != w->d_func()->gestureContext.constEnd()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:54
14-54
502 -
503 if (!(it.value() & Qt::DontStartGestureOnChildren) && w != widget) {
evaluated: !(it.value() & Qt::DontStartGestureOnChildren)
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:2
partially evaluated: w != widget
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-12
504 -
505 (*conflicts)[widget].append(gestures[widget]); -
506 break;
executed: break;
Execution Count:12
12
507 } -
508 }
executed: }
Execution Count:2
2
509 if (w->isWindow()) {
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:6
6-50
510 w = 0; -
511 break;
executed: break;
Execution Count:50
50
512 } -
513 w = w->parentWidget(); -
514 }
executed: }
Execution Count:6
6
515 if (!w)
evaluated: !w
TRUEFALSE
yes
Evaluation Count:66
yes
Evaluation Count:12
12-66
516 (*normal)[widget].append(gestures[widget]);
executed: (*normal)[widget].append(gestures[widget]);
Execution Count:66
66
517 }
executed: }
Execution Count:78
78
518 }
executed: }
Execution Count:78
78
519}
executed: }
Execution Count:245
245
520 -
521void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures, -
522 QSet<QGesture *> *undeliveredGestures) -
523{ -
524 if (gestures.isEmpty())
evaluated: gestures.isEmpty()
TRUEFALSE
yes
Evaluation Count:116
yes
Evaluation Count:245
116-245
525 return;
executed: return;
Execution Count:116
116
526 -
527 typedef QHash<QWidget *, QList<QGesture *> > GesturesPerWidget; -
528 GesturesPerWidget conflictedGestures; -
529 GesturesPerWidget normalStartedGestures; -
530 -
531 QSet<QGesture *> startedGestures; -
532 -
533 for (QSet<QGesture *>::const_iterator it = gestures.begin(), -
534 e = gestures.end(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:289
yes
Evaluation Count:245
245-289
535 QGesture *gesture = *it; -
536 QWidget *target = m_gestureTargets.value(gesture, 0); -
537 if (!target) {
evaluated: !target
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:205
84-205
538 -
539 qt_noop(); -
540 if (gesture->hasHotSpot()) {
evaluated: gesture->hasHotSpot()
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:39
39-45
541 -
542 QPoint pt = gesture->hotSpot().toPoint(); -
543 if (QWidget *topLevel = (static_cast<QApplication *>(QCoreApplication::instance()))->topLevelAt(pt)) {
evaluated: QWidget *topLevel = (static_cast<QApplication *>(QCoreApplication::instance()))->topLevelAt(pt)
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:5
5-40
544 QWidget *child = topLevel->childAt(topLevel->mapFromGlobal(pt)); -
545 target = child ? child : topLevel;
evaluated: child
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:2
2-38
546 }
executed: }
Execution Count:40
40
547 } else {
executed: }
Execution Count:45
45
548 -
549 QObject *context = m_gestureOwners.value(gesture, 0); -
550 if (context->isWidgetType())
evaluated: context->isWidgetType()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:4
4-35
551 target = static_cast<QWidget *>(context);
executed: target = static_cast<QWidget *>(context);
Execution Count:35
35
552 }
executed: }
Execution Count:39
39
553 if (target)
evaluated: target
TRUEFALSE
yes
Evaluation Count:75
yes
Evaluation Count:9
9-75
554 m_gestureTargets.insert(gesture, target);
executed: m_gestureTargets.insert(gesture, target);
Execution Count:75
75
555 }
executed: }
Execution Count:84
84
556 -
557 Qt::GestureType gestureType = gesture->gestureType(); -
558 qt_noop(); -
559 (void)gestureType;; -
560 -
561 if (target) {
evaluated: target
TRUEFALSE
yes
Evaluation Count:280
yes
Evaluation Count:9
9-280
562 if (gesture->state() == Qt::GestureStarted) {
evaluated: gesture->state() == Qt::GestureStarted
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:202
78-202
563 startedGestures.insert(gesture); -
564 } else {
executed: }
Execution Count:78
78
565 normalStartedGestures[target].append(gesture); -
566 }
executed: }
Execution Count:202
202
567 } else { -
568 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 639, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvent: could not find the target for gesture"
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
569 << gesture->gestureType();
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 639, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvent: could not find the target for gesture" << gesture->gestureType();
0
570 QMessageLogger("kernel/qgesturemanager.cpp", 641, __PRETTY_FUNCTION__).warning("QGestureManager::deliverEvent: could not find the target for gesture"); -
571 undeliveredGestures->insert(gesture); -
572 }
executed: }
Execution Count:9
9
573 } -
574 -
575 getGestureTargets(startedGestures, &conflictedGestures, &normalStartedGestures); -
576 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 647, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvents:"
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:245
0-245
577 << "\nstarted: " << startedGestures 0
578 << "\nconflicted: " << conflictedGestures 0
579 << "\nnormal: " << normalStartedGestures 0
580 << "\n";
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 647, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvents:" << "\nstarted: " << startedGestures << "\nconflicted: " << conflictedGestures << "\nnormal: " << normalStartedGestures << "\n";
0
581 -
582 -
583 for (GesturesPerWidget::const_iterator it = conflictedGestures.constBegin(), -
584 e = conflictedGestures.constEnd(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:245
10-245
585 QWidget *receiver = it.key(); -
586 QList<QGesture *> gestures = it.value(); -
587 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 658, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvents: sending GestureOverride to"
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
588 << receiver 0
589 << "gestures:" << gestures;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 658, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvents: sending GestureOverride to" << receiver << "gestures:" << gestures;
0
590 QGestureEvent event(gestures); -
591 event.t = QEvent::GestureOverride; -
592 -
593 event.ignore(); -
594 for (QForeachContainer<__typeof__(gestures)> _container_(gestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *g = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
595 event.setAccepted(g, false);
executed: event.setAccepted(g, false);
Execution Count:12
12
596 -
597 QApplication::sendEvent(receiver, &event); -
598 bool eventAccepted = event.isAccepted(); -
599 for (QForeachContainer<__typeof__(event.gestures())> _container_(event.gestures()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
600 if (eventAccepted || event.isAccepted(gesture)) {
partially evaluated: eventAccepted
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
evaluated: event.isAccepted(gesture)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:9
0-12
601 QWidget *w = event.m_targetWidgets.value(gesture->gestureType(), 0); -
602 qt_noop(); -
603 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 674, __PRETTY_FUNCTION__).debug() << "override event: gesture was accepted:" << gesture << w;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 674, __PRETTY_FUNCTION__).debug() << "override event: gesture was accepted:" << gesture << w;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
604 QList<QGesture *> &gestures = normalStartedGestures[w]; -
605 gestures.append(gesture); -
606 -
607 m_gestureTargets[gesture] = w; -
608 } else {
executed: }
Execution Count:3
3
609 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 680, __PRETTY_FUNCTION__).debug() << "override event: gesture wasn't accepted. putting back:" << gesture;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 680, __PRETTY_FUNCTION__).debug() << "override event: gesture wasn't accepted. putting back:" << gesture;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
610 QList<QGesture *> &gestures = normalStartedGestures[receiver]; -
611 gestures.append(gesture); -
612 }
executed: }
Execution Count:9
9
613 } -
614 }
executed: }
Execution Count:10
10
615 -
616 -
617 for (GesturesPerWidget::const_iterator it = normalStartedGestures.constBegin(), -
618 e = normalStartedGestures.constEnd(); it != e; ++it) {
evaluated: it != e
TRUEFALSE
yes
Evaluation Count:258
yes
Evaluation Count:245
245-258
619 if (!it.value().isEmpty()) {
partially evaluated: !it.value().isEmpty()
TRUEFALSE
yes
Evaluation Count:258
no
Evaluation Count:0
0-258
620 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 691, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvents: sending to" << it.key()
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:258
0-258
621 << "gestures:" << it.value();
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 691, __PRETTY_FUNCTION__).debug() << "QGestureManager::deliverEvents: sending to" << it.key() << "gestures:" << it.value();
0
622 QGestureEvent event(it.value()); -
623 QApplication::sendEvent(it.key(), &event); -
624 bool eventAccepted = event.isAccepted(); -
625 for (QForeachContainer<__typeof__(event.gestures())> _container_(event.gestures()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
626 if (gesture->state() == Qt::GestureStarted &&
evaluated: gesture->state() == Qt::GestureStarted
TRUEFALSE
yes
Evaluation Count:77
yes
Evaluation Count:203
77-203
627 (eventAccepted || event.isAccepted(gesture))) {
partially evaluated: eventAccepted
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:77
evaluated: event.isAccepted(gesture)
TRUEFALSE
yes
Evaluation Count:64
yes
Evaluation Count:13
0-77
628 QWidget *w = event.m_targetWidgets.value(gesture->gestureType(), 0); -
629 qt_noop(); -
630 if (0) QMessageLogger("kernel/qgesturemanager.cpp", 701, __PRETTY_FUNCTION__).debug() << "started gesture was delivered and accepted by" << w;
never executed: QMessageLogger("kernel/qgesturemanager.cpp", 701, __PRETTY_FUNCTION__).debug() << "started gesture was delivered and accepted by" << w;
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:64
0-64
631 m_gestureTargets[gesture] = w; -
632 }
executed: }
Execution Count:64
64
633 }
executed: }
Execution Count:280
280
634 }
executed: }
Execution Count:258
258
635 }
executed: }
Execution Count:258
258
636}
executed: }
Execution Count:245
245
637 -
638void QGestureManager::recycle(QGesture *gesture) -
639{ -
640 QGestureRecognizer *recognizer = m_gestureToRecognizer.value(gesture, 0); -
641 if (recognizer) {
partially evaluated: recognizer
TRUEFALSE
yes
Evaluation Count:87
no
Evaluation Count:0
0-87
642 gesture->setGestureCancelPolicy(QGesture::CancelNone); -
643 recognizer->reset(gesture); -
644 m_activeGestures.remove(gesture); -
645 } else {
executed: }
Execution Count:87
87
646 cleanupGesturesForRemovedRecognizer(gesture); -
647 }
never executed: }
0
648} -
649 -
650 -
651 -
652 -
653 -
654 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial