OpenCoverage

qqmlobjectmodel.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmlobjectmodel.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7QHash<QObject*, QQmlObjectModelAttached*> QQmlObjectModelAttached::attachedProperties;-
8-
9-
10class QQmlObjectModelPrivate : public QObjectPrivate-
11{-
12 inline QQmlObjectModel* q_func() { return static_cast<QQmlObjectModel *>(q_ptr); } inline const QQmlObjectModel* q_func() const { return static_cast<const QQmlObjectModel *>(q_ptr); } friend class QQmlObjectModel;-
13public:-
14 class Item {-
15 public:-
16 Item(QObject *i) : item(i), ref(0) {}
executed 154 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
154
17-
18 void addRef() { ++ref; }
executed 384 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
384
19 bool deref() { return
executed 258 times by 5 tests: return --ref == 0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
--ref == 0;
executed 258 times by 5 tests: return --ref == 0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
}
258
20-
21 QObject *item;-
22 int ref;-
23 };-
24-
25 QQmlObjectModelPrivate() : QObjectPrivate(), moveId(0) {}
executed 52 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qtqmlmodules
52
26-
27 static void children_append(QQmlListProperty<QObject> *prop, QObject *item) {-
28 int index = static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count();-
29 static_cast<QQmlObjectModelPrivate *>(prop->data)->insert(index, item);-
30 }
executed 138 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
138
31-
32 static int children_count(QQmlListProperty<QObject> *prop) {-
33 return
executed 26 times by 1 test: return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count();
Executed by:
  • tst_examples
static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count();
executed 26 times by 1 test: return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count();
Executed by:
  • tst_examples
26
34 }-
35-
36 static QObject *children_at(QQmlListProperty<QObject> *prop, int index) {-
37 return
executed 6 times by 1 test: return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.at(index).item;
Executed by:
  • tst_examples
static_cast<QQmlObjectModelPrivate *>(prop->data)->children.at(index).item;
executed 6 times by 1 test: return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.at(index).item;
Executed by:
  • tst_examples
6
38 }-
39-
40 static void children_clear(QQmlListProperty<QObject> *prop) {-
41 static_cast<QQmlObjectModelPrivate *>(prop->data)->clear();-
42 }
never executed: end of block
0
43-
44 void insert(int index, QObject *item) {-
45 QQmlObjectModel * const q = q_func();-
46 children.insert(index, Item(item));-
47 for (int i = index; i < children.count()
i < children.count()Description
TRUEevaluated 174 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 154 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
; ++i) {
154-174
48 QQmlObjectModelAttached *attached = QQmlObjectModelAttached::properties(children.at(i).item);-
49 attached->setIndex(i);-
50 }
executed 174 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
174
51 QQmlChangeSet changeSet;-
52 changeSet.insert(index, 1);-
53 q->modelUpdated(changeSet, false);-
54 q->countChanged();-
55 q->childrenChanged();-
56 }
executed 154 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
154
57-
58 void move(int from, int to, int n) {-
59 QQmlObjectModel * const q = q_func();-
60 if (from > to
from > toDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlobjectmodel
FALSEevaluated 8 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
) {
2-8
61-
62 int tfrom = from;-
63 int tto = to;-
64 from = tto;-
65 to = tto+n;-
66 n = tfrom-tto;-
67 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlobjectmodel
2
68-
69 QPODVector<QQmlObjectModelPrivate::Item, 4> store;-
70 for (int i = 0; i < to - from
i < to - fromDescription
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
; ++i)
10
71 store.append(children[from + n + i]);
executed 10 times by 4 tests: store.append(children[from + n + i]);
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
10
72 for (int i = 0; i < n
i < nDescription
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
; ++i)
10-18
73 store.append(children[from + i]);
executed 18 times by 4 tests: store.append(children[from + i]);
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
18
74-
75 for (int i = 0; i < store.count()
i < store.count()Description
TRUEevaluated 28 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
; ++i) {
10-28
76 children[from + i] = store[i];-
77 QQmlObjectModelAttached *attached = QQmlObjectModelAttached::properties(children.at(from + i).item);-
78 attached->setIndex(from + i);-
79 }
executed 28 times by 4 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
28
80-
81 QQmlChangeSet changeSet;-
82 changeSet.move(from, to, n, ++moveId);-
83 q->modelUpdated(changeSet, false);-
84 q->childrenChanged();-
85 }
executed 10 times by 4 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
10
86-
87 void remove(int index, int n) {-
88 QQmlObjectModel * const q = q_func();-
89 for (int i = index; i < index + n
i < index + nDescription
TRUEevaluated 28 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 14 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
; ++i) {
14-28
90 QQmlObjectModelAttached *attached = QQmlObjectModelAttached::properties(children.at(i).item);-
91 attached->setIndex(-1);-
92 }
executed 28 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
28
93 children.erase(children.begin() + index, children.begin() + index + n);-
94 for (int i = index; i < children.count()
i < children.count()Description
TRUEevaluated 10 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 14 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
; ++i) {
10-14
95 QQmlObjectModelAttached *attached = QQmlObjectModelAttached::properties(children.at(i).item);-
96 attached->setIndex(i);-
97 }
executed 10 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
10
98 QQmlChangeSet changeSet;-
99 changeSet.remove(index, n);-
100 q->modelUpdated(changeSet, false);-
101 q->countChanged();-
102 q->childrenChanged();-
103 }
executed 14 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
14
104-
105 void clear() {-
106 QQmlObjectModel * const q = q_func();-
107 for (const Item &child : qAsConst(children))-
108 q->destroyingItem(child.item);
executed 16 times by 3 tests: q->destroyingItem(child.item);
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
16
109 remove(0, children.count());-
110 }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
6
111-
112 int indexOf(QObject *item) const {-
113 for (int i = 0; i < children.count()
i < children.count()Description
TRUEevaluated 3518 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickrepeater
; ++i)
34-3518
114 if (children.at(i).item == item
children.at(i).item == itemDescription
TRUEevaluated 1754 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 1764 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
)
1754-1764
115 return
executed 1754 times by 5 tests: return i;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
i;
executed 1754 times by 5 tests: return i;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
1754
116 return
executed 34 times by 2 tests: return -1;
Executed by:
  • tst_qquicklistview
  • tst_qquickrepeater
-1;
executed 34 times by 2 tests: return -1;
Executed by:
  • tst_qquicklistview
  • tst_qquickrepeater
34
117 }-
118-
119 uint moveId;-
120 QList<Item> children;-
121};-
122QQmlObjectModel::QQmlObjectModel(QObject *parent)-
123 : QQmlInstanceModel(*(new QQmlObjectModelPrivate), parent)-
124{-
125}
executed 52 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qtqmlmodules
52
126QQmlListProperty<QObject> QQmlObjectModel::children()-
127{-
128 QQmlObjectModelPrivate * const d = d_func();-
129 return
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
QQmlListProperty<QObject>(this,
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
50
130 d,
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
50
131 d->children_append,
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
50
132 d->children_count,
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
50
133 d->children_at,
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
50
134 d->children_clear);
executed 50 times by 5 tests: return QQmlListProperty<QObject>(this, d, d->children_append, d->children_count, d->children_at, d->children_clear);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
50
135}-
136-
137-
138-
139-
140-
141-
142int QQmlObjectModel::count() const-
143{-
144 const QQmlObjectModelPrivate * const d = d_func();-
145 return
executed 4276 times by 6 tests: return d->children.count();
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
d->children.count();
executed 4276 times by 6 tests: return d->children.count();
Executed by:
  • tst_examples
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
4276
146}-
147-
148bool QQmlObjectModel::isValid() const-
149{-
150 return
executed 1588 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
true;
executed 1588 times by 5 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
1588
151}-
152-
153QObject *QQmlObjectModel::object(int index, QQmlIncubator::IncubationMode)-
154{-
155 QQmlObjectModelPrivate * const d = d_func();-
156 QQmlObjectModelPrivate::Item &item = d->children[index];-
157 item.addRef();-
158 if (item.ref == 1
item.ref == 1Description
TRUEevaluated 228 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 156 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
) {
156-228
159 initItem(index, item.item);-
160 createdItem(index, item.item);-
161 }
executed 228 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
228
162 return
executed 384 times by 5 tests: return item.item;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
item.item;
executed 384 times by 5 tests: return item.item;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
384
163}-
164-
165QQmlInstanceModel::ReleaseFlags QQmlObjectModel::release(QObject *item)-
166{-
167 QQmlObjectModelPrivate * const d = d_func();-
168 int idx = d->indexOf(item);-
169 if (idx >= 0
idx >= 0Description
TRUEevaluated 258 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickrepeater
) {
22-258
170 if (!d->children[idx].deref()
!d->children[idx].deref()Description
TRUEevaluated 128 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 130 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
)
128-130
171 return
executed 128 times by 5 tests: return QQmlInstanceModel::Referenced;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
QQmlInstanceModel::Referenced;
executed 128 times by 5 tests: return QQmlInstanceModel::Referenced;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
128
172 }
executed 130 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
130
173 return
executed 152 times by 5 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
nullptr;
executed 152 times by 5 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
152
174}-
175-
176QString QQmlObjectModel::stringValue(int index, const QString &name)-
177{-
178 QQmlObjectModelPrivate * const d = d_func();-
179 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| index >= d->children.count()
index >= d->children.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
180 return
never executed: return QString();
QString();
never executed: return QString();
0
181 return
never executed: return QQmlEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
QQmlEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
never executed: return QQmlEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
0
182}-
183-
184QQmlIncubator::Status QQmlObjectModel::incubationStatus(int)-
185{-
186 return
never executed: return QQmlIncubator::Ready;
QQmlIncubator::Ready;
never executed: return QQmlIncubator::Ready;
0
187}-
188-
189int QQmlObjectModel::indexOf(QObject *item, QObject *) const-
190{-
191 const QQmlObjectModelPrivate * const d = d_func();-
192 return
executed 1508 times by 4 tests: return d->indexOf(item);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
d->indexOf(item);
executed 1508 times by 4 tests: return d->indexOf(item);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
1508
193}-
194-
195QQmlObjectModelAttached *QQmlObjectModel::qmlAttachedProperties(QObject *obj)-
196{-
197 return
executed 52 times by 3 tests: return QQmlObjectModelAttached::properties(obj);
Executed by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
QQmlObjectModelAttached::properties(obj);
executed 52 times by 3 tests: return QQmlObjectModelAttached::properties(obj);
Executed by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
52
198}-
199QObject *QQmlObjectModel::get(int index) const-
200{-
201 const QQmlObjectModelPrivate * const d = d_func();-
202 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 114 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
|| index >= d->children.count()
index >= d->children.count()Description
TRUEnever evaluated
FALSEevaluated 114 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
)
0-114
203 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
204 return
executed 114 times by 3 tests: return d->children.at(index).item;
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
d->children.at(index).item;
executed 114 times by 3 tests: return d->children.at(index).item;
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
114
205}-
206void QQmlObjectModel::append(QObject *object)-
207{-
208 QQmlObjectModelPrivate * const d = d_func();-
209 d->insert(count(), object);-
210}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
8
211void QQmlObjectModel::insert(int index, QObject *object)-
212{-
213 QQmlObjectModelPrivate * const d = d_func();-
214 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
|| index > count()
index > count()Description
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
) {
0-8
215 qmlWarning(this) << tr("insert: index %1 out of range").arg(index);-
216 return;
never executed: return;
0
217 }-
218 d->insert(index, object);-
219}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
8
220void QQmlObjectModel::move(int from, int to, int n)-
221{-
222 QQmlObjectModelPrivate * const d = d_func();-
223 if (n <= 0
n <= 0Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
|| from == to
from == toDescription
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
)
0-10
224 return;
never executed: return;
0
225 if (from < 0
from < 0Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
|| to < 0
to < 0Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
|| from + n > count()
from + n > count()Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
|| to + n > count()
to + n > count()Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
) {
0-10
226 qmlWarning(this) << tr("move: out of range");-
227 return;
never executed: return;
0
228 }-
229 d->move(from, to, n);-
230}
executed 10 times by 4 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
10
231void QQmlObjectModel::remove(int index, int n)-
232{-
233 QQmlObjectModelPrivate * const d = d_func();-
234 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
|| n <= 0
n <= 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
|| index + n > count()
index + n > count()Description
TRUEnever evaluated
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
) {
0-8
235 qmlWarning(this) << tr("remove: indices [%1 - %2] out of range [0 - %3]").arg(index).arg(index+n).arg(count());-
236 return;
never executed: return;
0
237 }-
238 d->remove(index, n);-
239}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
8
240void QQmlObjectModel::clear()-
241{-
242 QQmlObjectModelPrivate * const d = d_func();-
243 d->clear();-
244}
executed 6 times by 3 tests: end of block
Executed by:
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickrepeater
6
245-
246-
247-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0