OpenCoverage

qqmlobjectmodel_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmlobjectmodel_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4class QObject;-
5class QQmlChangeSet;-
6class QAbstractItemModel;-
7-
8class __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-
22public:-
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: return nullptr;
nullptr;
never executed: return nullptr;
}
0
39-
40public :-
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-
47protected:-
48 QQmlInstanceModel(QObjectPrivate &dd, QObject *parent = nullptr)-
49 : QObject(dd, parent) {}
executed 6042 times by 28 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquicktableview
  • ...
6042
50-
51private:-
52 QQmlInstanceModel(const QQmlInstanceModel &) = delete; QQmlInstanceModel &operator=(const QQmlInstanceModel &) = delete;-
53};-
54-
55class QQmlObjectModelAttached;-
56class QQmlObjectModelPrivate;-
57class __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: return reinterpret_cast<QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
reinterpret_cast<QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));
executed 754 times by 6 tests: return reinterpret_cast<QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
} inline const QQmlObjectModelPrivate* d_func() const { return
executed 5898 times by 6 tests: return reinterpret_cast<const QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
reinterpret_cast<const QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));
executed 5898 times by 6 tests: return reinterpret_cast<const QQmlObjectModelPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
} friend class QQmlObjectModelPrivate;
754-5898
69-
70 -
71 -
72-
73public:-
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-
97public :-
98 void clear();-
99-
100public :-
101 void childrenChanged();-
102-
103private:-
104 QQmlObjectModel(const QQmlObjectModel &) = delete; QQmlObjectModel &operator=(const QQmlObjectModel &) = delete;-
105};-
106-
107class 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-
119public:-
120 QQmlObjectModelAttached(QObject *parent)-
121 : QObject(parent), m_index(-1) {}
executed 154 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
154
122 ~QQmlObjectModelAttached() {-
123 attachedProperties.remove(parent());-
124 }
executed 154 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
154
125-
126 -
127 int index() const { return
executed 52 times by 3 tests: return m_index;
Executed by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
m_index;
executed 52 times by 3 tests: return m_index;
Executed by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
}
52
128 void setIndex(int idx) {-
129 if (m_index != idx
m_index != idxDescription
TRUEevaluated 240 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEnever evaluated
) {
0-240
130 m_index = idx;-
131 indexChanged();-
132 }
executed 240 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
240
133 }
executed 240 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
240
134-
135 static QQmlObjectModelAttached *properties(QObject *obj) {-
136 QQmlObjectModelAttached *rv = attachedProperties.value(obj);-
137 if (!rv
!rvDescription
TRUEevaluated 154 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 138 times by 5 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
) {
138-154
138 rv = new QQmlObjectModelAttached(obj);-
139 attachedProperties.insert(obj, rv);-
140 }
executed 154 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
154
141 return
executed 292 times by 6 tests: return rv;
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
rv;
executed 292 times by 6 tests: return rv;
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
292
142 }-
143-
144public :-
145 void indexChanged();-
146-
147public:-
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 codePreprocessed file

Generated by Squish Coco 4.2.0