Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | QGesture::QGesture(QObject *parent) | - |
6 | : QObject(*new QGesturePrivate, parent) | - |
7 | { | - |
8 | d_func()->gestureType = Qt::CustomGesture; | - |
9 | } executed: } Execution Count:129 | 129 |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | QGesture::QGesture(QGesturePrivate &dd, QObject *parent) | - |
15 | : QObject(dd, parent) | - |
16 | { | - |
17 | } executed: } Execution Count:5405 | 5405 |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | QGesture::~QGesture() | - |
23 | { | - |
24 | } | - |
25 | Qt::GestureType QGesture::gestureType() const | - |
26 | { | - |
27 | return d_func()->gestureType; executed: return d_func()->gestureType; Execution Count:9077 | 9077 |
28 | } | - |
29 | | - |
30 | Qt::GestureState QGesture::state() const | - |
31 | { | - |
32 | return d_func()->state; executed: return d_func()->state; Execution Count:1798 | 1798 |
33 | } | - |
34 | | - |
35 | QPointF QGesture::hotSpot() const | - |
36 | { | - |
37 | return d_func()->hotSpot; executed: return d_func()->hotSpot; Execution Count:192 | 192 |
38 | } | - |
39 | | - |
40 | void QGesture::setHotSpot(const QPointF &value) | - |
41 | { | - |
42 | QGesturePrivate * const d = d_func(); | - |
43 | d->hotSpot = value; | - |
44 | d->isHotSpotSet = true; | - |
45 | } executed: } Execution Count:226 | 226 |
46 | | - |
47 | bool QGesture::hasHotSpot() const | - |
48 | { | - |
49 | return d_func()->isHotSpotSet; executed: return d_func()->isHotSpotSet; Execution Count:297 | 297 |
50 | } | - |
51 | | - |
52 | void QGesture::unsetHotSpot() | - |
53 | { | - |
54 | d_func()->isHotSpotSet = false; | - |
55 | } | 0 |
56 | void QGesture::setGestureCancelPolicy(GestureCancelPolicy policy) | - |
57 | { | - |
58 | QGesturePrivate * const d = d_func(); | - |
59 | d->gestureCancelPolicy = static_cast<uint>(policy); | - |
60 | } executed: } Execution Count:92 | 92 |
61 | | - |
62 | QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const | - |
63 | { | - |
64 | const QGesturePrivate * const d = d_func(); | - |
65 | return static_cast<GestureCancelPolicy>(d->gestureCancelPolicy); executed: return static_cast<GestureCancelPolicy>(d->gestureCancelPolicy); Execution Count:110 | 110 |
66 | } | - |
67 | QPanGesture::QPanGesture(QObject *parent) | - |
68 | : QGesture(*new QPanGesturePrivate, parent) | - |
69 | { | - |
70 | d_func()->gestureType = Qt::PanGesture; | - |
71 | } executed: } Execution Count:5176 | 5176 |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | QPanGesture::~QPanGesture() | - |
77 | { | - |
78 | } | - |
79 | | - |
80 | QPointF QPanGesture::lastOffset() const | - |
81 | { | - |
82 | return d_func()->lastOffset; never executed: return d_func()->lastOffset; | 0 |
83 | } | - |
84 | | - |
85 | QPointF QPanGesture::offset() const | - |
86 | { | - |
87 | return d_func()->offset; never executed: return d_func()->offset; | 0 |
88 | } | - |
89 | | - |
90 | QPointF QPanGesture::delta() const | - |
91 | { | - |
92 | const QPanGesturePrivate * const d = d_func(); | - |
93 | return d->offset - d->lastOffset; never executed: return d->offset - d->lastOffset; | 0 |
94 | } | - |
95 | | - |
96 | qreal QPanGesture::acceleration() const | - |
97 | { | - |
98 | return d_func()->acceleration; never executed: return d_func()->acceleration; | 0 |
99 | } | - |
100 | | - |
101 | void QPanGesture::setLastOffset(const QPointF &value) | - |
102 | { | - |
103 | d_func()->lastOffset = value; | - |
104 | } | 0 |
105 | | - |
106 | void QPanGesture::setOffset(const QPointF &value) | - |
107 | { | - |
108 | d_func()->offset = value; | - |
109 | } | 0 |
110 | | - |
111 | void QPanGesture::setAcceleration(qreal value) | - |
112 | { | - |
113 | d_func()->acceleration = value; | - |
114 | } | 0 |
115 | QPinchGesture::QPinchGesture(QObject *parent) | - |
116 | : QGesture(*new QPinchGesturePrivate, parent) | - |
117 | { | - |
118 | d_func()->gestureType = Qt::PinchGesture; | - |
119 | } executed: } Execution Count:56 | 56 |
120 | | - |
121 | | - |
122 | | - |
123 | | - |
124 | QPinchGesture::~QPinchGesture() | - |
125 | { | - |
126 | } | - |
127 | | - |
128 | QPinchGesture::ChangeFlags QPinchGesture::totalChangeFlags() const | - |
129 | { | - |
130 | return d_func()->totalChangeFlags; never executed: return d_func()->totalChangeFlags; | 0 |
131 | } | - |
132 | | - |
133 | void QPinchGesture::setTotalChangeFlags(QPinchGesture::ChangeFlags value) | - |
134 | { | - |
135 | d_func()->totalChangeFlags = value; | - |
136 | } | 0 |
137 | | - |
138 | QPinchGesture::ChangeFlags QPinchGesture::changeFlags() const | - |
139 | { | - |
140 | return d_func()->changeFlags; never executed: return d_func()->changeFlags; | 0 |
141 | } | - |
142 | | - |
143 | void QPinchGesture::setChangeFlags(QPinchGesture::ChangeFlags value) | - |
144 | { | - |
145 | d_func()->changeFlags = value; | - |
146 | } | 0 |
147 | | - |
148 | QPointF QPinchGesture::startCenterPoint() const | - |
149 | { | - |
150 | return d_func()->startCenterPoint; never executed: return d_func()->startCenterPoint; | 0 |
151 | } | - |
152 | | - |
153 | QPointF QPinchGesture::lastCenterPoint() const | - |
154 | { | - |
155 | return d_func()->lastCenterPoint; never executed: return d_func()->lastCenterPoint; | 0 |
156 | } | - |
157 | | - |
158 | QPointF QPinchGesture::centerPoint() const | - |
159 | { | - |
160 | return d_func()->centerPoint; never executed: return d_func()->centerPoint; | 0 |
161 | } | - |
162 | | - |
163 | void QPinchGesture::setStartCenterPoint(const QPointF &value) | - |
164 | { | - |
165 | d_func()->startCenterPoint = value; | - |
166 | } | 0 |
167 | | - |
168 | void QPinchGesture::setLastCenterPoint(const QPointF &value) | - |
169 | { | - |
170 | d_func()->lastCenterPoint = value; | - |
171 | } | 0 |
172 | | - |
173 | void QPinchGesture::setCenterPoint(const QPointF &value) | - |
174 | { | - |
175 | d_func()->centerPoint = value; | - |
176 | } | 0 |
177 | | - |
178 | | - |
179 | qreal QPinchGesture::totalScaleFactor() const | - |
180 | { | - |
181 | return d_func()->totalScaleFactor; never executed: return d_func()->totalScaleFactor; | 0 |
182 | } | - |
183 | | - |
184 | qreal QPinchGesture::lastScaleFactor() const | - |
185 | { | - |
186 | return d_func()->lastScaleFactor; never executed: return d_func()->lastScaleFactor; | 0 |
187 | } | - |
188 | | - |
189 | qreal QPinchGesture::scaleFactor() const | - |
190 | { | - |
191 | return d_func()->scaleFactor; never executed: return d_func()->scaleFactor; | 0 |
192 | } | - |
193 | | - |
194 | void QPinchGesture::setTotalScaleFactor(qreal value) | - |
195 | { | - |
196 | d_func()->totalScaleFactor = value; | - |
197 | } | 0 |
198 | | - |
199 | void QPinchGesture::setLastScaleFactor(qreal value) | - |
200 | { | - |
201 | d_func()->lastScaleFactor = value; | - |
202 | } | 0 |
203 | | - |
204 | void QPinchGesture::setScaleFactor(qreal value) | - |
205 | { | - |
206 | d_func()->scaleFactor = value; | - |
207 | } | 0 |
208 | | - |
209 | | - |
210 | qreal QPinchGesture::totalRotationAngle() const | - |
211 | { | - |
212 | return d_func()->totalRotationAngle; never executed: return d_func()->totalRotationAngle; | 0 |
213 | } | - |
214 | | - |
215 | qreal QPinchGesture::lastRotationAngle() const | - |
216 | { | - |
217 | return d_func()->lastRotationAngle; never executed: return d_func()->lastRotationAngle; | 0 |
218 | } | - |
219 | | - |
220 | qreal QPinchGesture::rotationAngle() const | - |
221 | { | - |
222 | return d_func()->rotationAngle; never executed: return d_func()->rotationAngle; | 0 |
223 | } | - |
224 | | - |
225 | void QPinchGesture::setTotalRotationAngle(qreal value) | - |
226 | { | - |
227 | d_func()->totalRotationAngle = value; | - |
228 | } | 0 |
229 | | - |
230 | void QPinchGesture::setLastRotationAngle(qreal value) | - |
231 | { | - |
232 | d_func()->lastRotationAngle = value; | - |
233 | } | 0 |
234 | | - |
235 | void QPinchGesture::setRotationAngle(qreal value) | - |
236 | { | - |
237 | d_func()->rotationAngle = value; | - |
238 | } | 0 |
239 | QSwipeGesture::QSwipeGesture(QObject *parent) | - |
240 | : QGesture(*new QSwipeGesturePrivate, parent) | - |
241 | { | - |
242 | d_func()->gestureType = Qt::SwipeGesture; | - |
243 | } executed: } Execution Count:56 | 56 |
244 | | - |
245 | | - |
246 | | - |
247 | | - |
248 | QSwipeGesture::~QSwipeGesture() | - |
249 | { | - |
250 | } | - |
251 | | - |
252 | QSwipeGesture::SwipeDirection QSwipeGesture::horizontalDirection() const | - |
253 | { | - |
254 | const QSwipeGesturePrivate * const d = d_func(); | - |
255 | if (d->swipeAngle < 0 || d->swipeAngle == 90 || d->swipeAngle == 270) never evaluated: d->swipeAngle == 90 never evaluated: d->swipeAngle == 270 never evaluated: d->swipeAngle < 0 | 0 |
256 | return QSwipeGesture::NoDirection; never executed: return QSwipeGesture::NoDirection; | 0 |
257 | else if (d->swipeAngle < 90 || d->swipeAngle > 270) never evaluated: d->swipeAngle < 90 never evaluated: d->swipeAngle > 270 | 0 |
258 | return QSwipeGesture::Right; never executed: return QSwipeGesture::Right; | 0 |
259 | else | - |
260 | return QSwipeGesture::Left; never executed: return QSwipeGesture::Left; | 0 |
261 | } | - |
262 | | - |
263 | QSwipeGesture::SwipeDirection QSwipeGesture::verticalDirection() const | - |
264 | { | - |
265 | const QSwipeGesturePrivate * const d = d_func(); | - |
266 | if (d->swipeAngle <= 0 || d->swipeAngle == 180) never evaluated: d->swipeAngle <= 0 never evaluated: d->swipeAngle == 180 | 0 |
267 | return QSwipeGesture::NoDirection; never executed: return QSwipeGesture::NoDirection; | 0 |
268 | else if (d->swipeAngle < 180) never evaluated: d->swipeAngle < 180 | 0 |
269 | return QSwipeGesture::Up; never executed: return QSwipeGesture::Up; | 0 |
270 | else | - |
271 | return QSwipeGesture::Down; never executed: return QSwipeGesture::Down; | 0 |
272 | } | - |
273 | | - |
274 | qreal QSwipeGesture::swipeAngle() const | - |
275 | { | - |
276 | return d_func()->swipeAngle; never executed: return d_func()->swipeAngle; | 0 |
277 | } | - |
278 | | - |
279 | void QSwipeGesture::setSwipeAngle(qreal value) | - |
280 | { | - |
281 | d_func()->swipeAngle = value; | - |
282 | } | 0 |
283 | QTapGesture::QTapGesture(QObject *parent) | - |
284 | : QGesture(*new QTapGesturePrivate, parent) | - |
285 | { | - |
286 | d_func()->gestureType = Qt::TapGesture; | - |
287 | } executed: } Execution Count:57 | 57 |
288 | | - |
289 | | - |
290 | | - |
291 | | - |
292 | QTapGesture::~QTapGesture() | - |
293 | { | - |
294 | } | - |
295 | | - |
296 | QPointF QTapGesture::position() const | - |
297 | { | - |
298 | return d_func()->position; never executed: return d_func()->position; | 0 |
299 | } | - |
300 | | - |
301 | void QTapGesture::setPosition(const QPointF &value) | - |
302 | { | - |
303 | d_func()->position = value; | - |
304 | } | 0 |
305 | QTapAndHoldGesture::QTapAndHoldGesture(QObject *parent) | - |
306 | : QGesture(*new QTapAndHoldGesturePrivate, parent) | - |
307 | { | - |
308 | d_func()->gestureType = Qt::TapAndHoldGesture; | - |
309 | } executed: } Execution Count:56 | 56 |
310 | | - |
311 | | - |
312 | | - |
313 | | - |
314 | QTapAndHoldGesture::~QTapAndHoldGesture() | - |
315 | { | - |
316 | } | - |
317 | | - |
318 | QPointF QTapAndHoldGesture::position() const | - |
319 | { | - |
320 | return d_func()->position; never executed: return d_func()->position; | 0 |
321 | } | - |
322 | | - |
323 | void QTapAndHoldGesture::setPosition(const QPointF &value) | - |
324 | { | - |
325 | d_func()->position = value; | - |
326 | } | 0 |
327 | void QTapAndHoldGesture::setTimeout(int msecs) | - |
328 | { | - |
329 | QTapAndHoldGesturePrivate::Timeout = msecs; | - |
330 | } | 0 |
331 | int QTapAndHoldGesture::timeout() | - |
332 | { | - |
333 | return QTapAndHoldGesturePrivate::Timeout; never executed: return QTapAndHoldGesturePrivate::Timeout; | 0 |
334 | } | - |
335 | | - |
336 | int QTapAndHoldGesturePrivate::Timeout = 700; | - |
337 | QGestureEvent::QGestureEvent(const QList<QGesture *> &gestures) | - |
338 | : QEvent(QEvent::Gesture), m_gestures(gestures), m_widget(0) | - |
339 | | - |
340 | { | - |
341 | } executed: } Execution Count:795 | 795 |
342 | | - |
343 | | - |
344 | | - |
345 | | - |
346 | QGestureEvent::~QGestureEvent() | - |
347 | { | - |
348 | } | - |
349 | | - |
350 | | - |
351 | | - |
352 | | - |
353 | QList<QGesture *> QGestureEvent::gestures() const | - |
354 | { | - |
355 | return m_gestures; executed: return m_gestures; Execution Count:1218 | 1218 |
356 | } | - |
357 | | - |
358 | | - |
359 | | - |
360 | | - |
361 | QGesture *QGestureEvent::gesture(Qt::GestureType type) const | - |
362 | { | - |
363 | for (int i = 0; i < m_gestures.size(); ++i) evaluated: i < m_gestures.size() yes Evaluation Count:464 | yes Evaluation Count:194 |
| 194-464 |
364 | if (m_gestures.at(i)->gestureType() == type) evaluated: m_gestures.at(i)->gestureType() == type yes Evaluation Count:138 | yes Evaluation Count:326 |
| 138-326 |
365 | return m_gestures.at(i); executed: return m_gestures.at(i); Execution Count:138 | 138 |
366 | return 0; executed: return 0; Execution Count:194 | 194 |
367 | } | - |
368 | | - |
369 | | - |
370 | | - |
371 | | - |
372 | QList<QGesture *> QGestureEvent::activeGestures() const | - |
373 | { | - |
374 | QList<QGesture *> gestures; | - |
375 | for (QForeachContainer<__typeof__(m_gestures)> _container_(m_gestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
376 | if (gesture->state() != Qt::GestureCanceled) never evaluated: gesture->state() != Qt::GestureCanceled | 0 |
377 | gestures.append(gesture); never executed: gestures.append(gesture); | 0 |
378 | } | 0 |
379 | return gestures; never executed: return gestures; | 0 |
380 | } | - |
381 | | - |
382 | | - |
383 | | - |
384 | | - |
385 | QList<QGesture *> QGestureEvent::canceledGestures() const | - |
386 | { | - |
387 | QList<QGesture *> gestures; | - |
388 | for (QForeachContainer<__typeof__(m_gestures)> _container_(m_gestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *gesture = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
389 | if (gesture->state() == Qt::GestureCanceled) never evaluated: gesture->state() == Qt::GestureCanceled | 0 |
390 | gestures.append(gesture); never executed: gestures.append(gesture); | 0 |
391 | } | 0 |
392 | return gestures; never executed: return gestures; | 0 |
393 | } | - |
394 | void QGestureEvent::setAccepted(QGesture *gesture, bool value) | - |
395 | { | - |
396 | if (gesture) partially evaluated: gesture yes Evaluation Count:352 | no Evaluation Count:0 |
| 0-352 |
397 | setAccepted(gesture->gestureType(), value); executed: setAccepted(gesture->gestureType(), value); Execution Count:352 | 352 |
398 | } executed: } Execution Count:352 | 352 |
399 | void QGestureEvent::accept(QGesture *gesture) | - |
400 | { | - |
401 | if (gesture) | 0 |
402 | setAccepted(gesture->gestureType(), true); never executed: setAccepted(gesture->gestureType(), true); | 0 |
403 | } | 0 |
404 | void QGestureEvent::ignore(QGesture *gesture) | - |
405 | { | - |
406 | if (gesture) evaluated: gesture yes Evaluation Count:150 | yes Evaluation Count:192 |
| 150-192 |
407 | setAccepted(gesture->gestureType(), false); executed: setAccepted(gesture->gestureType(), false); Execution Count:150 | 150 |
408 | } executed: } Execution Count:342 | 342 |
409 | | - |
410 | | - |
411 | | - |
412 | | - |
413 | bool QGestureEvent::isAccepted(QGesture *gesture) const | - |
414 | { | - |
415 | return gesture ? isAccepted(gesture->gestureType()) : false; executed: return gesture ? isAccepted(gesture->gestureType()) : false; Execution Count:320 | 320 |
416 | } | - |
417 | void QGestureEvent::setAccepted(Qt::GestureType gestureType, bool value) | - |
418 | { | - |
419 | setAccepted(false); | - |
420 | m_accepted[gestureType] = value; | - |
421 | } executed: } Execution Count:502 | 502 |
422 | void QGestureEvent::accept(Qt::GestureType gestureType) | - |
423 | { | - |
424 | setAccepted(gestureType, true); | - |
425 | } | 0 |
426 | void QGestureEvent::ignore(Qt::GestureType gestureType) | - |
427 | { | - |
428 | setAccepted(gestureType, false); | - |
429 | } | 0 |
430 | | - |
431 | | - |
432 | | - |
433 | | - |
434 | | - |
435 | bool QGestureEvent::isAccepted(Qt::GestureType gestureType) const | - |
436 | { | - |
437 | return m_accepted.value(gestureType, true); executed: return m_accepted.value(gestureType, true); Execution Count:320 | 320 |
438 | } | - |
439 | | - |
440 | | - |
441 | | - |
442 | | - |
443 | | - |
444 | | - |
445 | void QGestureEvent::setWidget(QWidget *widget) | - |
446 | { | - |
447 | m_widget = widget; | - |
448 | } executed: } Execution Count:350 | 350 |
449 | | - |
450 | | - |
451 | | - |
452 | | - |
453 | QWidget *QGestureEvent::widget() const | - |
454 | { | - |
455 | return m_widget; executed: return m_widget; Execution Count:351 | 351 |
456 | } | - |
457 | QPointF QGestureEvent::mapToGraphicsScene(const QPointF &gesturePoint) const | - |
458 | { | - |
459 | QWidget *w = widget(); | - |
460 | if (w) evaluated: w yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
461 | w = w->parentWidget(); executed: w = w->parentWidget(); Execution Count:1 | 1 |
462 | QGraphicsView *view = qobject_cast<QGraphicsView*>(w); | - |
463 | if (view) { evaluated: view yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
464 | return view->mapToScene(view->mapFromGlobal(gesturePoint.toPoint())); executed: return view->mapToScene(view->mapFromGlobal(gesturePoint.toPoint())); Execution Count:1 | 1 |
465 | } | - |
466 | return QPointF(); executed: return QPointF(); Execution Count:1 | 1 |
467 | } | - |
468 | | - |
469 | | - |
470 | | - |
| | |