Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmlinstantiator.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | QQmlInstantiatorPrivate::QQmlInstantiatorPrivate() | - | ||||||||||||||||||||||||
7 | : componentComplete(true) | - | ||||||||||||||||||||||||
8 | , effectiveReset(false) | - | ||||||||||||||||||||||||
9 | , active(true) | - | ||||||||||||||||||||||||
10 | , async(false) | - | ||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||
12 | , ownModel(false) | - | ||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||
14 | , requestedIndex(-1) | - | ||||||||||||||||||||||||
15 | , model(QVariant(1)) | - | ||||||||||||||||||||||||
16 | , instanceModel(nullptr) | - | ||||||||||||||||||||||||
17 | , delegate(nullptr) | - | ||||||||||||||||||||||||
18 | { | - | ||||||||||||||||||||||||
19 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||
21 | QQmlInstantiatorPrivate::~QQmlInstantiatorPrivate() | - | ||||||||||||||||||||||||
22 | { | - | ||||||||||||||||||||||||
23 | qDeleteAll(objects); | - | ||||||||||||||||||||||||
24 | } never executed: end of block | 0 | ||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||
26 | void QQmlInstantiatorPrivate::clear() | - | ||||||||||||||||||||||||
27 | { | - | ||||||||||||||||||||||||
28 | QQmlInstantiator * const q = q_func(); | - | ||||||||||||||||||||||||
29 | if (!instanceModel
| 0-20 | ||||||||||||||||||||||||
30 | return; never executed: return; | 0 | ||||||||||||||||||||||||
31 | if (!objects.count()
| 2-18 | ||||||||||||||||||||||||
32 | return; executed 18 times by 1 test: return; Executed by:
| 18 | ||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||
34 | for (int i=0; i < objects.count()
| 2-20 | ||||||||||||||||||||||||
35 | q->objectRemoved(i, objects[i]); | - | ||||||||||||||||||||||||
36 | instanceModel->release(objects[i]); | - | ||||||||||||||||||||||||
37 | } executed 20 times by 1 test: end of block Executed by:
| 20 | ||||||||||||||||||||||||
38 | objects.clear(); | - | ||||||||||||||||||||||||
39 | q->objectChanged(); | - | ||||||||||||||||||||||||
40 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||
41 | - | |||||||||||||||||||||||||
42 | QObject *QQmlInstantiatorPrivate::modelObject(int index, bool async) | - | ||||||||||||||||||||||||
43 | { | - | ||||||||||||||||||||||||
44 | requestedIndex = index; | - | ||||||||||||||||||||||||
45 | QObject *o = instanceModel->object(index, async ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); | - | ||||||||||||||||||||||||
46 | requestedIndex = -1; | - | ||||||||||||||||||||||||
47 | return executed 104 times by 1 test: o;return o; Executed by:
executed 104 times by 1 test: return o; Executed by:
| 104 | ||||||||||||||||||||||||
48 | } | - | ||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||
51 | void QQmlInstantiatorPrivate::regenerate() | - | ||||||||||||||||||||||||
52 | { | - | ||||||||||||||||||||||||
53 | QQmlInstantiator * const q = q_func(); | - | ||||||||||||||||||||||||
54 | if (!componentComplete
| 2-20 | ||||||||||||||||||||||||
55 | return; executed 2 times by 1 test: return; Executed by:
| 2 | ||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||
57 | int prevCount = q->count(); | - | ||||||||||||||||||||||||
58 | - | |||||||||||||||||||||||||
59 | clear(); | - | ||||||||||||||||||||||||
60 | - | |||||||||||||||||||||||||
61 | if (!active
| 0-18 | ||||||||||||||||||||||||
62 | if (prevCount
| 0-4 | ||||||||||||||||||||||||
63 | q->countChanged(); never executed: q->countChanged(); | 0 | ||||||||||||||||||||||||
64 | return; executed 4 times by 1 test: return; Executed by:
| 4 | ||||||||||||||||||||||||
65 | } | - | ||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||
67 | for (int i = 0; i < instanceModel->count()
| 16-96 | ||||||||||||||||||||||||
68 | QObject *object = modelObject(i, async); | - | ||||||||||||||||||||||||
69 | - | |||||||||||||||||||||||||
70 | if (object
| 40-56 | ||||||||||||||||||||||||
71 | _q_createdItem(i, object); executed 56 times by 1 test: _q_createdItem(i, object); Executed by:
| 56 | ||||||||||||||||||||||||
72 | } executed 96 times by 1 test: end of block Executed by:
| 96 | ||||||||||||||||||||||||
73 | if (q->count() != prevCount
| 4-12 | ||||||||||||||||||||||||
74 | q->countChanged(); executed 12 times by 1 test: q->countChanged(); Executed by:
| 12 | ||||||||||||||||||||||||
75 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||
77 | void QQmlInstantiatorPrivate::_q_createdItem(int idx, QObject* item) | - | ||||||||||||||||||||||||
78 | { | - | ||||||||||||||||||||||||
79 | QQmlInstantiator * const q = q_func(); | - | ||||||||||||||||||||||||
80 | if (objects.contains(item)
| 64-104 | ||||||||||||||||||||||||
81 | return; executed 64 times by 1 test: return; Executed by:
| 64 | ||||||||||||||||||||||||
82 | if (requestedIndex != idx
| 40-64 | ||||||||||||||||||||||||
83 | ( executed 40 times by 1 test: void)instanceModel->object(idx);(void)instanceModel->object(idx); Executed by:
executed 40 times by 1 test: (void)instanceModel->object(idx); Executed by:
| 40 | ||||||||||||||||||||||||
84 | item->setParent(q); | - | ||||||||||||||||||||||||
85 | if (objects.size() < idx + 1
| 44-60 | ||||||||||||||||||||||||
86 | int modelCount = instanceModel->count(); | - | ||||||||||||||||||||||||
87 | if (objects.capacity() < modelCount
| 14-46 | ||||||||||||||||||||||||
88 | objects.reserve(modelCount); executed 14 times by 1 test: objects.reserve(modelCount); Executed by:
| 14 | ||||||||||||||||||||||||
89 | objects.resize(idx + 1); | - | ||||||||||||||||||||||||
90 | } executed 60 times by 1 test: end of block Executed by:
| 60 | ||||||||||||||||||||||||
91 | if (QObject *o = objects.at(idx)
| 0-104 | ||||||||||||||||||||||||
92 | instanceModel->release(o); never executed: instanceModel->release(o); | 0 | ||||||||||||||||||||||||
93 | objects.replace(idx, item); | - | ||||||||||||||||||||||||
94 | if (objects.count() == 1
| 14-90 | ||||||||||||||||||||||||
95 | q->objectChanged(); executed 14 times by 1 test: q->objectChanged(); Executed by:
| 14 | ||||||||||||||||||||||||
96 | q->objectAdded(idx, item); | - | ||||||||||||||||||||||||
97 | } executed 104 times by 1 test: end of block Executed by:
| 104 | ||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||
99 | void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bool reset) | - | ||||||||||||||||||||||||
100 | { | - | ||||||||||||||||||||||||
101 | QQmlInstantiator * const q = q_func(); | - | ||||||||||||||||||||||||
102 | - | |||||||||||||||||||||||||
103 | if (!componentComplete
| 0-14 | ||||||||||||||||||||||||
104 | return; executed 4 times by 1 test: return; Executed by:
| 4 | ||||||||||||||||||||||||
105 | - | |||||||||||||||||||||||||
106 | if (reset
| 0-10 | ||||||||||||||||||||||||
107 | regenerate(); | - | ||||||||||||||||||||||||
108 | if (changeSet.difference() != 0
| 0 | ||||||||||||||||||||||||
109 | q->countChanged(); never executed: q->countChanged(); | 0 | ||||||||||||||||||||||||
110 | return; never executed: return; | 0 | ||||||||||||||||||||||||
111 | } | - | ||||||||||||||||||||||||
112 | - | |||||||||||||||||||||||||
113 | int difference = 0; | - | ||||||||||||||||||||||||
114 | QHash<int, QVector<QPointer<QObject> > > moved; | - | ||||||||||||||||||||||||
115 | const QVector<QQmlChangeSet::Change> &removes = changeSet.removes(); | - | ||||||||||||||||||||||||
116 | for (const QQmlChangeSet::Change &remove : removes) { | - | ||||||||||||||||||||||||
117 | int index = qMin(remove.index, objects.count()); | - | ||||||||||||||||||||||||
118 | int count = qMin(remove.index + remove.count, objects.count()) - index; | - | ||||||||||||||||||||||||
119 | if (remove.isMove()
| 0-2 | ||||||||||||||||||||||||
120 | moved.insert(remove.moveId, objects.mid(index, count)); | - | ||||||||||||||||||||||||
121 | objects.erase( | - | ||||||||||||||||||||||||
122 | objects.begin() + index, | - | ||||||||||||||||||||||||
123 | objects.begin() + index + count); | - | ||||||||||||||||||||||||
124 | } never executed: else while (count--end of block
| 0-2 | ||||||||||||||||||||||||
125 | QObject *obj = objects.at(index); | - | ||||||||||||||||||||||||
126 | objects.remove(index); | - | ||||||||||||||||||||||||
127 | q->objectRemoved(index, obj); | - | ||||||||||||||||||||||||
128 | if (obj
| 0-2 | ||||||||||||||||||||||||
129 | instanceModel->release(obj); executed 2 times by 1 test: instanceModel->release(obj); Executed by:
| 2 | ||||||||||||||||||||||||
130 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||
131 | - | |||||||||||||||||||||||||
132 | difference -= remove.count; | - | ||||||||||||||||||||||||
133 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||
134 | - | |||||||||||||||||||||||||
135 | const QVector<QQmlChangeSet::Change> &inserts = changeSet.inserts(); | - | ||||||||||||||||||||||||
136 | for (const QQmlChangeSet::Change &insert : inserts) { | - | ||||||||||||||||||||||||
137 | int index = qMin(insert.index, objects.count()); | - | ||||||||||||||||||||||||
138 | if (insert.isMove()
| 0-8 | ||||||||||||||||||||||||
139 | QVector<QPointer<QObject> > movedObjects = moved.value(insert.moveId); | - | ||||||||||||||||||||||||
140 | objects = objects.mid(0, index) + movedObjects + objects.mid(index); | - | ||||||||||||||||||||||||
141 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
142 | if (insert.index <= objects.size()
| 0-8 | ||||||||||||||||||||||||
143 | objects.insert(insert.index, insert.count, nullptr); executed 8 times by 1 test: objects.insert(insert.index, insert.count, nullptr); Executed by:
| 8 | ||||||||||||||||||||||||
144 | for (int i = 0; i < insert.count
| 8 | ||||||||||||||||||||||||
145 | int modelIndex = index + i; | - | ||||||||||||||||||||||||
146 | QObject* obj = modelObject(modelIndex, async); | - | ||||||||||||||||||||||||
147 | if (obj
| 0-8 | ||||||||||||||||||||||||
148 | _q_createdItem(modelIndex, obj); executed 8 times by 1 test: _q_createdItem(modelIndex, obj); Executed by:
| 8 | ||||||||||||||||||||||||
149 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
150 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
151 | difference += insert.count; | - | ||||||||||||||||||||||||
152 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||
154 | if (difference != 0
| 0-10 | ||||||||||||||||||||||||
155 | q->countChanged(); executed 10 times by 1 test: q->countChanged(); Executed by:
| 10 | ||||||||||||||||||||||||
156 | } executed 10 times by 1 test: end of block Executed by:
| 10 | ||||||||||||||||||||||||
157 | - | |||||||||||||||||||||||||
158 | - | |||||||||||||||||||||||||
159 | void QQmlInstantiatorPrivate::makeModel() | - | ||||||||||||||||||||||||
160 | { | - | ||||||||||||||||||||||||
161 | QQmlInstantiator * const q = q_func(); | - | ||||||||||||||||||||||||
162 | QQmlDelegateModel* delegateModel = new QQmlDelegateModel(qmlContext(q), q); | - | ||||||||||||||||||||||||
163 | instanceModel = delegateModel; | - | ||||||||||||||||||||||||
164 | ownModel = true; | - | ||||||||||||||||||||||||
165 | delegateModel->setDelegate(delegate); | - | ||||||||||||||||||||||||
166 | delegateModel->classBegin(); | - | ||||||||||||||||||||||||
167 | if (componentComplete
| 0-16 | ||||||||||||||||||||||||
168 | delegateModel->componentComplete(); executed 16 times by 1 test: delegateModel->componentComplete(); Executed by:
| 16 | ||||||||||||||||||||||||
169 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||||||||
170 | QQmlInstantiator::QQmlInstantiator(QObject *parent) | - | ||||||||||||||||||||||||
171 | : QObject(*(new QQmlInstantiatorPrivate), parent) | - | ||||||||||||||||||||||||
172 | { | - | ||||||||||||||||||||||||
173 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
174 | - | |||||||||||||||||||||||||
175 | QQmlInstantiator::~QQmlInstantiator() | - | ||||||||||||||||||||||||
176 | { | - | ||||||||||||||||||||||||
177 | } | - | ||||||||||||||||||||||||
178 | bool QQmlInstantiator::isActive() const | - | ||||||||||||||||||||||||
179 | { | - | ||||||||||||||||||||||||
180 | const QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
181 | return executed 16 times by 1 test: d->active;return d->active; Executed by:
executed 16 times by 1 test: return d->active; Executed by:
| 16 | ||||||||||||||||||||||||
182 | } | - | ||||||||||||||||||||||||
183 | - | |||||||||||||||||||||||||
184 | void QQmlInstantiator::setActive(bool newVal) | - | ||||||||||||||||||||||||
185 | { | - | ||||||||||||||||||||||||
186 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
187 | if (newVal == d->active
| 0-4 | ||||||||||||||||||||||||
188 | return; never executed: return; | 0 | ||||||||||||||||||||||||
189 | d->active = newVal; | - | ||||||||||||||||||||||||
190 | activeChanged(); | - | ||||||||||||||||||||||||
191 | d->regenerate(); | - | ||||||||||||||||||||||||
192 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
193 | bool QQmlInstantiator::isAsync() const | - | ||||||||||||||||||||||||
194 | { | - | ||||||||||||||||||||||||
195 | const QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
196 | return never executed: d->async;return d->async; never executed: return d->async; | 0 | ||||||||||||||||||||||||
197 | } | - | ||||||||||||||||||||||||
198 | - | |||||||||||||||||||||||||
199 | void QQmlInstantiator::setAsync(bool newVal) | - | ||||||||||||||||||||||||
200 | { | - | ||||||||||||||||||||||||
201 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
202 | if (newVal == d->async
| 0-2 | ||||||||||||||||||||||||
203 | return; never executed: return; | 0 | ||||||||||||||||||||||||
204 | d->async = newVal; | - | ||||||||||||||||||||||||
205 | asynchronousChanged(); | - | ||||||||||||||||||||||||
206 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||
207 | int QQmlInstantiator::count() const | - | ||||||||||||||||||||||||
208 | { | - | ||||||||||||||||||||||||
209 | const QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
210 | return executed 56 times by 1 test: d->objects.count();return d->objects.count(); Executed by:
executed 56 times by 1 test: return d->objects.count(); Executed by:
| 56 | ||||||||||||||||||||||||
211 | } | - | ||||||||||||||||||||||||
212 | QQmlComponent* QQmlInstantiator::delegate() | - | ||||||||||||||||||||||||
213 | { | - | ||||||||||||||||||||||||
214 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
215 | return executed 6 times by 1 test: d->delegate;return d->delegate; Executed by:
executed 6 times by 1 test: return d->delegate; Executed by:
| 6 | ||||||||||||||||||||||||
216 | } | - | ||||||||||||||||||||||||
217 | - | |||||||||||||||||||||||||
218 | void QQmlInstantiator::setDelegate(QQmlComponent* c) | - | ||||||||||||||||||||||||
219 | { | - | ||||||||||||||||||||||||
220 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
221 | if (c == d->delegate
| 0-18 | ||||||||||||||||||||||||
222 | return; never executed: return; | 0 | ||||||||||||||||||||||||
223 | - | |||||||||||||||||||||||||
224 | d->delegate = c; | - | ||||||||||||||||||||||||
225 | delegateChanged(); | - | ||||||||||||||||||||||||
226 | - | |||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | if (!d->ownModel
| 0-18 | ||||||||||||||||||||||||
229 | return; executed 18 times by 1 test: return; Executed by:
| 18 | ||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | if (QQmlDelegateModel *dModel = qobject_cast<QQmlDelegateModel*>(d->instanceModel)
| 0 | ||||||||||||||||||||||||
232 | dModel->setDelegate(c); never executed: dModel->setDelegate(c); | 0 | ||||||||||||||||||||||||
233 | if (d->componentComplete
| 0 | ||||||||||||||||||||||||
234 | d->regenerate(); never executed: d->regenerate(); | 0 | ||||||||||||||||||||||||
235 | - | |||||||||||||||||||||||||
236 | } never executed: end of block | 0 | ||||||||||||||||||||||||
237 | QVariant QQmlInstantiator::model() const | - | ||||||||||||||||||||||||
238 | { | - | ||||||||||||||||||||||||
239 | const QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
240 | return never executed: d->model;return d->model; never executed: return d->model; | 0 | ||||||||||||||||||||||||
241 | } | - | ||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||
243 | void QQmlInstantiator::setModel(const QVariant &v) | - | ||||||||||||||||||||||||
244 | { | - | ||||||||||||||||||||||||
245 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
246 | if (d->model == v
| 2-32 | ||||||||||||||||||||||||
247 | return; executed 2 times by 1 test: return; Executed by:
| 2 | ||||||||||||||||||||||||
248 | - | |||||||||||||||||||||||||
249 | d->model = v; | - | ||||||||||||||||||||||||
250 | - | |||||||||||||||||||||||||
251 | if (!d->componentComplete
| 14-18 | ||||||||||||||||||||||||
252 | return; executed 14 times by 1 test: return; Executed by:
| 14 | ||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||
254 | QQmlInstanceModel *prevModel = d->instanceModel; | - | ||||||||||||||||||||||||
255 | QObject *object = qvariant_cast<QObject*>(v); | - | ||||||||||||||||||||||||
256 | QQmlInstanceModel *vim = nullptr; | - | ||||||||||||||||||||||||
257 | if (object
| 0-16 | ||||||||||||||||||||||||
258 | - | |||||||||||||||||||||||||
259 | if (d->ownModel
| 0 | ||||||||||||||||||||||||
260 | delete d->instanceModel; | - | ||||||||||||||||||||||||
261 | prevModel = nullptr; | - | ||||||||||||||||||||||||
262 | d->ownModel = false; | - | ||||||||||||||||||||||||
263 | } never executed: end of block | 0 | ||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||
265 | d->instanceModel = vim; | - | ||||||||||||||||||||||||
266 | - | |||||||||||||||||||||||||
267 | } never executed: else if (v != QVariant(0)end of block
| 0-18 | ||||||||||||||||||||||||
268 | if (!d->ownModel
| 2-16 | ||||||||||||||||||||||||
269 | d->makeModel(); executed 16 times by 1 test: d->makeModel(); Executed by:
| 16 | ||||||||||||||||||||||||
270 | - | |||||||||||||||||||||||||
271 | if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel *>(d->instanceModel)
| 0-18 | ||||||||||||||||||||||||
272 | d->effectiveReset = true; | - | ||||||||||||||||||||||||
273 | dataModel->setModel(v); | - | ||||||||||||||||||||||||
274 | d->effectiveReset = false; | - | ||||||||||||||||||||||||
275 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||
277 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||
279 | if (d->instanceModel != prevModel
| 2-16 | ||||||||||||||||||||||||
280 | if (prevModel
| 0-16 | ||||||||||||||||||||||||
281 | disconnect(prevModel, qFlagLocation("2""modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "432"), | - | ||||||||||||||||||||||||
282 | this, qFlagLocation("1""_q_modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "433")); | - | ||||||||||||||||||||||||
283 | disconnect(prevModel, qFlagLocation("2""createdItem(int,QObject*)" "\0" __FILE__ ":" "434"), this, qFlagLocation("1""_q_createdItem(int,QObject*)" "\0" __FILE__ ":" "434")); | - | ||||||||||||||||||||||||
284 | - | |||||||||||||||||||||||||
285 | } never executed: end of block | 0 | ||||||||||||||||||||||||
286 | - | |||||||||||||||||||||||||
287 | if (d->instanceModel
| 0-16 | ||||||||||||||||||||||||
288 | connect(d->instanceModel, qFlagLocation("2""modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "439"), | - | ||||||||||||||||||||||||
289 | this, qFlagLocation("1""_q_modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "440")); | - | ||||||||||||||||||||||||
290 | connect(d->instanceModel, qFlagLocation("2""createdItem(int,QObject*)" "\0" __FILE__ ":" "441"), this, qFlagLocation("1""_q_createdItem(int,QObject*)" "\0" __FILE__ ":" "441")); | - | ||||||||||||||||||||||||
291 | - | |||||||||||||||||||||||||
292 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||||||||
293 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||||||||
294 | - | |||||||||||||||||||||||||
295 | d->regenerate(); | - | ||||||||||||||||||||||||
296 | modelChanged(); | - | ||||||||||||||||||||||||
297 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
298 | - | |||||||||||||||||||||||||
299 | - | |||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||
302 | - | |||||||||||||||||||||||||
303 | - | |||||||||||||||||||||||||
304 | - | |||||||||||||||||||||||||
305 | QObject *QQmlInstantiator::object() const | - | ||||||||||||||||||||||||
306 | { | - | ||||||||||||||||||||||||
307 | const QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
308 | if (d->objects.count()
| 0-4 | ||||||||||||||||||||||||
309 | return executed 4 times by 1 test: d->objects[0];return d->objects[0]; Executed by:
executed 4 times by 1 test: return d->objects[0]; Executed by:
| 4 | ||||||||||||||||||||||||
310 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||||||||
311 | } | - | ||||||||||||||||||||||||
312 | - | |||||||||||||||||||||||||
313 | - | |||||||||||||||||||||||||
314 | - | |||||||||||||||||||||||||
315 | - | |||||||||||||||||||||||||
316 | - | |||||||||||||||||||||||||
317 | - | |||||||||||||||||||||||||
318 | QObject *QQmlInstantiator::objectAt(int index) const | - | ||||||||||||||||||||||||
319 | { | - | ||||||||||||||||||||||||
320 | const QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
321 | if (index >= 0
| 0-78 | ||||||||||||||||||||||||
322 | return executed 78 times by 1 test: d->objects[index];return d->objects[index]; Executed by:
executed 78 times by 1 test: return d->objects[index]; Executed by:
| 78 | ||||||||||||||||||||||||
323 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||||||||
324 | } | - | ||||||||||||||||||||||||
325 | - | |||||||||||||||||||||||||
326 | - | |||||||||||||||||||||||||
327 | - | |||||||||||||||||||||||||
328 | - | |||||||||||||||||||||||||
329 | void QQmlInstantiator::classBegin() | - | ||||||||||||||||||||||||
330 | { | - | ||||||||||||||||||||||||
331 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
332 | d->componentComplete = false; | - | ||||||||||||||||||||||||
333 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||
337 | - | |||||||||||||||||||||||||
338 | void QQmlInstantiator::componentComplete() | - | ||||||||||||||||||||||||
339 | { | - | ||||||||||||||||||||||||
340 | QQmlInstantiatorPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
341 | d->componentComplete = true; | - | ||||||||||||||||||||||||
342 | - | |||||||||||||||||||||||||
343 | if (d->ownModel
| 0-18 | ||||||||||||||||||||||||
344 | static_cast<QQmlDelegateModel*>(d->instanceModel)->componentComplete(); | - | ||||||||||||||||||||||||
345 | d->regenerate(); | - | ||||||||||||||||||||||||
346 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
347 | - | |||||||||||||||||||||||||
348 | { | - | ||||||||||||||||||||||||
349 | QVariant realModel = d->model; | - | ||||||||||||||||||||||||
350 | d->model = QVariant(0); | - | ||||||||||||||||||||||||
351 | setModel(realModel); | - | ||||||||||||||||||||||||
352 | - | |||||||||||||||||||||||||
353 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
354 | } | - | ||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||
357 | - | |||||||||||||||||||||||||
Switch to Source code | Preprocessed file |