OpenCoverage

qquickdrag_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickdrag_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8class QQuickItem;-
9class QQuickDrag;-
10class QQuickDragPrivate;-
11-
12class QQuickDragGrabber-
13{-
14 class Item : public QQmlGuard<QQuickItem>-
15 {-
16 public:-
17 Item(QQuickItem *item) : QQmlGuard<QQuickItem>(item) {}
executed 218 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
218
18-
19 QIntrusiveListNode node;-
20 protected:-
21 void objectDestroyed(QQuickItem *) override { delete this; }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
8
22 };-
23-
24 typedef QIntrusiveList<Item, &Item::node> ItemList;-
25-
26public:-
27 QQuickDragGrabber() : m_target(nullptr) {}
executed 5756 times by 90 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • ...
5756
28 ~QQuickDragGrabber() { while (!m_items.isEmpty()
!m_items.isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickdrag
FALSEevaluated 5720 times by 89 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • tst_qquickdynamicpropertyanimation
  • ...
) delete m_items.first();
executed 10 times by 1 test: delete m_items.first();
Executed by:
  • tst_qquickdrag
}
executed 5720 times by 89 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • tst_qquickdynamicpropertyanimation
  • ...
10-5720
29-
30-
31 QObject *target() const-
32 {-
33 if (m_target
m_targetDescription
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
FALSEevaluated 560 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
)
38-560
34 return
executed 38 times by 2 tests: return m_target;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
m_target;
executed 38 times by 2 tests: return m_target;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
38
35 else if (!m_items.isEmpty()
!m_items.isEmpty()Description
TRUEevaluated 532 times by 3 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquickdrag
  • tst_qquickdroparea
)
28-532
36 return
executed 532 times by 3 tests: return *m_items.first();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
*m_items.first();
executed 532 times by 3 tests: return *m_items.first();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
532
37 else-
38 return
executed 28 times by 2 tests: return nullptr;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
nullptr;
executed 28 times by 2 tests: return nullptr;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
28
39 }-
40 void setTarget(QObject *target) { m_target = target; }
executed 50 times by 2 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
50
41 void resetTarget() { m_target = nullptr; }
executed 752 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
752
42-
43 bool isEmpty() const { return
never executed: return m_items.isEmpty();
m_items.isEmpty();
never executed: return m_items.isEmpty();
}
0
44-
45 typedef ItemList::iterator iterator;-
46 iterator begin() { return
executed 752 times by 3 tests: return m_items.begin();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
m_items.begin();
executed 752 times by 3 tests: return m_items.begin();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
}
752
47 iterator end() { return
executed 1598 times by 3 tests: return m_items.end();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
m_items.end();
executed 1598 times by 3 tests: return m_items.end();
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
}
1598
48-
49 void grab(QQuickItem *item) { m_items.insert(new Item(item)); }
executed 218 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
218
50 iterator release(iterator at) { Item *item = *at; at = at.erase(); delete item; return
executed 200 times by 3 tests: return at;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
at;
executed 200 times by 3 tests: return at;
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
}
200
51-
52private:-
53-
54 ItemList m_items;-
55 QObject *m_target;-
56};-
57-
58class QQuickDropEventEx : public QDropEvent-
59{-
60public:-
61 void setProposedAction(Qt::DropAction action) { default_action = action; drop_action = action; }
executed 432 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
432
62-
63 static void setProposedAction(QDropEvent *event, Qt::DropAction action) {-
64 static_cast<QQuickDropEventEx *>(event)->setProposedAction(action);-
65 }
executed 432 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
432
66-
67 void copyActions(const QDropEvent &from) {-
68 default_action = from.proposedAction(); drop_action = from.dropAction(); }
executed 1952 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
1952
69-
70 static void copyActions(QDropEvent *to, const QDropEvent &from) {-
71 static_cast<QQuickDropEventEx *>(to)->copyActions(from);-
72 }
executed 1952 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
1952
73};-
74-
75class QQuickDragMimeData : public QMimeData-
76{-
77 public:-
78#pragma GCC diagnostic push-
79 -
80#pragma GCC diagnostic ignored "-Wsuggest-override"-
81 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
82#pragma GCC diagnostic ignored "-Wattributes"-
83 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
84#pragma GCC diagnostic pop-
85 struct QPrivateSignal {};-
86public:-
87 QQuickDragMimeData()-
88 : m_source(nullptr)-
89 {-
90 }
executed 90 times by 3 tests: end of block
Executed by:
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
90
91-
92 QStringList keys() const { return
executed 98 times by 2 tests: return m_keys;
Executed by:
  • tst_qquickdroparea
  • tst_qquicklistview
m_keys;
executed 98 times by 2 tests: return m_keys;
Executed by:
  • tst_qquickdroparea
  • tst_qquicklistview
}
98
93 QObject *source() const { return
executed 178 times by 2 tests: return m_source;
Executed by:
  • tst_qquickdroparea
  • tst_qquicklistview
m_source;
executed 178 times by 2 tests: return m_source;
Executed by:
  • tst_qquickdroparea
  • tst_qquicklistview
}
178
94-
95private:-
96 QObject *m_source;-
97 Qt::DropActions m_supportedActions;-
98 QStringList m_keys;-
99-
100 friend class QQuickDragAttached;-
101 friend class QQuickDragAttachedPrivate;-
102};-
103-
104class QQmlV4Function;-
105class QQuickDragAttached;-
106class __attribute__((visibility("default"))) QQuickDrag : public QObject-
107{-
108 public:-
109#pragma GCC diagnostic push-
110 -
111#pragma GCC diagnostic ignored "-Wsuggest-override"-
112 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
113#pragma GCC diagnostic ignored "-Wattributes"-
114 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
115#pragma GCC diagnostic pop-
116 struct QPrivateSignal {};-
117-
118 -
119 -
120 -
121 -
122 -
123 -
124 -
125 -
126 -
127-
128-
129 -
130-
131-
132public:-
133 QQuickDrag(QObject *parent=nullptr);-
134 ~QQuickDrag();-
135-
136 enum DragType { None, Automatic, Internal };-
137 friend constexpr const QMetaObject *qt_getEnumMetaObject(DragType) noexcept { return &staticMetaObject; } friend constexpr const char *qt_getEnumName(DragType) noexcept { return "DragType"; }-
138-
139 QQuickItem *target() const;-
140 void setTarget(QQuickItem *target);-
141 void resetTarget();-
142-
143 enum Axis { XAxis=0x01, YAxis=0x02, XAndYAxis=0x03, XandYAxis=XAndYAxis };-
144 friend constexpr const QMetaObject *qt_getEnumMetaObject(Axis) noexcept { return &staticMetaObject; } friend constexpr const char *qt_getEnumName(Axis) noexcept { return "Axis"; }-
145 Axis axis() const;-
146 void setAxis(Axis);-
147-
148 qreal xmin() const;-
149 void setXmin(qreal);-
150 qreal xmax() const;-
151 void setXmax(qreal);-
152 qreal ymin() const;-
153 void setYmin(qreal);-
154 qreal ymax() const;-
155 void setYmax(qreal);-
156-
157 bool smoothed() const;-
158 void setSmoothed(bool smooth);-
159-
160 qreal threshold() const;-
161 void setThreshold(qreal);-
162 void resetThreshold();-
163-
164 bool active() const;-
165 void setActive(bool);-
166-
167 bool filterChildren() const;-
168 void setFilterChildren(bool);-
169-
170 static QQuickDragAttached *qmlAttachedProperties(QObject *obj);-
171-
172public :-
173 void targetChanged();-
174 void axisChanged();-
175 void minimumXChanged();-
176 void maximumXChanged();-
177 void minimumYChanged();-
178 void maximumYChanged();-
179 void activeChanged();-
180 void filterChildrenChanged();-
181 void smoothedChanged();-
182 void thresholdChanged();-
183-
184private:-
185 QQuickItem *_target;-
186 Axis _axis;-
187 qreal _xmin;-
188 qreal _xmax;-
189 qreal _ymin;-
190 qreal _ymax;-
191 bool _active : 1;-
192 bool _filterChildren: 1;-
193 bool _smoothed : 1;-
194 qreal _threshold;-
195 QQuickDrag(const QQuickDrag &) = delete; QQuickDrag &operator=(const QQuickDrag &) = delete;-
196};-
197-
198class QQuickDragAttachedPrivate;-
199class QQuickDragAttached : public QObject-
200{-
201 public:-
202#pragma GCC diagnostic push-
203 -
204#pragma GCC diagnostic ignored "-Wsuggest-override"-
205 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
206#pragma GCC diagnostic ignored "-Wattributes"-
207 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
208#pragma GCC diagnostic pop-
209 struct QPrivateSignal {};-
210 inline QQuickDragAttachedPrivate* d_func() { return
executed 2398 times by 4 tests: return reinterpret_cast<QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
reinterpret_cast<QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));
executed 2398 times by 4 tests: return reinterpret_cast<QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquicklistview
} inline const QQuickDragAttachedPrivate* d_func() const { return
executed 914 times by 3 tests: return reinterpret_cast<const QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
reinterpret_cast<const QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));
executed 914 times by 3 tests: return reinterpret_cast<const QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qquickdrag
  • tst_qquicklistview
} friend class QQuickDragAttachedPrivate;
914-2398
211-
212 -
213 -
214 -
215 -
216 -
217 -
218 -
219 -
220 -
221 -
222public:-
223 QQuickDragAttached(QObject *parent);-
224 ~QQuickDragAttached();-
225-
226 bool isActive() const;-
227 void setActive(bool active);-
228-
229 QObject *source() const;-
230 void setSource(QObject *item);-
231 void resetSource();-
232-
233 QObject *target() const;-
234-
235 QPointF hotSpot() const;-
236 void setHotSpot(const QPointF &hotSpot);-
237-
238 QUrl imageSource() const;-
239 void setImageSource(const QUrl &url);-
240-
241 QStringList keys() const;-
242 void setKeys(const QStringList &keys);-
243-
244 QVariantMap mimeData() const;-
245 void setMimeData(const QVariantMap &mimeData);-
246-
247 Qt::DropActions supportedActions() const;-
248 void setSupportedActions(Qt::DropActions actions);-
249-
250 Qt::DropAction proposedAction() const;-
251 void setProposedAction(Qt::DropAction action);-
252-
253 QQuickDrag::DragType dragType() const;-
254 void setDragType(QQuickDrag::DragType dragType);-
255-
256 int drop();-
257-
258 bool event(QEvent *event) override;-
259-
260public :-
261 void start(QQmlV4Function *);-
262 void startDrag(QQmlV4Function *);-
263 void cancel();-
264-
265public :-
266 void dragStarted();-
267 void dragFinished(Qt::DropAction dropAction);-
268-
269 void activeChanged();-
270 void sourceChanged();-
271 void targetChanged();-
272 void hotSpotChanged();-
273 void imageSourceChanged();-
274 void keysChanged();-
275 void mimeDataChanged();-
276 void supportedActionsChanged();-
277 void proposedActionChanged();-
278 void dragTypeChanged();-
279};-
280-
281-
282-
283 template <> struct QMetaTypeId< QQuickDrag * > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QQuickDrag * >("QQuickDrag *", reinterpret_cast< QQuickDrag * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQuickDrag> > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QQmlListProperty<QQuickDrag> >("QQmlListProperty<QQuickDrag>", reinterpret_cast< QQmlListProperty<QQuickDrag> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } };-
284 template <> class QQmlTypeInfo<QQuickDrag > { public: enum { hasAttachedProperties = (((QML_HAS_ATTACHED_PROPERTIES) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) }; };-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0