OpenCoverage

qquickrepeater.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickrepeater.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qquickrepeater_p.h"-
41#include "qquickrepeater_p_p.h"-
42-
43#include <private/qqmlglobal_p.h>-
44#include <private/qqmllistaccessor_p.h>-
45#include <private/qqmlchangeset_p.h>-
46#include <private/qqmldelegatemodel_p.h>-
47-
48#include <QtQml/QQmlInfo>-
49-
50QT_BEGIN_NAMESPACE-
51-
52QQuickRepeaterPrivate::QQuickRepeaterPrivate()-
53 : model(nullptr)-
54 , ownModel(false)-
55 , dataSourceIsObject(false)-
56 , delegateValidated(false)-
57 , itemCount(0)-
58{-
59 setTransparentForPositioner(true);-
60}
executed 1512 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1512
61-
62QQuickRepeaterPrivate::~QQuickRepeaterPrivate()-
63{-
64 if (ownModel)
ownModelDescription
TRUEevaluated 1486 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
8-1486
65 delete model;
executed 1486 times by 16 tests: delete model;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1486
66}
executed 1494 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1494
67-
68/*!-
69 \qmltype Repeater-
70 \instantiates QQuickRepeater-
71 \inqmlmodule QtQuick-
72 \ingroup qtquick-models-
73 \ingroup qtquick-positioning-
74 \inherits Item-
75 \brief Instantiates a number of Item-based components using a provided model.-
76-
77 The Repeater type is used to create a large number of-
78 similar items. Like other view types, a Repeater has a \l model and a \l delegate:-
79 for each entry in the model, the delegate is instantiated-
80 in a context seeded with data from the model. A Repeater item is usually-
81 enclosed in a positioner type such as \l Row or \l Column to visually-
82 position the multiple delegate items created by the Repeater.-
83-
84 The following Repeater creates three instances of a \l Rectangle item within-
85 a \l Row:-
86-
87 \snippet qml/repeaters/repeater.qml import-
88 \codeline-
89 \snippet qml/repeaters/repeater.qml simple-
90-
91 \image repeater-simple.png-
92-
93 A Repeater's \l model can be any of the supported \l {qml-data-models}{data models}.-
94 Additionally, like delegates for other views, a Repeater delegate can access-
95 its index within the repeater, as well as the model data relevant to the-
96 delegate. See the \l delegate property documentation for details.-
97-
98 Items instantiated by the Repeater are inserted, in order, as-
99 children of the Repeater's parent. The insertion starts immediately after-
100 the repeater's position in its parent stacking list. This allows-
101 a Repeater to be used inside a layout. For example, the following Repeater's-
102 items are stacked between a red rectangle and a blue rectangle:-
103-
104 \snippet qml/repeaters/repeater.qml layout-
105-
106 \image repeater.png-
107-
108-
109 \note A Repeater item owns all items it instantiates. Removing or dynamically destroying-
110 an item created by a Repeater results in unpredictable behavior.-
111-
112-
113 \section2 Considerations when using Repeater-
114-
115 The Repeater type creates all of its delegate items when the repeater is first-
116 created. This can be inefficient if there are a large number of delegate items and-
117 not all of the items are required to be visible at the same time. If this is the case,-
118 consider using other view types like ListView (which only creates delegate items-
119 when they are scrolled into view) or use the \l {Dynamic Object Creation} methods to-
120 create items as they are required.-
121-
122 Also, note that Repeater is \l {Item}-based, and can only repeat \l {Item}-derived objects.-
123 For example, it cannot be used to repeat QtObjects:-
124 \code-
125 //bad code-
126 Item {-
127 Can't repeat QtObject as it doesn't derive from Item.-
128 Repeater {-
129 model: 10-
130 QtObject {}-
131 }-
132 }-
133 \endcode-
134 */-
135-
136/*!-
137 \qmlsignal QtQuick::Repeater::itemAdded(int index, Item item)-
138-
139 This signal is emitted when an item is added to the repeater. The \a index-
140 parameter holds the index at which the item has been inserted within the-
141 repeater, and the \a item parameter holds the \l Item that has been added.-
142-
143 The corresponding handler is \c onItemAdded.-
144*/-
145-
146/*!-
147 \qmlsignal QtQuick::Repeater::itemRemoved(int index, Item item)-
148-
149 This signal is emitted when an item is removed from the repeater. The \a index-
150 parameter holds the index at which the item was removed from the repeater,-
151 and the \a item parameter holds the \l Item that was removed.-
152-
153 Do not keep a reference to \a item if it was created by this repeater, as-
154 in these cases it will be deleted shortly after the signal is handled.-
155-
156 The corresponding handler is \c onItemRemoved.-
157*/-
158QQuickRepeater::QQuickRepeater(QQuickItem *parent)-
159 : QQuickItem(*(new QQuickRepeaterPrivate), parent)-
160{-
161}
executed 1512 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1512
162-
163QQuickRepeater::~QQuickRepeater()-
164{-
165}-
166-
167/*!-
168 \qmlproperty any QtQuick::Repeater::model-
169-
170 The model providing data for the repeater.-
171-
172 This property can be set to any of the supported \l {qml-data-models}{data models}:-
173-
174 \list-
175 \li A number that indicates the number of delegates to be created by the repeater-
176 \li A model (e.g. a ListModel item, or a QAbstractItemModel subclass)-
177 \li A string list-
178 \li An object list-
179 \endlist-
180-
181 The type of model affects the properties that are exposed to the \l delegate.-
182-
183 \sa {qml-data-models}{Data Models}-
184*/-
185QVariant QQuickRepeater::model() const-
186{-
187 Q_D(const QQuickRepeater);-
188-
189 if (d->dataSourceIsObject) {
d->dataSourceIsObjectDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 424 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
10-424
190 QObject *o = d->dataSourceAsObject;-
191 return QVariant::fromValue(o);
executed 10 times by 1 test: return QVariant::fromValue(o);
Executed by:
  • tst_qquickrepeater
10
192 }-
193-
194 return d->dataSource;
executed 424 times by 2 tests: return d->dataSource;
Executed by:
  • tst_examples
  • tst_qquicklistview
424
195}-
196-
197void QQuickRepeater::setModel(const QVariant &m)-
198{-
199 Q_D(QQuickRepeater);-
200 QVariant model = m;-
201 if (model.userType() == qMetaTypeId<QJSValue>())
model.userType...Id<QJSValue>()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickrepeater
FALSEevaluated 1706 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8-1706
202 model = model.value<QJSValue>().toVariant();
executed 8 times by 2 tests: model = model.value<QJSValue>().toVariant();
Executed by:
  • tst_examples
  • tst_qquickrepeater
8
203-
204 if (d->dataSource == model)
d->dataSource == modelDescription
TRUEevaluated 964 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEevaluated 750 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
750-964
205 return;
executed 964 times by 2 tests: return;
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
964
206-
207 clear();-
208 if (d->model) {
d->modelDescription
TRUEevaluated 522 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 228 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
228-522
209 qmlobject_disconnect(d->model, QQmlInstanceModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
executed 20 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
executed 20 times by 10 tests: methodIdx = QQuickRepeater::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
never executed: methodIdx = QQuickRepeater::staticMetaObject.indexOfSignal(method+1);
signalIdx < 0Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 502 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
methodIdx < 0Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 502 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
code == 1Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-502
210 this, QQuickRepeater, SLOT(modelUpdated(QQmlChangeSet,bool)));-
211 qmlobject_disconnect(d->model, QQmlInstanceModel, SIGNAL(createdItem(int,QObject*)),
executed 20 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
executed 20 times by 10 tests: methodIdx = QQuickRepeater::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
never executed: methodIdx = QQuickRepeater::staticMetaObject.indexOfSignal(method+1);
signalIdx < 0Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 502 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
methodIdx < 0Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 502 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
code == 1Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-502
212 this, QQuickRepeater, SLOT(createdItem(int,QObject*)));-
213 qmlobject_disconnect(d->model, QQmlInstanceModel, SIGNAL(initItem(int,QObject*)),
executed 20 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
executed 20 times by 10 tests: methodIdx = QQuickRepeater::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
never executed: methodIdx = QQuickRepeater::staticMetaObject.indexOfSignal(method+1);
signalIdx < 0Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 502 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
methodIdx < 0Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 502 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
code == 1Description
TRUEevaluated 20 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-502
214 this, QQuickRepeater, SLOT(initItem(int,QObject*)));-
215 }
executed 522 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
522
216 d->dataSource = model;-
217 QObject *object = qvariant_cast<QObject*>(model);-
218 d->dataSourceAsObject = object;-
219 d->dataSourceIsObject = object != nullptr;-
220 QQmlInstanceModel *vim = nullptr;-
221 if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) {
objectDescription
TRUEevaluated 314 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 436 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
(vim = qobject...el *>(object))Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 302 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
12-436
222 if (d->ownModel) {
d->ownModelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickrepeater
2-10
223 delete d->model;-
224 d->ownModel = false;-
225 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
2
226 d->model = vim;-
227 } else {
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
12
228 if (!d->ownModel) {
!d->ownModelDescription
TRUEevaluated 222 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 516 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
222-516
229 d->model = new QQmlDelegateModel(qmlContext(this));-
230 d->ownModel = true;-
231 if (isComponentComplete())
isComponentComplete()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 214 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8-214
232 static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
executed 8 times by 1 test: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
Executed by:
  • tst_qquickrepeater
8
233 }
executed 222 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
222
234 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 738 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-738
235 dataModel->setModel(model);
executed 738 times by 16 tests: dataModel->setModel(model);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
738
236 }
executed 738 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
738
237 if (d->model) {
d->modelDescription
TRUEevaluated 750 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-750
238 qmlobject_connect(d->model, QQmlInstanceModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
executed 32 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
executed 32 times by 16 tests: methodIdx = QQuickRepeater::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
never executed: methodIdx = QQuickRepeater::staticMetaObject.indexOfSignal(method+1);
signalIdx < 0Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 718 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
methodIdx < 0Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 718 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
code == 1Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-718
239 this, QQuickRepeater, SLOT(modelUpdated(QQmlChangeSet,bool)));-
240 qmlobject_connect(d->model, QQmlInstanceModel, SIGNAL(createdItem(int,QObject*)),
executed 32 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
executed 32 times by 16 tests: methodIdx = QQuickRepeater::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
never executed: methodIdx = QQuickRepeater::staticMetaObject.indexOfSignal(method+1);
signalIdx < 0Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 718 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
methodIdx < 0Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 718 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
code == 1Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-718
241 this, QQuickRepeater, SLOT(createdItem(int,QObject*)));-
242 qmlobject_connect(d->model, QQmlInstanceModel, SIGNAL(initItem(int,QObject*)),
executed 32 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
executed 32 times by 16 tests: methodIdx = QQuickRepeater::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
never executed: methodIdx = QQuickRepeater::staticMetaObject.indexOfSignal(method+1);
signalIdx < 0Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 718 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
methodIdx < 0Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 718 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
code == 1Description
TRUEevaluated 32 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-718
243 this, QQuickRepeater, SLOT(initItem(int,QObject*)));-
244 regenerate();-
245 }
executed 750 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
750
246 emit modelChanged();-
247 emit countChanged();-
248}
executed 750 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
750
249-
250/*!-
251 \qmlproperty Component QtQuick::Repeater::delegate-
252 \default-
253-
254 The delegate provides a template defining each item instantiated by the repeater.-
255-
256 Delegates are exposed to a read-only \c index property that indicates the index-
257 of the delegate within the repeater. For example, the following \l Text delegate-
258 displays the index of each repeated item:-
259-
260 \table-
261 \row-
262 \li \snippet qml/repeaters/repeater.qml index-
263 \li \image repeater-index.png-
264 \endtable-
265-
266 If the \l model is a \l{QStringList-based model}{string list} or-
267 \l{QObjectList-based model}{object list}, the delegate is also exposed to-
268 a read-only \c modelData property that holds the string or object data. For-
269 example:-
270-
271 \table-
272 \row-
273 \li \snippet qml/repeaters/repeater.qml modeldata-
274 \li \image repeater-modeldata.png-
275 \endtable-
276-
277 If the \l model is a model object (such as a \l ListModel) the delegate-
278 can access all model roles as named properties, in the same way that delegates-
279 do for view classes like ListView.-
280-
281 \sa {QML Data Models}-
282 */-
283QQmlComponent *QQuickRepeater::delegate() const-
284{-
285 Q_D(const QQuickRepeater);-
286 if (d->model) {
d->modelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEnever evaluated
0-2
287 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEnever evaluated
0-2
288 return dataModel->delegate();
executed 2 times by 1 test: return dataModel->delegate();
Executed by:
  • tst_qquickrepeater
2
289 }
never executed: end of block
0
290-
291 return nullptr;
never executed: return nullptr;
0
292}-
293-
294void QQuickRepeater::setDelegate(QQmlComponent *delegate)-
295{-
296 Q_D(QQuickRepeater);-
297 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 220 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 1284 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
220-1284
298 if (delegate == dataModel->delegate())
delegate == da...el->delegate()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 218 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
2-218
299 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickrepeater
2
300-
301 if (!d->ownModel) {
!d->ownModelDescription
TRUEevaluated 1284 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
FALSEevaluated 218 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
218-1284
302 d->model = new QQmlDelegateModel(qmlContext(this));-
303 d->ownModel = true;-
304 }
executed 1284 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
1284
305-
306 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)) {
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 1502 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-1502
307 dataModel->setDelegate(delegate);-
308 regenerate();-
309 emit delegateChanged();-
310 d->delegateValidated = false;-
311 }
executed 1502 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1502
312}
executed 1502 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1502
313-
314/*!-
315 \qmlproperty int QtQuick::Repeater::count-
316-
317 This property holds the number of items in the model.-
318-
319 \note The number of items in the model as reported by count may differ from-
320 the number of created delegates if the Repeater is in the process of-
321 instantiating delegates or is incorrectly set up.-
322*/-
323int QQuickRepeater::count() const-
324{-
325 Q_D(const QQuickRepeater);-
326 if (d->model)
d->modelDescription
TRUEevaluated 742 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-742
327 return d->model->count();
executed 742 times by 16 tests: return d->model->count();
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
742
328 return 0;
never executed: return 0;
0
329}-
330-
331/*!-
332 \qmlmethod Item QtQuick::Repeater::itemAt(index)-
333-
334 Returns the \l Item that has been created at the given \a index, or \c null-
335 if no item exists at \a index.-
336*/-
337QQuickItem *QQuickRepeater::itemAt(int index) const-
338{-
339 Q_D(const QQuickRepeater);-
340 if (index >= 0 && index < d->deletables.count())
index >= 0Description
TRUEevaluated 454 times by 2 tests
Evaluated by:
  • tst_qquickdraghandler
  • tst_qquickrepeater
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickrepeater
index < d->deletables.count()Description
TRUEevaluated 444 times by 2 tests
Evaluated by:
  • tst_qquickdraghandler
  • tst_qquickrepeater
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickrepeater
4-454
341 return d->deletables[index];
executed 444 times by 2 tests: return d->deletables[index];
Executed by:
  • tst_qquickdraghandler
  • tst_qquickrepeater
444
342 return nullptr;
executed 14 times by 1 test: return nullptr;
Executed by:
  • tst_qquickrepeater
14
343}-
344-
345void QQuickRepeater::componentComplete()-
346{-
347 Q_D(QQuickRepeater);-
348 if (d->model && d->ownModel)
d->ownModelDescription
TRUEevaluated 1498 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
8-1498
349 static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
executed 1498 times by 16 tests: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1498
350 QQuickItem::componentComplete();-
351 regenerate();-
352 if (d->model && d->model->count())
d->model->count()Description
TRUEevaluated 308 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 1198 times by 4 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
308-1198
353 emit countChanged();
executed 308 times by 15 tests: countChanged();
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
308
354}
executed 1512 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1512
355-
356void QQuickRepeater::itemChange(ItemChange change, const ItemChangeData &value)-
357{-
358 QQuickItem::itemChange(change, value);-
359 if (change == ItemParentHasChanged) {
change == ItemParentHasChangedDescription
TRUEevaluated 2998 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 2918 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
2918-2998
360 regenerate();-
361 }
executed 2998 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
2998
362}
executed 5916 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
5916
363-
364void QQuickRepeater::clear()-
365{-
366 Q_D(QQuickRepeater);-
367 bool complete = isComponentComplete();-
368-
369 if (d->model) {
d->modelDescription
TRUEevaluated 3928 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 236 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
236-3928
370 // We remove in reverse order deliberately; so that signals are emitted-
371 // with sensible indices.-
372 for (int i = d->deletables.count() - 1; i >= 0; --i) {
i >= 0Description
TRUEevaluated 8984 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 3928 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
3928-8984
373 if (QQuickItem *item = d->deletables.at(i)) {
QQuickItem *it...letables.at(i)Description
TRUEevaluated 8984 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-8984
374 if (complete)
completeDescription
TRUEevaluated 8984 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-8984
375 emit itemRemoved(i, item);
executed 8984 times by 16 tests: itemRemoved(i, item);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8984
376 d->model->release(item);-
377 }
executed 8984 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8984
378 }
executed 8984 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8984
379 for (QQuickItem *item : qAsConst(d->deletables)) {-
380 if (item)
itemDescription
TRUEevaluated 8984 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-8984
381 item->setParentItem(nullptr);
executed 8984 times by 16 tests: item->setParentItem(nullptr);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8984
382 }
executed 8984 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8984
383 }
executed 3928 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
3928
384 d->deletables.clear();-
385 d->itemCount = 0;-
386}
executed 4164 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
4164
387-
388void QQuickRepeater::regenerate()-
389{-
390 Q_D(QQuickRepeater);-
391 if (!isComponentComplete())
!isComponentComplete()Description
TRUEevaluated 3358 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 3414 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
3358-3414
392 return;
executed 3358 times by 16 tests: return;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
3358
393-
394 clear();-
395-
396 if (!d->model || !d->model->count() || !d->model->isValid() || !parentItem() || !isComponentComplete())
!d->modelDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 3406 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
!d->model->count()Description
TRUEevaluated 2180 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
FALSEevaluated 1226 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
!d->model->isValid()Description
TRUEnever evaluated
FALSEevaluated 1226 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
!parentItem()Description
TRUEevaluated 632 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 594 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
!isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 594 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
0-3406
397 return;
executed 2820 times by 16 tests: return;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
2820
398-
399 d->itemCount = count();-
400 d->deletables.resize(d->itemCount);-
401 d->requestItems();-
402}
executed 594 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
594
403-
404void QQuickRepeaterPrivate::requestItems()-
405{-
406 for (int i = 0; i < itemCount; i++) {
i < itemCountDescription
TRUEevaluated 7052 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 594 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
594-7052
407 QObject *object = model->object(i, QQmlIncubator::AsynchronousIfNested);-
408 if (object)
objectDescription
TRUEevaluated 6992 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquickrepeater
60-6992
409 model->release(object);
executed 6992 times by 16 tests: model->release(object);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
6992
410 }
executed 7052 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
7052
411}
executed 594 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
594
412-
413void QQuickRepeater::createdItem(int index, QObject *)-
414{-
415 Q_D(QQuickRepeater);-
416 QObject *object = d->model->object(index, QQmlIncubator::AsynchronousIfNested);-
417 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);-
418 emit itemAdded(index, item);-
419}
executed 9258 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
9258
420-
421void QQuickRepeater::initItem(int index, QObject *object)-
422{-
423 Q_D(QQuickRepeater);-
424 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);-
425-
426 if (!d->deletables.at(index)) {
!d->deletables.at(index)Description
TRUEevaluated 9258 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEnever evaluated
0-9258
427 if (!item) {
!itemDescription
TRUEnever evaluated
FALSEevaluated 9258 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
0-9258
428 if (object) {
objectDescription
TRUEnever evaluated
FALSEnever evaluated
0
429 d->model->release(object);-
430 if (!d->delegateValidated) {
!d->delegateValidatedDescription
TRUEnever evaluated
FALSEnever evaluated
0
431 d->delegateValidated = true;-
432 QObject* delegate = this->delegate();-
433 qmlWarning(delegate ? delegate : this) << QQuickRepeater::tr("Delegate must be of Item type");-
434 }
never executed: end of block
0
435 }
never executed: end of block
0
436 return;
never executed: return;
0
437 }-
438 d->deletables[index] = item;-
439 item->setParentItem(parentItem());-
440 if (index > 0 && d->deletables.at(index-1)) {
index > 0Description
TRUEevaluated 8428 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 830 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
830-8428
441 item->stackAfter(d->deletables.at(index-1));-
442 } else {
executed 8382 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
8382
443 QQuickItem *after = this;-
444 for (int si = index+1; si < d->itemCount; ++si) {
si < d->itemCountDescription
TRUEevaluated 6556 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 730 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
730-6556
445 if (d->deletables.at(si)) {
d->deletables.at(si)Description
TRUEevaluated 146 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEevaluated 6410 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
146-6410
446 after = d->deletables.at(si);-
447 break;
executed 146 times by 2 tests: break;
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
146
448 }-
449 }
executed 6410 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
6410
450 item->stackBefore(after);-
451 }
executed 876 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
876
452 }-
453}
executed 9258 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickvisualdatamodel
  • tst_scenegraph
9258
454-
455void QQuickRepeater::modelUpdated(const QQmlChangeSet &changeSet, bool reset)-
456{-
457 Q_D(QQuickRepeater);-
458-
459 if (!isComponentComplete())
!isComponentComplete()Description
TRUEevaluated 692 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
FALSEevaluated 2238 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
692-2238
460 return;
executed 692 times by 15 tests: return;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
692
461-
462 if (reset) {
resetDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 2228 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
10-2228
463 regenerate();-
464 if (changeSet.difference() != 0)
changeSet.difference() != 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrepeater
2-8
465 emit countChanged();
executed 8 times by 1 test: countChanged();
Executed by:
  • tst_qquickrepeater
8
466 return;
executed 10 times by 1 test: return;
Executed by:
  • tst_qquickrepeater
10
467 }-
468-
469 int difference = 0;-
470 QHash<int, QVector<QPointer<QQuickItem> > > moved;-
471 for (const QQmlChangeSet::Change &remove : changeSet.removes()) {-
472 int index = qMin(remove.index, d->deletables.count());-
473 int count = qMin(remove.index + remove.count, d->deletables.count()) - index;-
474 if (remove.isMove()) {
remove.isMove()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 110 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
14-110
475 moved.insert(remove.moveId, d->deletables.mid(index, count));-
476 d->deletables.erase(-
477 d->deletables.begin() + index,-
478 d->deletables.begin() + index + count);-
479 } else while (count--) {
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
count--Description
TRUEevaluated 216 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEevaluated 110 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
14-216
480 QQuickItem *item = d->deletables.at(index);-
481 d->deletables.remove(index);-
482 emit itemRemoved(index, item);-
483 if (item) {
itemDescription
TRUEevaluated 216 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEnever evaluated
0-216
484 d->model->release(item);-
485 item->setParentItem(nullptr);-
486 }
executed 216 times by 2 tests: end of block
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
216
487 --d->itemCount;-
488 }
executed 216 times by 2 tests: end of block
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
216
489-
490 difference -= remove.count;-
491 }
executed 124 times by 2 tests: end of block
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
124
492-
493 for (const QQmlChangeSet::Change &insert : changeSet.inserts()) {-
494 int index = qMin(insert.index, d->deletables.count());-
495 if (insert.isMove()) {
insert.isMove()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 2102 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
14-2102
496 QVector<QPointer<QQuickItem> > items = moved.value(insert.moveId);-
497 d->deletables = d->deletables.mid(0, index) + items + d->deletables.mid(index);-
498 QQuickItem *stackBefore = index + items.count() < d->deletables.count()
index + items....tables.count()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrepeater
2-12
499 ? d->deletables.at(index + items.count())-
500 : this;-
501 if (stackBefore) {
stackBeforeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickrepeater
6-8
502 for (int i = index; i < index + items.count(); ++i) {
i < index + items.count()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
8-12
503 if (i < d->deletables.count()) {
i < d->deletables.count()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEnever evaluated
0-12
504 QPointer<QQuickItem> item = d->deletables.at(i);-
505 if (item)
itemDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickrepeater
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickrepeater
4-8
506 item->stackBefore(stackBefore);
executed 8 times by 1 test: item->stackBefore(stackBefore);
Executed by:
  • tst_qquickrepeater
8
507 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
12
508 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
12
509 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
8
510 } else for (int i = 0; i < insert.count; ++i) {
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquickrepeater
i < insert.countDescription
TRUEevaluated 2206 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEevaluated 2102 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
14-2206
511 int modelIndex = index + i;-
512 ++d->itemCount;-
513 d->deletables.insert(modelIndex, nullptr);-
514 QObject *object = d->model->object(modelIndex, QQmlIncubator::AsynchronousIfNested);-
515 if (object)
objectDescription
TRUEevaluated 2206 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEnever evaluated
0-2206
516 d->model->release(object);
executed 2206 times by 2 tests: d->model->release(object);
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
2206
517 }
executed 2206 times by 2 tests: end of block
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
2206
518 difference += insert.count;-
519 }
executed 2116 times by 2 tests: end of block
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
2116
520-
521 if (difference != 0)
difference != 0Description
TRUEevaluated 2208 times by 2 tests
Evaluated by:
  • tst_qquickpositioners
  • tst_qquickrepeater
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickrepeater
20-2208
522 emit countChanged();
executed 2208 times by 2 tests: countChanged();
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
2208
523}
executed 2228 times by 2 tests: end of block
Executed by:
  • tst_qquickpositioners
  • tst_qquickrepeater
2228
524-
525QT_END_NAMESPACE-
526-
527#include "moc_qquickrepeater_p.cpp"-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0