OpenCoverage

qquickdrag.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickdrag.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7class QQuickDragAttachedPrivate : public QObjectPrivate, public QQuickItemChangeListener-
8{-
9 inline QQuickDragAttached* q_func() { return static_cast<QQuickDragAttached *>(q_ptr); } inline const QQuickDragAttached* q_func() const { return static_cast<const QQuickDragAttached *>(q_ptr); } friend class QQuickDragAttached;-
10public:-
11 static QQuickDragAttachedPrivate *get(QQuickDragAttached *attached) {-
12 return
never executed: return static_cast<QQuickDragAttachedPrivate *>(QObjectPrivate::get(attached));
static_cast<QQuickDragAttachedPrivate *>(QObjectPrivate::get(attached));
never executed: return static_cast<QQuickDragAttachedPrivate *>(QObjectPrivate::get(attached));
}
0
13-
14 QQuickDragAttachedPrivate()-
15 : attachedItem(nullptr)-
16 , mimeData(nullptr)-
17 , proposedAction(Qt::MoveAction)-
18 , supportedActions(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction)-
19 , active(false)-
20 , listening(false)-
21 , inEvent(false)-
22 , dragRestarted(false)-
23 , itemMoved(false)-
24 , eventQueued(false)-
25 , overrideActions(false)-
26 , dragType(QQuickDrag::Internal)-
27 {-
28 }
executed 390 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
390
29-
30 void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override;-
31 void itemParentChanged(QQuickItem *, QQuickItem *parent) override;-
32 void updatePosition();-
33 void restartDrag();-
34 void deliverEnterEvent();-
35 void deliverMoveEvent();-
36 void deliverLeaveEvent();-
37 void deliverEvent(QQuickWindow *window, QEvent *event);-
38 void start(Qt::DropActions supportedActions);-
39 Qt::DropAction startDrag(Qt::DropActions supportedActions);-
40 void setTarget(QQuickItem *item);-
41-
42 QQuickDragGrabber dragGrabber;-
43-
44 QPointer<QObject> source;-
45 QPointer<QObject> target;-
46 QPointer<QQuickWindow> window;-
47 QQuickItem *attachedItem;-
48 QQuickDragMimeData *mimeData;-
49 Qt::DropAction proposedAction;-
50 Qt::DropActions supportedActions;-
51 bool active : 1;-
52 bool listening : 1;-
53 bool inEvent : 1;-
54 bool dragRestarted : 1;-
55 bool itemMoved : 1;-
56 bool eventQueued : 1;-
57 bool overrideActions : 1;-
58 QPointF hotSpot;-
59 QUrl imageSource;-
60 QQuickPixmap pixmapLoader;-
61 QStringList keys;-
62 QVariantMap externalMimeData;-
63 QQuickDrag::DragType dragType;-
64};-
65void QQuickDragAttachedPrivate::itemGeometryChanged(QQuickItem *, QQuickGeometryChange change,-
66 const QRectF &)-
67{-
68 if (!change.positionChange()
!change.positionChange()Description
TRUEnever evaluated
FALSEevaluated 214 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
|| !active
!activeDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 200 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
|| itemMoved
itemMovedDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquicklistview
FALSEevaluated 190 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
)
0-214
69 return;
executed 24 times by 3 tests: return;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
24
70 updatePosition();-
71}
executed 190 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
190
72-
73void QQuickDragAttachedPrivate::itemParentChanged(QQuickItem *, QQuickItem *)-
74{-
75 if (!active
!activeDescription
TRUEevaluated 82 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 30 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
|| dragRestarted
dragRestartedDescription
TRUEnever evaluated
FALSEevaluated 30 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
)
0-82
76 return;
executed 82 times by 3 tests: return;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
82
77-
78 QQuickWindow *newWindow = attachedItem->window();-
79-
80 if (window != newWindow
window != newWindowDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquicklistview
)
6-24
81 restartDrag();
executed 24 times by 2 tests: restartDrag();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
24
82 else if (window
windowDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquicklistview
FALSEnever evaluated
)
0-6
83 updatePosition();
executed 6 times by 2 tests: updatePosition();
Executed by:
  • tst_qquickdrag
  • tst_qquicklistview
6
84}
executed 30 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
30
85-
86void QQuickDragAttachedPrivate::updatePosition()-
87{-
88 QQuickDragAttached * const q = q_func();-
89 itemMoved = true;-
90 if (!eventQueued
!eventQueuedDescription
TRUEevaluated 200 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
4-200
91 eventQueued = true;-
92 QCoreApplication::postEvent(q, new QEvent(QEvent::User));-
93 }
executed 200 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
200
94}
executed 204 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
204
95-
96void QQuickDragAttachedPrivate::restartDrag()-
97{-
98 QQuickDragAttached * const q = q_func();-
99 dragRestarted = true;-
100 if (!eventQueued
!eventQueuedDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEnever evaluated
) {
0-30
101 eventQueued = true;-
102 QCoreApplication::postEvent(q, new QEvent(QEvent::User));-
103 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
30
104}
executed 30 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
30
105-
106void QQuickDragAttachedPrivate::deliverEnterEvent()-
107{-
108 dragRestarted = false;-
109 itemMoved = false;-
110-
111 window = attachedItem->window();-
112-
113 mimeData->m_source = source;-
114 if (!overrideActions
!overrideActionsDescription
TRUEevaluated 196 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
)
2-196
115 mimeData->m_supportedActions = supportedActions;
executed 196 times by 3 tests: mimeData->m_supportedActions = supportedActions;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
196
116 mimeData->m_keys = keys;-
117-
118 if (window
windowDescription
TRUEevaluated 194 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
4-194
119 QPoint scenePos = attachedItem->mapToScene(hotSpot).toPoint();-
120 QDragEnterEvent event(scenePos, mimeData->m_supportedActions, mimeData, Qt::NoButton, Qt::NoModifier);-
121 QQuickDropEventEx::setProposedAction(&event, proposedAction);-
122 deliverEvent(window, &event);-
123 }
executed 194 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
194
124}
executed 198 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
198
125-
126void QQuickDragAttachedPrivate::deliverMoveEvent()-
127{-
128 QQuickDragAttached * const q = q_func();-
129-
130 itemMoved = false;-
131 if (window
windowDescription
TRUEevaluated 194 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquicklistview
) {
6-194
132 QPoint scenePos = attachedItem->mapToScene(hotSpot).toPoint();-
133 QDragMoveEvent event(scenePos, mimeData->m_supportedActions, mimeData, Qt::NoButton, Qt::NoModifier);-
134 QQuickDropEventEx::setProposedAction(&event, proposedAction);-
135 deliverEvent(window, &event);-
136 if (target != dragGrabber.target()
target != dragGrabber.target()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEevaluated 182 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
) {
12-182
137 target = dragGrabber.target();-
138 q->targetChanged();-
139 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
12
140 }
executed 194 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
194
141}
executed 200 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
200
142-
143void QQuickDragAttachedPrivate::deliverLeaveEvent()-
144{-
145 if (window
windowDescription
TRUEevaluated 132 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
4-132
146 QDragLeaveEvent event;-
147 deliverEvent(window, &event);-
148 window = nullptr;-
149 }
executed 132 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
132
150}
executed 136 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
136
151-
152void QQuickDragAttachedPrivate::deliverEvent(QQuickWindow *window, QEvent *event)-
153{-
154 ((!inEvent) ? static_cast<void>(0) : qt_assert("!inEvent", __FILE__, 240));-
155 inEvent = true;-
156 QQuickWindowPrivate::get(window)->deliverDragEvent(&dragGrabber, event);-
157 inEvent = false;-
158}
executed 564 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
564
159-
160bool QQuickDragAttached::event(QEvent *event)-
161{-
162 QQuickDragAttachedPrivate * const d = d_func();-
163-
164 if (event->type() == QEvent::User
event->type() == QEvent::UserDescription
TRUEevaluated 210 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEnever evaluated
) {
0-210
165 d->eventQueued = false;-
166 if (d->dragRestarted
d->dragRestartedDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 198 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
) {
12-198
167 d->deliverLeaveEvent();-
168 d->deliverEnterEvent();-
169-
170 if (d->target != d->dragGrabber.target()
d->target != d...abber.target()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
6
171 d->target = d->dragGrabber.target();-
172 targetChanged();-
173 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
6
174 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
else if (d->itemMoved
d->itemMovedDescription
TRUEevaluated 196 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
2-196
175 d->deliverMoveEvent();-
176 }
executed 196 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
196
177 return
executed 210 times by 3 tests: return true;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
true;
executed 210 times by 3 tests: return true;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
210
178 } else {-
179 return
never executed: return QObject::event(event);
QObject::event(event);
never executed: return QObject::event(event);
0
180 }-
181}-
182-
183QQuickDragAttached::QQuickDragAttached(QObject *parent)-
184 : QObject(*new QQuickDragAttachedPrivate, parent)-
185{-
186 QQuickDragAttachedPrivate * const d = d_func();-
187 d->attachedItem = qobject_cast<QQuickItem *>(parent);-
188 d->source = d->attachedItem;-
189}
executed 390 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
390
190-
191QQuickDragAttached::~QQuickDragAttached()-
192{-
193 QQuickDragAttachedPrivate * const d = d_func();-
194 delete d->mimeData;-
195}
executed 390 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
390
196bool QQuickDragAttached::isActive() const-
197{-
198 const QQuickDragAttachedPrivate * const d = d_func();-
199 return
executed 332 times by 3 tests: return d->active;
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
d->active;
executed 332 times by 3 tests: return d->active;
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
332
200}-
201-
202void QQuickDragAttached::setActive(bool active)-
203{-
204 QQuickDragAttachedPrivate * const d = d_func();-
205 if (d->active != active
d->active != activeDescription
TRUEevaluated 198 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 310 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
) {
198-310
206 if (d->inEvent
d->inEventDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 190 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
)
8-190
207 qmlWarning(this) << "active cannot be changed from within a drag event handler";
executed 8 times by 1 test: qmlWarning(this) << "active cannot be changed from within a drag event handler";
Executed by:
  • tst_qquickdrag
8
208 else if (active
activeDescription
TRUEevaluated 116 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
) {
74-116
209 if (d->dragType == QQuickDrag::Internal
d->dragType ==...Drag::InternalDescription
TRUEevaluated 114 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
2-114
210 d->start(d->supportedActions);-
211 }
executed 114 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
else {
114
212 d->active = true;-
213 activeChanged();-
214 if (d->dragType == QQuickDrag::Automatic
d->dragType ==...rag::AutomaticDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
0-2
215-
216-
217 d->startDrag(d->supportedActions);-
218 }
never executed: end of block
0
219 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
2
220 }-
221 else-
222 cancel();
executed 74 times by 3 tests: cancel();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
74
223 }-
224}
executed 508 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
508
225QObject *QQuickDragAttached::source() const-
226{-
227 const QQuickDragAttachedPrivate * const d = d_func();-
228 return
executed 14 times by 1 test: return d->source;
Executed by:
  • tst_qquickdrag
d->source;
executed 14 times by 1 test: return d->source;
Executed by:
  • tst_qquickdrag
14
229}-
230-
231void QQuickDragAttached::setSource(QObject *item)-
232{-
233 QQuickDragAttachedPrivate * const d = d_func();-
234 if (d->source != item
d->source != itemDescription
TRUEevaluated 198 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEnever evaluated
) {
0-198
235 d->source = item;-
236 if (d->active
d->activeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 196 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
)
2-196
237 d->restartDrag();
executed 2 times by 1 test: d->restartDrag();
Executed by:
  • tst_qquickdrag
2
238 sourceChanged();-
239 }
executed 198 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
198
240}
executed 198 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
198
241-
242void QQuickDragAttached::resetSource()-
243{-
244 QQuickDragAttachedPrivate * const d = d_func();-
245 if (d->source != d->attachedItem
d->source != d->attachedItemDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEnever evaluated
) {
0-2
246 d->source = d->attachedItem;-
247 if (d->active
d->activeDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
)
0-2
248 d->restartDrag();
never executed: d->restartDrag();
0
249 sourceChanged();-
250 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
2
251}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
2
252QObject *QQuickDragAttached::target() const-
253{-
254 const QQuickDragAttachedPrivate * const d = d_func();-
255 return
executed 136 times by 1 test: return d->target;
Executed by:
  • tst_qquickdrag
d->target;
executed 136 times by 1 test: return d->target;
Executed by:
  • tst_qquickdrag
136
256}-
257QPointF QQuickDragAttached::hotSpot() const-
258{-
259 const QQuickDragAttachedPrivate * const d = d_func();-
260 return
executed 390 times by 3 tests: return d->hotSpot;
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
d->hotSpot;
executed 390 times by 3 tests: return d->hotSpot;
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
390
261}-
262-
263void QQuickDragAttached::setHotSpot(const QPointF &hotSpot)-
264{-
265 QQuickDragAttachedPrivate * const d = d_func();-
266 if (d->hotSpot != hotSpot
d->hotSpot != hotSpotDescription
TRUEevaluated 294 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
FALSEevaluated 60 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
) {
60-294
267 d->hotSpot = hotSpot;-
268-
269 if (d->active
d->activeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 290 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
)
4-290
270 d->updatePosition();
executed 4 times by 1 test: d->updatePosition();
Executed by:
  • tst_qquickdrag
4
271-
272 hotSpotChanged();-
273 }
executed 294 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
294
274}
executed 354 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
354
275QUrl QQuickDragAttached::imageSource() const-
276{-
277 const QQuickDragAttachedPrivate * const d = d_func();-
278 return
never executed: return d->imageSource;
d->imageSource;
never executed: return d->imageSource;
0
279}-
280-
281void QQuickDragAttached::setImageSource(const QUrl &url)-
282{-
283 QQuickDragAttachedPrivate * const d = d_func();-
284 if (d->imageSource != url
d->imageSource != urlDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
285 d->imageSource = url;-
286-
287 if (url.isEmpty()
url.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
288 d->pixmapLoader.clear();-
289 }
never executed: end of block
else {
0
290 d->pixmapLoader.load(qmlEngine(this), url);-
291 }
never executed: end of block
0
292-
293 imageSourceChanged();-
294 }
never executed: end of block
0
295}
never executed: end of block
0
296QStringList QQuickDragAttached::keys() const-
297{-
298 const QQuickDragAttachedPrivate * const d = d_func();-
299 return
executed 10 times by 1 test: return d->keys;
Executed by:
  • tst_qquickdrag
d->keys;
executed 10 times by 1 test: return d->keys;
Executed by:
  • tst_qquickdrag
10
300}-
301-
302void QQuickDragAttached::setKeys(const QStringList &keys)-
303{-
304 QQuickDragAttachedPrivate * const d = d_func();-
305 if (d->keys != keys
d->keys != keysDescription
TRUEevaluated 54 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEnever evaluated
) {
0-54
306 d->keys = keys;-
307 if (d->active
d->activeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 52 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
)
2-52
308 d->restartDrag();
executed 2 times by 1 test: d->restartDrag();
Executed by:
  • tst_qquickdrag
2
309 keysChanged();-
310 }
executed 54 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
54
311}
executed 54 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
54
312QVariantMap QQuickDragAttached::mimeData() const-
313{-
314 const QQuickDragAttachedPrivate * const d = d_func();-
315 return
never executed: return d->externalMimeData;
d->externalMimeData;
never executed: return d->externalMimeData;
0
316}-
317-
318void QQuickDragAttached::setMimeData(const QVariantMap &mimeData)-
319{-
320 QQuickDragAttachedPrivate * const d = d_func();-
321 if (d->externalMimeData != mimeData
d->externalMim...ta != mimeDataDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-2
322 d->externalMimeData = mimeData;-
323 mimeDataChanged();-
324 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
325}
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
326Qt::DropActions QQuickDragAttached::supportedActions() const-
327{-
328 const QQuickDragAttachedPrivate * const d = d_func();-
329 return
executed 16 times by 1 test: return d->supportedActions;
Executed by:
  • tst_qquickdrag
d->supportedActions;
executed 16 times by 1 test: return d->supportedActions;
Executed by:
  • tst_qquickdrag
16
330}-
331-
332void QQuickDragAttached::setSupportedActions(Qt::DropActions actions)-
333{-
334 QQuickDragAttachedPrivate * const d = d_func();-
335 if (d->supportedActions != actions
d->supportedActions != actionsDescription
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEnever evaluated
) {
0-8
336 d->supportedActions = actions;-
337 if (d->active
d->activeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
)
2-6
338 d->restartDrag();
executed 2 times by 1 test: d->restartDrag();
Executed by:
  • tst_qquickdrag
2
339 supportedActionsChanged();-
340 }
executed 8 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
8
341}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
8
342Qt::DropAction QQuickDragAttached::proposedAction() const-
343{-
344 const QQuickDragAttachedPrivate * const d = d_func();-
345 return
executed 16 times by 1 test: return d->proposedAction;
Executed by:
  • tst_qquickdrag
d->proposedAction;
executed 16 times by 1 test: return d->proposedAction;
Executed by:
  • tst_qquickdrag
16
346}-
347-
348void QQuickDragAttached::setProposedAction(Qt::DropAction action)-
349{-
350 QQuickDragAttachedPrivate * const d = d_func();-
351 if (d->proposedAction != action
d->proposedAction != actionDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEnever evaluated
) {
0-8
352 d->proposedAction = action;-
353-
354-
355-
356 if (d->active
d->activeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
)
4
357 d->updatePosition();
executed 4 times by 1 test: d->updatePosition();
Executed by:
  • tst_qquickdrag
4
358 proposedActionChanged();-
359 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
8
360}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
8
361QQuickDrag::DragType QQuickDragAttached::dragType() const-
362{-
363 const QQuickDragAttachedPrivate * const d = d_func();-
364 return
never executed: return d->dragType;
d->dragType;
never executed: return d->dragType;
0
365}-
366-
367void QQuickDragAttached::setDragType(QQuickDrag::DragType dragType)-
368{-
369 QQuickDragAttachedPrivate * const d = d_func();-
370 if (d->dragType != dragType
d->dragType != dragTypeDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickdrag
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
2-4
371 d->dragType = dragType;-
372 dragTypeChanged();-
373 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
4
374}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickdrag
6
375-
376void QQuickDragAttachedPrivate::start(Qt::DropActions supportedActions)-
377{-
378 QQuickDragAttached * const q = q_func();-
379 ((!active) ? static_cast<void>(0) : qt_assert("!active", __FILE__, 593));-
380-
381 if (!mimeData
!mimeDataDescription
TRUEevaluated 90 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
)
90-96
382 mimeData = new QQuickDragMimeData;
executed 90 times by 3 tests: mimeData = new QQuickDragMimeData;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
90
383 if (!listening
!listeningDescription
TRUEevaluated 90 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
) {
90-96
384 QQuickItemPrivate::get(attachedItem)->addItemChangeListener(-
385 this, QQuickItemPrivate::Geometry | QQuickItemPrivate::Parent);-
386 listening = true;-
387 }
executed 90 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
90
388-
389 mimeData->m_supportedActions = supportedActions;-
390 active = true;-
391 itemMoved = false;-
392 dragRestarted = false;-
393-
394 deliverEnterEvent();-
395-
396 if (target != dragGrabber.target()
target != dragGrabber.target()Description
TRUEevaluated 150 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
) {
36-150
397 target = dragGrabber.target();-
398 q->targetChanged();-
399 }
executed 150 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
150
400-
401 q->activeChanged();-
402}
executed 186 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
186
403void QQuickDragAttached::start(QQmlV4Function *args)-
404{-
405 QQuickDragAttachedPrivate * const d = d_func();-
406 if (d->inEvent
d->inEventDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
8-72
407 qmlWarning(this) << "start() cannot be called from within a drag event handler";-
408 return;
executed 8 times by 1 test: return;
Executed by:
  • tst_qquickdrag
8
409 }-
410-
411 if (d->active
d->activeDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickdrag
)
6-66
412 cancel();
executed 6 times by 1 test: cancel();
Executed by:
  • tst_qquickdrag
6
413-
414 d->overrideActions = false;-
415 Qt::DropActions supportedActions = d->supportedActions;-
416-
417 if (args->length() >= 1
args->length() >= 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qquickdrag
) {
2-70
418 QV4::Scope scope(args->v4engine());-
419 QV4::ScopedValue v(scope, (*args)[0]);-
420 if (v->isInt32()
v->isInt32()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEnever evaluated
) {
0-2
421 supportedActions = Qt::DropActions(v->integerValue());-
422 d->overrideActions = true;-
423 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
2
424 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
2
425-
426 d->start(supportedActions);-
427}
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquickdrag
72
428int QQuickDragAttached::drop()-
429{-
430 QQuickDragAttachedPrivate * const d = d_func();-
431 Qt::DropAction acceptedAction = Qt::IgnoreAction;-
432-
433 if (d->inEvent
d->inEventDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
) {
8-46
434 qmlWarning(this) << "drop() cannot be called from within a drag event handler";-
435 return
executed 8 times by 1 test: return acceptedAction;
Executed by:
  • tst_qquickdrag
acceptedAction;
executed 8 times by 1 test: return acceptedAction;
Executed by:
  • tst_qquickdrag
8
436 }-
437-
438 if (d->itemMoved
d->itemMovedDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
)
4-42
439 d->deliverMoveEvent();
executed 4 times by 1 test: d->deliverMoveEvent();
Executed by:
  • tst_qquickdrag
4
440-
441 if (!d->active
!d->activeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 44 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
)
2-44
442 return
executed 2 times by 1 test: return acceptedAction;
Executed by:
  • tst_qquickdrag
acceptedAction;
executed 2 times by 1 test: return acceptedAction;
Executed by:
  • tst_qquickdrag
2
443 d->active = false;-
444-
445 QObject *target = nullptr;-
446-
447 if (d->window
d->windowDescription
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEnever evaluated
) {
0-44
448 QPoint scenePos = d->attachedItem->mapToScene(d->hotSpot).toPoint();-
449-
450 QDropEvent event(-
451 scenePos, d->mimeData->m_supportedActions, d->mimeData, Qt::NoButton, Qt::NoModifier);-
452 QQuickDropEventEx::setProposedAction(&event, d->proposedAction);-
453 d->deliverEvent(d->window, &event);-
454-
455 if (event.isAccepted()
event.isAccepted()Description
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
) {
6-38
456 acceptedAction = event.dropAction();-
457 target = d->dragGrabber.target();-
458 }
executed 38 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
38
459 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
44
460-
461 if (d->target != target
d->target != targetDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
) {
6-38
462 d->target = target;-
463 targetChanged();-
464 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
6
465-
466 activeChanged();-
467 return
executed 44 times by 2 tests: return acceptedAction;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
acceptedAction;
executed 44 times by 2 tests: return acceptedAction;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
44
468}-
469-
470-
471-
472-
473-
474-
475-
476void QQuickDragAttached::cancel()-
477{-
478 QQuickDragAttachedPrivate * const d = d_func();-
479-
480 if (d->inEvent
d->inEventDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
) {
8-126
481 qmlWarning(this) << "cancel() cannot be called from within a drag event handler";-
482 return;
executed 8 times by 1 test: return;
Executed by:
  • tst_qquickdrag
8
483 }-
484-
485 if (!d->active
!d->activeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 124 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
)
2-124
486 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickdrag
2
487 d->active = false;-
488 d->deliverLeaveEvent();-
489-
490 if (d->target
d->targetDescription
TRUEevaluated 108 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
) {
16-108
491 d->target = nullptr;-
492 targetChanged();-
493 }
executed 108 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
108
494-
495 activeChanged();-
496}
executed 124 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
124
497Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedActions)-
498{-
499 QQuickDragAttached * const q = q_func();-
500-
501 QDrag *drag = new QDrag(source ? source : q);-
502 QMimeData *mimeData = new QMimeData();-
503-
504 for (auto it = externalMimeData.cbegin(), end = externalMimeData.cend(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
505 mimeData->setData(it.key(), it.value().toString().toUtf8());
never executed: mimeData->setData(it.key(), it.value().toString().toUtf8());
0
506-
507 drag->setMimeData(mimeData);-
508 if (pixmapLoader.isReady()
pixmapLoader.isReady()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
509 drag->setPixmap(QPixmap::fromImage(pixmapLoader.image()));-
510 }
never executed: end of block
0
511-
512 drag->setHotSpot(hotSpot.toPoint());-
513 q->dragStarted();-
514-
515 Qt::DropAction dropAction = drag->exec(supportedActions);-
516-
517 if (!QGuiApplicationPrivate::platformIntegration()->drag()->ownsDragObject()
!QGuiApplicati...nsDragObject()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
518 drag->deleteLater();
never executed: drag->deleteLater();
0
519-
520 deliverLeaveEvent();-
521-
522 if (target
targetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
523 target = nullptr;-
524 q->targetChanged();-
525 }
never executed: end of block
0
526-
527 q->dragFinished(dropAction);-
528-
529 active = false;-
530 q->activeChanged();-
531-
532 return
never executed: return dropAction;
dropAction;
never executed: return dropAction;
0
533}-
534void QQuickDragAttached::startDrag(QQmlV4Function *args)-
535{-
536 QQuickDragAttachedPrivate * const d = d_func();-
537-
538 if (d->inEvent
d->inEventDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
539 qmlWarning(this) << "startDrag() cannot be called from within a drag event handler";-
540 return;
never executed: return;
0
541 }-
542-
543 if (!d->active
!d->activeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
544 qmlWarning(this) << "startDrag() drag must be active";-
545 return;
never executed: return;
0
546 }-
547-
548 Qt::DropActions supportedActions = d->supportedActions;-
549-
550-
551 if (args->length() >= 1
args->length() >= 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
552 QV4::Scope scope(args->v4engine());-
553 QV4::ScopedValue v(scope, (*args)[0]);-
554 if (v->isInt32()
v->isInt32()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
555 supportedActions = Qt::DropActions(v->integerValue());-
556 }
never executed: end of block
0
557 }
never executed: end of block
0
558-
559 Qt::DropAction dropAction = d->startDrag(supportedActions);-
560-
561 args->setReturnValue(QV4::Encode((int)dropAction));-
562}
never executed: end of block
0
563-
564QQuickDrag::QQuickDrag(QObject *parent)-
565: QObject(parent), _target(nullptr), _axis(XAndYAxis), _xmin(-3.40282346638528859812e+38F),-
566_xmax(3.40282346638528859812e+38F), _ymin(-3.40282346638528859812e+38F), _ymax(3.40282346638528859812e+38F), _active(false), _filterChildren(false),-
567 _smoothed(true), _threshold(QGuiApplication::styleHints()->startDragDistance())-
568{-
569}
executed 452 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlenginedebugservice
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
452
570-
571QQuickDrag::~QQuickDrag()-
572{-
573}-
574-
575QQuickItem *QQuickDrag::target() const-
576{-
577 return
executed 3208 times by 4 tests: return _target;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_target;
executed 3208 times by 4 tests: return _target;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
3208
578}-
579-
580void QQuickDrag::setTarget(QQuickItem *t)-
581{-
582 if (_target == t
_target == tDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEevaluated 408 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
)
2-408
583 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickmousearea
2
584 _target = t;-
585 targetChanged();-
586}
executed 408 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
408
587-
588void QQuickDrag::resetTarget()-
589{-
590 if (_target == nullptr
_target == nullptrDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
)
2-42
591 return;
executed 42 times by 1 test: return;
Executed by:
  • tst_examples
42
592 _target = nullptr;-
593 targetChanged();-
594}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickmousearea
2
595-
596QQuickDrag::Axis QQuickDrag::axis() const-
597{-
598 return
executed 690 times by 4 tests: return _axis;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_axis;
executed 690 times by 4 tests: return _axis;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
690
599}-
600-
601void QQuickDrag::setAxis(QQuickDrag::Axis a)-
602{-
603 if (_axis == a
_axis == aDescription
TRUEevaluated 64 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
FALSEevaluated 100 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
)
64-100
604 return;
executed 64 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickmousearea
64
605 _axis = a;-
606 axisChanged();-
607}
executed 100 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickmousearea
100
608-
609qreal QQuickDrag::xmin() const-
610{-
611 return
executed 896 times by 5 tests: return _xmin;
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_xmin;
executed 896 times by 5 tests: return _xmin;
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
896
612}-
613-
614void QQuickDrag::setXmin(qreal m)-
615{-
616 if (_xmin == m
_xmin == mDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEevaluated 132 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
)
2-132
617 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickmousearea
2
618 _xmin = m;-
619 minimumXChanged();-
620}
executed 132 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickmousearea
132
621-
622qreal QQuickDrag::xmax() const-
623{-
624 return
executed 612 times by 5 tests: return _xmax;
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_xmax;
executed 612 times by 5 tests: return _xmax;
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
612
625}-
626-
627void QQuickDrag::setXmax(qreal m)-
628{-
629 if (_xmax == m
_xmax == mDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
FALSEevaluated 236 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
)
66-236
630 return;
executed 66 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickmousearea
66
631 _xmax = m;-
632 maximumXChanged();-
633}
executed 236 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickmousearea
236
634-
635qreal QQuickDrag::ymin() const-
636{-
637 return
executed 322 times by 4 tests: return _ymin;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_ymin;
executed 322 times by 4 tests: return _ymin;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
322
638}-
639-
640void QQuickDrag::setYmin(qreal m)-
641{-
642 if (_ymin == m
_ymin == mDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEevaluated 52 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
)
2-52
643 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickmousearea
2
644 _ymin = m;-
645 minimumYChanged();-
646}
executed 52 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickmousearea
52
647-
648qreal QQuickDrag::ymax() const-
649{-
650 return
executed 322 times by 4 tests: return _ymax;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_ymax;
executed 322 times by 4 tests: return _ymax;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
322
651}-
652-
653void QQuickDrag::setYmax(qreal m)-
654{-
655 if (_ymax == m
_ymax == mDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEevaluated 52 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickmousearea
)
2-52
656 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickmousearea
2
657 _ymax = m;-
658 maximumYChanged();-
659}
executed 52 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickmousearea
52
660-
661bool QQuickDrag::smoothed() const-
662{-
663 return
executed 74 times by 4 tests: return _smoothed;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_smoothed;
executed 74 times by 4 tests: return _smoothed;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
74
664}-
665-
666void QQuickDrag::setSmoothed(bool smooth)-
667{-
668 if (_smoothed != smooth
_smoothed != smoothDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEnever evaluated
) {
0-2
669 _smoothed = smooth;-
670 smoothedChanged();-
671 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickmousearea
2
672}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickmousearea
2
673-
674qreal QQuickDrag::threshold() const-
675{-
676 return
executed 682 times by 4 tests: return _threshold;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_threshold;
executed 682 times by 4 tests: return _threshold;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
682
677}-
678-
679void QQuickDrag::setThreshold(qreal value)-
680{-
681 if (_threshold != value
_threshold != valueDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
) {
2-22
682 _threshold = value;-
683 thresholdChanged();-
684 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickmousearea
22
685}
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquickmousearea
24
686-
687void QQuickDrag::resetThreshold()-
688{-
689 setThreshold(QGuiApplication::styleHints()->startDragDistance());-
690}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickmousearea
6
691-
692bool QQuickDrag::active() const-
693{-
694 return
executed 1562 times by 5 tests: return _active;
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
_active;
executed 1562 times by 5 tests: return _active;
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
1562
695}-
696-
697void QQuickDrag::setActive(bool drag)-
698{-
699 if (_active == drag
_active == dragDescription
TRUEevaluated 88 times by 4 tests
Evaluated by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
FALSEevaluated 120 times by 4 tests
Evaluated by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
)
88-120
700 return;
executed 88 times by 4 tests: return;
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
88
701 _active = drag;-
702 activeChanged();-
703}
executed 120 times by 4 tests: end of block
Executed by:
  • tst_qquickflickable
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
120
704-
705bool QQuickDrag::filterChildren() const-
706{-
707 return
executed 44 times by 2 tests: return _filterChildren;
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
_filterChildren;
executed 44 times by 2 tests: return _filterChildren;
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
44
708}-
709-
710void QQuickDrag::setFilterChildren(bool filter)-
711{-
712 if (_filterChildren == filter
_filterChildren == filterDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickmousearea
FALSEevaluated 18 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquickmousearea
)
2-18
713 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickmousearea
2
714 _filterChildren = filter;-
715 filterChildrenChanged();-
716}
executed 18 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickflickable
  • tst_qquickmousearea
18
717-
718QQuickDragAttached *QQuickDrag::qmlAttachedProperties(QObject *obj)-
719{-
720 return
executed 390 times by 4 tests: return new QQuickDragAttached(obj);
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
new QQuickDragAttached(obj);
executed 390 times by 4 tests: return new QQuickDragAttached(obj);
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
390
721}-
722-
723-
724-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0