Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmlobjectmodel_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | class QObject; | - | ||||||
5 | class QQmlChangeSet; | - | ||||||
6 | class QAbstractItemModel; | - | ||||||
7 | - | |||||||
8 | class __attribute__((visibility("default"))) QQmlInstanceModel : public QObject | - | ||||||
9 | { | - | ||||||
10 | public: | - | ||||||
11 | #pragma GCC diagnostic push | - | ||||||
12 | - | |||||||
13 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||
14 | 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: | - | ||||||
15 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||
16 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||
17 | #pragma GCC diagnostic pop | - | ||||||
18 | struct QPrivateSignal {}; | - | ||||||
19 | - | |||||||
20 | - | |||||||
21 | - | |||||||
22 | public: | - | ||||||
23 | virtual ~QQmlInstanceModel() {} | - | ||||||
24 | - | |||||||
25 | enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 }; | - | ||||||
26 | typedef QFlags<ReleaseFlag> ReleaseFlags; | - | ||||||
27 | - | |||||||
28 | virtual int count() const = 0; | - | ||||||
29 | virtual bool isValid() const = 0; | - | ||||||
30 | virtual QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) = 0; | - | ||||||
31 | virtual ReleaseFlags release(QObject *object) = 0; | - | ||||||
32 | virtual void cancel(int) {} | - | ||||||
33 | virtual QString stringValue(int, const QString &) = 0; | - | ||||||
34 | virtual void setWatchedRoles(const QList<QByteArray> &roles) = 0; | - | ||||||
35 | virtual QQmlIncubator::Status incubationStatus(int index) = 0; | - | ||||||
36 | - | |||||||
37 | virtual int indexOf(QObject *object, QObject *objectContext) const = 0; | - | ||||||
38 | virtual const QAbstractItemModel *abstractItemModel() const { return never executed: nullptr;return nullptr; never executed: }return nullptr; | 0 | ||||||
39 | - | |||||||
40 | public : | - | ||||||
41 | void countChanged(); | - | ||||||
42 | void modelUpdated(const QQmlChangeSet &changeSet, bool reset); | - | ||||||
43 | void createdItem(int index, QObject *object); | - | ||||||
44 | void initItem(int index, QObject *object); | - | ||||||
45 | void destroyingItem(QObject *object); | - | ||||||
46 | - | |||||||
47 | protected: | - | ||||||
48 | QQmlInstanceModel(QObjectPrivate &dd, QObject *parent = nullptr) | - | ||||||
49 | : QObject(dd, parent) {} executed 6042 times by 28 tests: end of block Executed by:
| 6042 | ||||||
50 | - | |||||||
51 | private: | - | ||||||
52 | QQmlInstanceModel(const QQmlInstanceModel &) = delete; QQmlInstanceModel &operator=(const QQmlInstanceModel &) = delete; | - | ||||||
53 | }; | - | ||||||
54 | - | |||||||
55 | class QQmlObjectModelAttached; | - | ||||||
56 | class QQmlObjectModelPrivate; | - | ||||||
57 | class __attribute__((visibility("default"))) QQmlObjectModel : public QQmlInstanceModel | - | ||||||
58 | { | - | ||||||
59 | public: | - | ||||||
60 | #pragma GCC diagnostic push | - | ||||||
61 | - | |||||||
62 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||
63 | 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: | - | ||||||
64 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||
65 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||
66 | #pragma GCC diagnostic pop | - | ||||||
67 | struct QPrivateSignal {}; | - | ||||||
68 | inline QQmlObjectModelPrivate* d_func() { return executed 754 times by 6 tests: reinterpret_cast<QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 754 times by 6 tests: } inline const QQmlObjectModelPrivate* d_func() const { returnreturn reinterpret_cast<QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 5898 times by 6 tests: reinterpret_cast<const QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<const QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 5898 times by 6 tests: } friend class QQmlObjectModelPrivate;return reinterpret_cast<const QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 754-5898 | ||||||
69 | - | |||||||
70 | - | |||||||
71 | - | |||||||
72 | - | |||||||
73 | public: | - | ||||||
74 | QQmlObjectModel(QObject *parent=nullptr); | - | ||||||
75 | ~QQmlObjectModel() {} | - | ||||||
76 | - | |||||||
77 | int count() const override; | - | ||||||
78 | bool isValid() const override; | - | ||||||
79 | QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) override; | - | ||||||
80 | ReleaseFlags release(QObject *object) override; | - | ||||||
81 | QString stringValue(int index, const QString &role) override; | - | ||||||
82 | void setWatchedRoles(const QList<QByteArray> &) override {} | - | ||||||
83 | QQmlIncubator::Status incubationStatus(int index) override; | - | ||||||
84 | - | |||||||
85 | int indexOf(QObject *object, QObject *objectContext) const override; | - | ||||||
86 | - | |||||||
87 | QQmlListProperty<QObject> children(); | - | ||||||
88 | - | |||||||
89 | static QQmlObjectModelAttached *qmlAttachedProperties(QObject *obj); | - | ||||||
90 | - | |||||||
91 | QObject *get(int index) const; | - | ||||||
92 | void append(QObject *object); | - | ||||||
93 | void insert(int index, QObject *object); | - | ||||||
94 | void move(int from, int to, int n = 1); | - | ||||||
95 | void remove(int index, int n = 1); | - | ||||||
96 | - | |||||||
97 | public : | - | ||||||
98 | void clear(); | - | ||||||
99 | - | |||||||
100 | public : | - | ||||||
101 | void childrenChanged(); | - | ||||||
102 | - | |||||||
103 | private: | - | ||||||
104 | QQmlObjectModel(const QQmlObjectModel &) = delete; QQmlObjectModel &operator=(const QQmlObjectModel &) = delete; | - | ||||||
105 | }; | - | ||||||
106 | - | |||||||
107 | class QQmlObjectModelAttached : public QObject | - | ||||||
108 | { | - | ||||||
109 | public: | - | ||||||
110 | #pragma GCC diagnostic push | - | ||||||
111 | - | |||||||
112 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||
113 | 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: | - | ||||||
114 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||
115 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||
116 | #pragma GCC diagnostic pop | - | ||||||
117 | struct QPrivateSignal {}; | - | ||||||
118 | - | |||||||
119 | public: | - | ||||||
120 | QQmlObjectModelAttached(QObject *parent) | - | ||||||
121 | : QObject(parent), m_index(-1) {} executed 154 times by 6 tests: end of block Executed by:
| 154 | ||||||
122 | ~QQmlObjectModelAttached() { | - | ||||||
123 | attachedProperties.remove(parent()); | - | ||||||
124 | } executed 154 times by 6 tests: end of block Executed by:
| 154 | ||||||
125 | - | |||||||
126 | - | |||||||
127 | int index() const { return executed 52 times by 3 tests: m_index;return m_index; Executed by:
executed 52 times by 3 tests: }return m_index; Executed by:
| 52 | ||||||
128 | void setIndex(int idx) { | - | ||||||
129 | if (m_index != idx
| 0-240 | ||||||
130 | m_index = idx; | - | ||||||
131 | indexChanged(); | - | ||||||
132 | } executed 240 times by 6 tests: end of block Executed by:
| 240 | ||||||
133 | } executed 240 times by 6 tests: end of block Executed by:
| 240 | ||||||
134 | - | |||||||
135 | static QQmlObjectModelAttached *properties(QObject *obj) { | - | ||||||
136 | QQmlObjectModelAttached *rv = attachedProperties.value(obj); | - | ||||||
137 | if (!rv
| 138-154 | ||||||
138 | rv = new QQmlObjectModelAttached(obj); | - | ||||||
139 | attachedProperties.insert(obj, rv); | - | ||||||
140 | } executed 154 times by 6 tests: end of block Executed by:
| 154 | ||||||
141 | return executed 292 times by 6 tests: rv;return rv; Executed by:
executed 292 times by 6 tests: return rv; Executed by:
| 292 | ||||||
142 | } | - | ||||||
143 | - | |||||||
144 | public : | - | ||||||
145 | void indexChanged(); | - | ||||||
146 | - | |||||||
147 | public: | - | ||||||
148 | int m_index; | - | ||||||
149 | - | |||||||
150 | static QHash<QObject*, QQmlObjectModelAttached*> attachedProperties; | - | ||||||
151 | }; | - | ||||||
152 | - | |||||||
153 | - | |||||||
154 | - | |||||||
155 | - | |||||||
156 | template <> struct QMetaTypeId< QQmlInstanceModel * > { 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< QQmlInstanceModel * >("QQmlInstanceModel *", reinterpret_cast< QQmlInstanceModel * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQmlInstanceModel> > { 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<QQmlInstanceModel> >("QQmlListProperty<QQmlInstanceModel>", reinterpret_cast< QQmlListProperty<QQmlInstanceModel> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - | ||||||
157 | template <> struct QMetaTypeId< QQmlObjectModel * > { 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< QQmlObjectModel * >("QQmlObjectModel *", reinterpret_cast< QQmlObjectModel * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQmlObjectModel> > { 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<QQmlObjectModel> >("QQmlListProperty<QQmlObjectModel>", reinterpret_cast< QQmlListProperty<QQmlObjectModel> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - | ||||||
158 | template <> class QQmlTypeInfo<QQmlObjectModel > { public: enum { hasAttachedProperties = (((QML_HAS_ATTACHED_PROPERTIES) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) }; }; | - | ||||||
Switch to Source code | Preprocessed file |