OpenCoverage

qqmlinstantiator.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmlinstantiator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QQmlInstantiatorPrivate::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:
  • tst_qqmlinstantiator
18
20-
21QQmlInstantiatorPrivate::~QQmlInstantiatorPrivate()-
22{-
23 qDeleteAll(objects);-
24}
never executed: end of block
0
25-
26void QQmlInstantiatorPrivate::clear()-
27{-
28 QQmlInstantiator * const q = q_func();-
29 if (!instanceModel
!instanceModelDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
0-20
30 return;
never executed: return;
0
31 if (!objects.count()
!objects.count()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
2-18
32 return;
executed 18 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
18
33-
34 for (int i=0; i < objects.count()
i < objects.count()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
; i++) {
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:
  • tst_qqmlinstantiator
20
38 objects.clear();-
39 q->objectChanged();-
40}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
2
41-
42QObject *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: return o;
Executed by:
  • tst_qqmlinstantiator
o;
executed 104 times by 1 test: return o;
Executed by:
  • tst_qqmlinstantiator
104
48}-
49-
50-
51void QQmlInstantiatorPrivate::regenerate()-
52{-
53 QQmlInstantiator * const q = q_func();-
54 if (!componentComplete
!componentCompleteDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
2-20
55 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
2
56-
57 int prevCount = q->count();-
58-
59 clear();-
60-
61 if (!active
!activeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
|| !instanceModel
!instanceModelDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
|| !instanceModel->count()
!instanceModel->count()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
|| !instanceModel->isValid()
!instanceModel->isValid()Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
0-18
62 if (prevCount
prevCountDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
0-4
63 q->countChanged();
never executed: q->countChanged();
0
64 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
4
65 }-
66-
67 for (int i = 0; i < instanceModel->count()
i < instanceModel->count()Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
; i++) {
16-96
68 QObject *object = modelObject(i, async);-
69-
70 if (object
objectDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
40-56
71 _q_createdItem(i, object);
executed 56 times by 1 test: _q_createdItem(i, object);
Executed by:
  • tst_qqmlinstantiator
56
72 }
executed 96 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
96
73 if (q->count() != prevCount
q->count() != prevCountDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
4-12
74 q->countChanged();
executed 12 times by 1 test: q->countChanged();
Executed by:
  • tst_qqmlinstantiator
12
75}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
16
76-
77void QQmlInstantiatorPrivate::_q_createdItem(int idx, QObject* item)-
78{-
79 QQmlInstantiator * const q = q_func();-
80 if (objects.contains(item)
objects.contains(item)Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 104 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
64-104
81 return;
executed 64 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
64
82 if (requestedIndex != idx
requestedIndex != idxDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
40-64
83 (
executed 40 times by 1 test: (void)instanceModel->object(idx);
Executed by:
  • tst_qqmlinstantiator
void)instanceModel->object(idx);
executed 40 times by 1 test: (void)instanceModel->object(idx);
Executed by:
  • tst_qqmlinstantiator
40
84 item->setParent(q);-
85 if (objects.size() < idx + 1
objects.size() < idx + 1Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
44-60
86 int modelCount = instanceModel->count();-
87 if (objects.capacity() < modelCount
objects.capaci...) < modelCountDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
14-46
88 objects.reserve(modelCount);
executed 14 times by 1 test: objects.reserve(modelCount);
Executed by:
  • tst_qqmlinstantiator
14
89 objects.resize(idx + 1);-
90 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
60
91 if (QObject *o = objects.at(idx)
QObject *o = objects.at(idx)Description
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
0-104
92 instanceModel->release(o);
never executed: instanceModel->release(o);
0
93 objects.replace(idx, item);-
94 if (objects.count() == 1
objects.count() == 1Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
14-90
95 q->objectChanged();
executed 14 times by 1 test: q->objectChanged();
Executed by:
  • tst_qqmlinstantiator
14
96 q->objectAdded(idx, item);-
97}
executed 104 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
104
98-
99void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bool reset)-
100{-
101 QQmlInstantiator * const q = q_func();-
102-
103 if (!componentComplete
!componentCompleteDescription
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
|| effectiveReset
effectiveResetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
0-14
104 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
4
105-
106 if (reset
resetDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
0-10
107 regenerate();-
108 if (changeSet.difference() != 0
changeSet.difference() != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
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()
remove.isMove()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
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: end of block
else while (count--
count--Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
0-2
125 QObject *obj = objects.at(index);-
126 objects.remove(index);-
127 q->objectRemoved(index, obj);-
128 if (obj
objDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-2
129 instanceModel->release(obj);
executed 2 times by 1 test: instanceModel->release(obj);
Executed by:
  • tst_qqmlinstantiator
2
130 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
2
131-
132 difference -= remove.count;-
133 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
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()
insert.isMove()Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
0-8
139 QVector<QPointer<QObject> > movedObjects = moved.value(insert.moveId);-
140 objects = objects.mid(0, index) + movedObjects + objects.mid(index);-
141 }
never executed: end of block
else {
0
142 if (insert.index <= objects.size()
insert.index <= objects.size()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
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:
  • tst_qqmlinstantiator
8
144 for (int i = 0; i < insert.count
i < insert.countDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
; ++i) {
8
145 int modelIndex = index + i;-
146 QObject* obj = modelObject(modelIndex, async);-
147 if (obj
objDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-8
148 _q_createdItem(modelIndex, obj);
executed 8 times by 1 test: _q_createdItem(modelIndex, obj);
Executed by:
  • tst_qqmlinstantiator
8
149 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
8
150 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
8
151 difference += insert.count;-
152 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
8
153-
154 if (difference != 0
difference != 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-10
155 q->countChanged();
executed 10 times by 1 test: q->countChanged();
Executed by:
  • tst_qqmlinstantiator
10
156}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
10
157-
158-
159void 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
componentCompleteDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-16
168 delegateModel->componentComplete();
executed 16 times by 1 test: delegateModel->componentComplete();
Executed by:
  • tst_qqmlinstantiator
16
169}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
16
170QQmlInstantiator::QQmlInstantiator(QObject *parent)-
171 : QObject(*(new QQmlInstantiatorPrivate), parent)-
172{-
173}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
18
174-
175QQmlInstantiator::~QQmlInstantiator()-
176{-
177}-
178bool QQmlInstantiator::isActive() const-
179{-
180 const QQmlInstantiatorPrivate * const d = d_func();-
181 return
executed 16 times by 1 test: return d->active;
Executed by:
  • tst_qqmlinstantiator
d->active;
executed 16 times by 1 test: return d->active;
Executed by:
  • tst_qqmlinstantiator
16
182}-
183-
184void QQmlInstantiator::setActive(bool newVal)-
185{-
186 QQmlInstantiatorPrivate * const d = d_func();-
187 if (newVal == d->active
newVal == d->activeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
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:
  • tst_qqmlinstantiator
4
193bool QQmlInstantiator::isAsync() const-
194{-
195 const QQmlInstantiatorPrivate * const d = d_func();-
196 return
never executed: return d->async;
d->async;
never executed: return d->async;
0
197}-
198-
199void QQmlInstantiator::setAsync(bool newVal)-
200{-
201 QQmlInstantiatorPrivate * const d = d_func();-
202 if (newVal == d->async
newVal == d->asyncDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
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:
  • tst_qqmlinstantiator
2
207int QQmlInstantiator::count() const-
208{-
209 const QQmlInstantiatorPrivate * const d = d_func();-
210 return
executed 56 times by 1 test: return d->objects.count();
Executed by:
  • tst_qqmlinstantiator
d->objects.count();
executed 56 times by 1 test: return d->objects.count();
Executed by:
  • tst_qqmlinstantiator
56
211}-
212QQmlComponent* QQmlInstantiator::delegate()-
213{-
214 QQmlInstantiatorPrivate * const d = d_func();-
215 return
executed 6 times by 1 test: return d->delegate;
Executed by:
  • tst_qqmlinstantiator
d->delegate;
executed 6 times by 1 test: return d->delegate;
Executed by:
  • tst_qqmlinstantiator
6
216}-
217-
218void QQmlInstantiator::setDelegate(QQmlComponent* c)-
219{-
220 QQmlInstantiatorPrivate * const d = d_func();-
221 if (c == d->delegate
c == d->delegateDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
0-18
222 return;
never executed: return;
0
223-
224 d->delegate = c;-
225 delegateChanged();-
226-
227-
228 if (!d->ownModel
!d->ownModelDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-18
229 return;
executed 18 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
18
230-
231 if (QQmlDelegateModel *dModel = qobject_cast<QQmlDelegateModel*>(d->instanceModel)
QQmlDelegateMo...instanceModel)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
232 dModel->setDelegate(c);
never executed: dModel->setDelegate(c);
0
233 if (d->componentComplete
d->componentCompleteDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
234 d->regenerate();
never executed: d->regenerate();
0
235-
236}
never executed: end of block
0
237QVariant QQmlInstantiator::model() const-
238{-
239 const QQmlInstantiatorPrivate * const d = d_func();-
240 return
never executed: return d->model;
d->model;
never executed: return d->model;
0
241}-
242-
243void QQmlInstantiator::setModel(const QVariant &v)-
244{-
245 QQmlInstantiatorPrivate * const d = d_func();-
246 if (d->model == v
d->model == vDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
2-32
247 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
2
248-
249 d->model = v;-
250-
251 if (!d->componentComplete
!d->componentCompleteDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
14-18
252 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_qqmlinstantiator
14
253-
254 QQmlInstanceModel *prevModel = d->instanceModel;-
255 QObject *object = qvariant_cast<QObject*>(v);-
256 QQmlInstanceModel *vim = nullptr;-
257 if (object
objectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
&& (
(vim = qobject...el *>(object))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
vim = qobject_cast<QQmlInstanceModel *>(object))
(vim = qobject...el *>(object))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
0-16
258-
259 if (d->ownModel
d->ownModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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: end of block
else if (v != QVariant(0)
v != QVariant(0)Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
){
0-18
268 if (!d->ownModel
!d->ownModelDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
)
2-16
269 d->makeModel();
executed 16 times by 1 test: d->makeModel();
Executed by:
  • tst_qqmlinstantiator
16
270-
271 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel *>(d->instanceModel)
QQmlDelegateMo...instanceModel)Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
) {
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:
  • tst_qqmlinstantiator
18
276-
277 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
18
278-
279 if (d->instanceModel != prevModel
d->instanceModel != prevModelDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
2-16
280 if (prevModel
prevModelDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
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
d->instanceModelDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
) {
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:
  • tst_qqmlinstantiator
16
293 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
16
294-
295 d->regenerate();-
296 modelChanged();-
297}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qqmlinstantiator
18
298-
299-
300-
301-
302-
303-
304-
305QObject *QQmlInstantiator::object() const-
306{-
307 const QQmlInstantiatorPrivate * const d = d_func();-
308 if (d->objects.count()
d->objects.count()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-4
309 return
executed 4 times by 1 test: return d->objects[0];
Executed by:
  • tst_qqmlinstantiator
d->objects[0];
executed 4 times by 1 test: return d->objects[0];
Executed by:
  • tst_qqmlinstantiator
4
310 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
311}-
312-
313-
314-
315-
316-
317-
318QObject *QQmlInstantiator::objectAt(int index) const-
319{-
320 const QQmlInstantiatorPrivate * const d = d_func();-
321 if (index >= 0
index >= 0Description
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
&& index < d->objects.count()
index < d->objects.count()Description
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
FALSEnever evaluated
)
0-78
322 return
executed 78 times by 1 test: return d->objects[index];
Executed by:
  • tst_qqmlinstantiator
d->objects[index];
executed 78 times by 1 test: return d->objects[index];
Executed by:
  • tst_qqmlinstantiator
78
323 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
324}-
325-
326-
327-
328-
329void 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:
  • tst_qqmlinstantiator
18
334-
335-
336-
337-
338void QQmlInstantiator::componentComplete()-
339{-
340 QQmlInstantiatorPrivate * const d = d_func();-
341 d->componentComplete = true;-
342-
343 if (d->ownModel
d->ownModelDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlinstantiator
) {
0-18
344 static_cast<QQmlDelegateModel*>(d->instanceModel)->componentComplete();-
345 d->regenerate();-
346 }
never executed: end of block
else
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:
  • tst_qqmlinstantiator
18
354}-
355-
356-
357-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0