Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickdrag_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | class QQuickItem; | - | ||||||
9 | class QQuickDrag; | - | ||||||
10 | class QQuickDragPrivate; | - | ||||||
11 | - | |||||||
12 | class 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:
| 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:
| 8 | ||||||
22 | }; | - | ||||||
23 | - | |||||||
24 | typedef QIntrusiveList<Item, &Item::node> ItemList; | - | ||||||
25 | - | |||||||
26 | public: | - | ||||||
27 | QQuickDragGrabber() : m_target(nullptr) {} executed 5756 times by 90 tests: end of block Executed by:
| 5756 | ||||||
28 | ~QQuickDragGrabber() { while (!m_items.isEmpty()
executed 10 times by 1 test: }delete m_items.first(); Executed by:
executed 5720 times by 89 tests: end of block Executed by:
| 10-5720 | ||||||
29 | - | |||||||
30 | - | |||||||
31 | QObject *target() const | - | ||||||
32 | { | - | ||||||
33 | if (m_target
| 38-560 | ||||||
34 | return executed 38 times by 2 tests: m_target;return m_target; Executed by:
executed 38 times by 2 tests: return m_target; Executed by:
| 38 | ||||||
35 | else if (!m_items.isEmpty()
| 28-532 | ||||||
36 | return executed 532 times by 3 tests: *m_items.first();return *m_items.first(); Executed by:
executed 532 times by 3 tests: return *m_items.first(); Executed by:
| 532 | ||||||
37 | else | - | ||||||
38 | return executed 28 times by 2 tests: nullptr;return nullptr; Executed by:
executed 28 times by 2 tests: return nullptr; Executed by:
| 28 | ||||||
39 | } | - | ||||||
40 | void setTarget(QObject *target) { m_target = target; } executed 50 times by 2 tests: end of block Executed by:
| 50 | ||||||
41 | void resetTarget() { m_target = nullptr; } executed 752 times by 3 tests: end of block Executed by:
| 752 | ||||||
42 | - | |||||||
43 | bool isEmpty() const { return never executed: m_items.isEmpty();return 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: m_items.begin();return m_items.begin(); Executed by:
executed 752 times by 3 tests: }return m_items.begin(); Executed by:
| 752 | ||||||
47 | iterator end() { return executed 1598 times by 3 tests: m_items.end();return m_items.end(); Executed by:
executed 1598 times by 3 tests: }return m_items.end(); Executed by:
| 1598 | ||||||
48 | - | |||||||
49 | void grab(QQuickItem *item) { m_items.insert(new Item(item)); } executed 218 times by 3 tests: end of block Executed by:
| 218 | ||||||
50 | iterator release(iterator at) { Item *item = *at; at = at.erase(); delete item; return executed 200 times by 3 tests: at;return at; Executed by:
executed 200 times by 3 tests: }return at; Executed by:
| 200 | ||||||
51 | - | |||||||
52 | private: | - | ||||||
53 | - | |||||||
54 | ItemList m_items; | - | ||||||
55 | QObject *m_target; | - | ||||||
56 | }; | - | ||||||
57 | - | |||||||
58 | class QQuickDropEventEx : public QDropEvent | - | ||||||
59 | { | - | ||||||
60 | public: | - | ||||||
61 | void setProposedAction(Qt::DropAction action) { default_action = action; drop_action = action; } executed 432 times by 3 tests: end of block Executed by:
| 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:
| 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:
| 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:
| 1952 | ||||||
73 | }; | - | ||||||
74 | - | |||||||
75 | class 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 {}; | - | ||||||
86 | public: | - | ||||||
87 | QQuickDragMimeData() | - | ||||||
88 | : m_source(nullptr) | - | ||||||
89 | { | - | ||||||
90 | } executed 90 times by 3 tests: end of block Executed by:
| 90 | ||||||
91 | - | |||||||
92 | QStringList keys() const { return executed 98 times by 2 tests: m_keys;return m_keys; Executed by:
executed 98 times by 2 tests: }return m_keys; Executed by:
| 98 | ||||||
93 | QObject *source() const { return executed 178 times by 2 tests: m_source;return m_source; Executed by:
executed 178 times by 2 tests: }return m_source; Executed by:
| 178 | ||||||
94 | - | |||||||
95 | private: | - | ||||||
96 | QObject *m_source; | - | ||||||
97 | Qt::DropActions m_supportedActions; | - | ||||||
98 | QStringList m_keys; | - | ||||||
99 | - | |||||||
100 | friend class QQuickDragAttached; | - | ||||||
101 | friend class QQuickDragAttachedPrivate; | - | ||||||
102 | }; | - | ||||||
103 | - | |||||||
104 | class QQmlV4Function; | - | ||||||
105 | class QQuickDragAttached; | - | ||||||
106 | class __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 | - | |||||||
132 | public: | - | ||||||
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 | - | |||||||
172 | public : | - | ||||||
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 | - | |||||||
184 | private: | - | ||||||
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 | - | |||||||
198 | class QQuickDragAttachedPrivate; | - | ||||||
199 | class 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: reinterpret_cast<QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 2398 times by 4 tests: } inline const QQuickDragAttachedPrivate* d_func() const { returnreturn reinterpret_cast<QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 914 times by 3 tests: reinterpret_cast<const QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<const QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 914 times by 3 tests: } friend class QQuickDragAttachedPrivate;return reinterpret_cast<const QQuickDragAttachedPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 914-2398 | ||||||
211 | - | |||||||
212 | - | |||||||
213 | - | |||||||
214 | - | |||||||
215 | - | |||||||
216 | - | |||||||
217 | - | |||||||
218 | - | |||||||
219 | - | |||||||
220 | - | |||||||
221 | - | |||||||
222 | public: | - | ||||||
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 | - | |||||||
260 | public : | - | ||||||
261 | void start(QQmlV4Function *); | - | ||||||
262 | void startDrag(QQmlV4Function *); | - | ||||||
263 | void cancel(); | - | ||||||
264 | - | |||||||
265 | public : | - | ||||||
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 code | Preprocessed file |