Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmllistmodel_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | - | |
3 | - | |
4 | static_assert(bool(1 == 1), "Required feature " "qml_list_model" " for file " __FILE__ " not available."); | - |
5 | - | |
6 | - | |
7 | - | |
8 | - | |
9 | class QQmlListModelWorkerAgent; | - |
10 | class ListModel; | - |
11 | class ListLayout; | - |
12 | - | |
13 | namespace QV4 { | - |
14 | struct ModelObject; | - |
15 | } | - |
16 | - | |
17 | class __attribute__((visibility("default"))) QQmlListModel : public QAbstractListModel | - |
18 | { | - |
19 | public: | - |
20 | #pragma GCC diagnostic push | - |
21 | - | |
22 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - |
23 | 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: | - |
24 | #pragma GCC diagnostic ignored "-Wattributes" | - |
25 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - |
26 | #pragma GCC diagnostic pop | - |
27 | struct QPrivateSignal {}; | - |
28 | - | |
29 | - | |
30 | - | |
31 | public: | - |
32 | QQmlListModel(QObject *parent=nullptr); | - |
33 | ~QQmlListModel(); | - |
34 | - | |
35 | QModelIndex index(int row, int column, const QModelIndex &parent) const override; | - |
36 | int rowCount(const QModelIndex &parent) const override; | - |
37 | QVariant data(const QModelIndex &index, int role) const override; | - |
38 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; | - |
39 | QHash<int,QByteArray> roleNames() const override; | - |
40 | - | |
41 | QVariant data(int index, int role) const; | - |
42 | int count() const; | - |
43 | - | |
44 | void clear(); | - |
45 | void remove(QQmlV4Function *args); | - |
46 | void append(QQmlV4Function *args); | - |
47 | void insert(QQmlV4Function *args); | - |
48 | QQmlV4Handle get(int index) const; | - |
49 | void set(int index, const QQmlV4Handle &); | - |
50 | void setProperty(int index, const QString& property, const QVariant& value); | - |
51 | void move(int from, int to, int count); | - |
52 | void sync(); | - |
53 | - | |
54 | QQmlListModelWorkerAgent *agent(); | - |
55 | - | |
56 | bool dynamicRoles() const { return executed 10 times by 1 test: m_dynamicRoles;return m_dynamicRoles; Executed by:
executed 10 times by 1 test: }return m_dynamicRoles; Executed by:
| 10 |
57 | void setDynamicRoles(bool enableDynamicRoles); | - |
58 | - | |
59 | public : | - |
60 | void countChanged(); | - |
61 | - | |
62 | private: | - |
63 | friend class QQmlListModelParser; | - |
64 | friend class QQmlListModelWorkerAgent; | - |
65 | friend class ModelObject; | - |
66 | friend struct QV4::ModelObject; | - |
67 | friend class ModelNodeMetaObject; | - |
68 | friend class ListModel; | - |
69 | friend class ListElement; | - |
70 | friend class DynamicRoleModelNode; | - |
71 | friend class DynamicRoleModelNodeMetaObject; | - |
72 | friend struct StringOrTranslation; | - |
73 | - | |
74 | - | |
75 | QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent); | - |
76 | QQmlListModel(const QQmlListModel *owner, ListModel *data, QV4::ExecutionEngine *engine, QObject *parent=nullptr); | - |
77 | - | |
78 | QV4::ExecutionEngine *engine() const; | - |
79 | - | |
80 | inline bool canMove(int from, int to, int n) const { return executed 190 times by 5 tests: !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0);return !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0); Executed by:
executed 190 times by 5 tests: }return !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0); Executed by:
| 190 |
81 | - | |
82 | QQmlListModelWorkerAgent *m_agent; | - |
83 | mutable QV4::ExecutionEngine *m_engine; | - |
84 | QQmlRefPointer<QV4::CompiledData::CompilationUnit> m_compilationUnit; | - |
85 | bool m_mainThread; | - |
86 | bool m_primary; | - |
87 | - | |
88 | bool m_dynamicRoles; | - |
89 | - | |
90 | ListLayout *m_layout; | - |
91 | ListModel *m_listModel; | - |
92 | - | |
93 | QVector<class DynamicRoleModelNode *> m_modelObjects; | - |
94 | QVector<QString> m_roles; | - |
95 | - | |
96 | struct ElementSync | - |
97 | { | - |
98 | DynamicRoleModelNode *src = nullptr; | - |
99 | DynamicRoleModelNode *target = nullptr; | - |
100 | int srcIndex = -1; | - |
101 | int targetIndex = -1; | - |
102 | QVector<int> changedRoles; | - |
103 | }; | - |
104 | - | |
105 | static bool sync(QQmlListModel *src, QQmlListModel *target); | - |
106 | static QQmlListModel *createWithOwner(QQmlListModel *newOwner); | - |
107 | - | |
108 | void emitItemsChanged(int index, int count, const QVector<int> &roles); | - |
109 | void emitItemsAboutToBeInserted(int index, int count); | - |
110 | void emitItemsInserted(); | - |
111 | - | |
112 | void removeElements(int index, int removeCount); | - |
113 | }; | - |
114 | - | |
115 | - | |
116 | class QQmlListElement : public QObject | - |
117 | { | - |
118 | public: | - |
119 | #pragma GCC diagnostic push | - |
120 | - | |
121 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - |
122 | 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: | - |
123 | #pragma GCC diagnostic ignored "-Wattributes" | - |
124 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - |
125 | #pragma GCC diagnostic pop | - |
126 | struct QPrivateSignal {}; | - |
127 | }; | - |
128 | - | |
129 | class QQmlListModelParser : public QQmlCustomParser | - |
130 | { | - |
131 | public: | - |
132 | enum PropertyType { | - |
133 | Invalid, | - |
134 | Boolean, | - |
135 | Number, | - |
136 | String, | - |
137 | Script | - |
138 | }; | - |
139 | - | |
140 | - | |
141 | QQmlListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {} executed 12 times by 6 tests: end of block Executed by:
| 12 |
142 | - | |
143 | void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override; | - |
144 | void applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override; | - |
145 | - | |
146 | private: | - |
147 | bool verifyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding); | - |
148 | - | |
149 | bool applyProperty(QV4::CompiledData::CompilationUnit *compilationUnit, const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex); | - |
150 | - | |
151 | static bool definesEmptyList(const QString &); | - |
152 | - | |
153 | QString listElementTypeName; | - |
154 | }; | - |
155 | - | |
156 | - | |
157 | - | |
158 | template <> struct QMetaTypeId< QQmlListModel * > { 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< QQmlListModel * >("QQmlListModel *", reinterpret_cast< QQmlListModel * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQmlListModel> > { 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<QQmlListModel> >("QQmlListProperty<QQmlListModel>", reinterpret_cast< QQmlListProperty<QQmlListModel> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - |
159 | template <> struct QMetaTypeId< QQmlListElement * > { 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< QQmlListElement * >("QQmlListElement *", reinterpret_cast< QQmlListElement * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQmlListElement> > { 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<QQmlListElement> >("QQmlListProperty<QQmlListElement>", reinterpret_cast< QQmlListProperty<QQmlListElement> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - |
Switch to Source code | Preprocessed file |