OpenCoverage

qqmlchangeset.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/util/qqmlchangeset.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 QtQml 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 "qqmlchangeset_p.h"-
41-
42QT_BEGIN_NAMESPACE-
43-
44-
45/*!-
46 \class QQmlChangeSet-
47 \brief The QQmlChangeSet class stores an ordered list of notifications about-
48 changes to a linear data set.-
49 \internal-
50-
51 QQmlChangeSet can be used to record a series of notifications about items in an indexed list-
52 being inserted, removed, moved, and changed. Notifications in the set are re-ordered so that-
53 all notifications of a single type are grouped together and sorted in order of ascending index,-
54 with remove notifications preceding all others, followed by insert notification, and then-
55 change notifications.-
56-
57 Moves in a change set are represented by a remove notification paired with an insert-
58 notification by way of a shared unique moveId. Re-ordering may result in one or both of the-
59 paired notifications being divided, when this happens the offset member of the notification-
60 will indicate the relative offset of the divided notification from the beginning of the-
61 original.-
62*/-
63-
64/*!-
65 Constructs an empty change set.-
66*/-
67-
68QQmlChangeSet::QQmlChangeSet()-
69 : m_difference(0)-
70{-
71}
executed 26258 times by 29 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
26258
72-
73/*!-
74 Constructs a copy of a \a changeSet.-
75*/-
76-
77QQmlChangeSet::QQmlChangeSet(const QQmlChangeSet &changeSet)-
78 : m_removes(changeSet.m_removes)-
79 , m_inserts(changeSet.m_inserts)-
80 , m_changes(changeSet.m_changes)-
81 , m_difference(changeSet.m_difference)-
82{-
83}
executed 110 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qqmlobjectmodel
  • tst_qquickvisualdatamodel
110
84-
85/*!-
86 Destroys a change set.-
87*/-
88-
89QQmlChangeSet::~QQmlChangeSet()-
90{-
91}-
92-
93/*!-
94 Assigns the value of a \a changeSet to another.-
95*/-
96-
97QQmlChangeSet &QQmlChangeSet::operator =(const QQmlChangeSet &changeSet)-
98{-
99 m_removes = changeSet.m_removes;-
100 m_inserts = changeSet.m_inserts;-
101 m_changes = changeSet.m_changes;-
102 m_difference = changeSet.m_difference;-
103 return *this;
executed 28 times by 2 tests: return *this;
Executed by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
28
104}-
105-
106/*!-
107 Appends a notification that \a count items were inserted at \a index.-
108*/-
109-
110void QQmlChangeSet::insert(int index, int count)-
111{-
112 insert(QVector<Change>() << Change(index, count));-
113}
executed 810 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
810
114-
115/*!-
116 Appends a notification that \a count items were removed at \a index.-
117*/-
118-
119void QQmlChangeSet::remove(int index, int count)-
120{-
121 QVector<Change> removes;-
122 removes.append(Change(index, count));-
123 remove(&removes, nullptr);-
124}
executed 566 times by 7 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qqmlobjectmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
566
125-
126/*!-
127 Appends a notification that \a count items were moved \a from one index \a to another.-
128-
129 The \a moveId must be unique across the lifetime of the change set and any related-
130 change sets.-
131*/-
132-
133void QQmlChangeSet::move(int from, int to, int count, int moveId)-
134{-
135 QVector<Change> removes;-
136 removes.append(Change(from, count, moveId));-
137 QVector<Change> inserts;-
138 inserts.append(Change(to, count, moveId));-
139 remove(&removes, &inserts);-
140 insert(inserts);-
141}
executed 794 times by 5 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qqmlobjectmodel
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
794
142-
143/*!-
144 Appends a notification that \a count items were changed at \a index.-
145*/-
146-
147void QQmlChangeSet::change(int index, int count)-
148{-
149 QVector<Change> changes;-
150 changes.append(Change(index, count));-
151 change(changes);-
152}
executed 66 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
66
153-
154/*!-
155 Applies the changes in a \a changeSet to another.-
156*/-
157-
158void QQmlChangeSet::apply(const QQmlChangeSet &changeSet)-
159{-
160 QVector<Change> r = changeSet.m_removes;-
161 QVector<Change> i = changeSet.m_inserts;-
162 QVector<Change> c = changeSet.m_changes;-
163 remove(&r, &i);-
164 insert(i);-
165 change(c);-
166}
executed 16970 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
16970
167-
168/*!-
169 Applies a list of \a removes to a change set.-
170-
171 If a remove contains a moveId then any intersecting insert in the set will replace the-
172 corresponding intersection in the optional \a inserts list.-
173*/-
174-
175void QQmlChangeSet::remove(const QVector<Change> &removes, QVector<Change> *inserts)-
176{-
177 QVector<Change> r = removes;-
178 remove(&r, inserts);-
179}
executed 5944 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
5944
180-
181void QQmlChangeSet::remove(QVector<Change> *removes, QVector<Change> *inserts)-
182{-
183 int removeCount = 0;-
184 int insertCount = 0;-
185 QVector<Change>::iterator insert = m_inserts.begin();-
186 QVector<Change>::iterator change = m_changes.begin();-
187 QVector<Change>::iterator rit = removes->begin();-
188 for (; rit != removes->end(); ++rit) {
rit != removes->end()Description
TRUEevaluated 9708 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 32876 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
9708-32876
189 int index = rit->index + removeCount;-
190 int count = rit->count;-
191-
192 // Decrement the accumulated remove count from the indexes of any changes prior to the-
193 // current remove.-
194 for (; change != m_changes.end() && change->end() < rit->index; ++change)
change != m_changes.end()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 9700 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
change->end() < rit->indexDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
0-9700
195 change->index -= removeCount;
never executed: change->index -= removeCount;
0
196 // Remove any portion of a change notification that intersects the current remove.-
197 for (; change != m_changes.end() && change->index > rit->end(); ++change) {
change != m_changes.end()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 9702 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
change->index > rit->end()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
2-9702
198 change->count -= qMin(change->end(), rit->end()) - qMax(change->index, rit->index);-
199 if (change->count == 0) {
change->count == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
0-2
200 change = m_changes.erase(change);-
201 } else if (rit->index < change->index) {
never executed: end of block
rit->index < change->indexDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEnever evaluated
0-2
202 change->index = rit->index;-
203 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
2
204 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
2
205-
206 // Decrement the accumulated remove count from the indexes of any inserts prior to the-
207 // current remove.-
208 for (; insert != m_inserts.end() && insert->end() <= index; ++insert) {
insert != m_inserts.end()Description
TRUEevaluated 2344 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 8750 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
insert->end() <= indexDescription
TRUEevaluated 1386 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
FALSEevaluated 958 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
958-8750
209 insertCount += insert->count;-
210 insert->index -= removeCount;-
211 }
executed 1386 times by 2 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
1386
212-
213 rit->index -= insertCount;-
214-
215 // Remove any portion of a insert notification that intersects the current remove.-
216 while (insert != m_inserts.end() && insert->index < index + count) {
insert != m_inserts.end()Description
TRUEevaluated 1146 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 9026 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
insert->index < index + countDescription
TRUEevaluated 876 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 270 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
270-9026
217 int offset = index - insert->index;-
218 const int difference = qMin(insert->end(), index + count) - qMax(insert->index, index);-
219-
220 // If part of the remove or insert that precedes the intersection has a moveId create-
221 // a new delta for that portion and subtract the size of that delta from the current-
222 // one.-
223 if (offset < 0 && rit->moveId != -1) {
offset < 0Description
TRUEevaluated 256 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
FALSEevaluated 620 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
rit->moveId != -1Description
TRUEevaluated 138 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 118 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
118-620
224 rit = removes->insert(rit, Change(-
225 rit->index, -offset, rit->moveId, rit->offset));-
226 ++rit;-
227 rit->count -= -offset;-
228 rit->offset += -offset;-
229 index += -offset;-
230 count -= -offset;-
231 removeCount += -offset;-
232 offset = 0;-
233 } else if (offset > 0 && insert->moveId != -1) {
executed 138 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
offset > 0Description
TRUEevaluated 260 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 478 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
insert->moveId != -1Description
TRUEevaluated 138 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 122 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
122-478
234 insert = m_inserts.insert(insert, Change(-
235 insert->index - removeCount, offset, insert->moveId, insert->offset));-
236 ++insert;-
237 insert->index += offset;-
238 insert->count -= offset;-
239 insert->offset += offset;-
240 rit->index -= offset;-
241 insertCount += offset;-
242 }
executed 138 times by 4 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
138
243-
244 // If the current remove has a move id, find any inserts with the same move id and-
245 // replace the corresponding sections with the insert removed from the change set.-
246 if (rit->moveId != -1 && difference > 0 && inserts) {
rit->moveId != -1Description
TRUEevaluated 548 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 328 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
difference > 0Description
TRUEevaluated 548 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
insertsDescription
TRUEevaluated 548 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-548
247 for (QVector<Change>::iterator iit = inserts->begin(); iit != inserts->end(); ++iit) {
iit != inserts->end()Description
TRUEevaluated 1120 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 548 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
548-1120
248 if (iit->moveId != rit->moveId
iit->moveId != rit->moveIdDescription
TRUEevaluated 518 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 602 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
518-602
249 || rit->offset > iit->offset + iit->count
rit->offset > ...t + iit->countDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 560 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
42-560
250 || iit->offset > rit->offset + difference) {
iit->offset > ...t + differenceDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 554 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
6-554
251 continue;
executed 566 times by 4 tests: continue;
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
566
252 }-
253 // If the intersecting insert starts before the replacement one create-
254 // a new insert for the portion prior to the replacement insert.-
255 const int overlapOffset = rit->offset - iit->offset;-
256 if (overlapOffset > 0) {
overlapOffset > 0Description
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 414 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
140-414
257 iit = inserts->insert(iit, Change(-
258 iit->index, overlapOffset, iit->moveId, iit->offset));-
259 ++iit;-
260 iit->index += overlapOffset;-
261 iit->count -= overlapOffset;-
262 iit->offset += overlapOffset;-
263 }
executed 140 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
140
264 if (iit->offset >= rit->offset
iit->offset >= rit->offsetDescription
TRUEevaluated 554 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-554
265 && iit->offset + iit->count <= rit->offset + difference) {
iit->offset + ...t + differenceDescription
TRUEevaluated 350 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 204 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
204-350
266 // If the replacement insert completely encapsulates the existing-
267 // one just change the moveId.-
268 iit->moveId = insert->moveId;-
269 iit->offset = insert->offset + qMax(0, -overlapOffset);-
270 } else {
executed 350 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
350
271 // Create a new insertion before the intersecting one with the number of intersecting-
272 // items and remove that number from that insert.-
273 const int count-
274 = qMin(iit->offset + iit->count, rit->offset + difference)-
275 - qMax(iit->offset, rit->offset);-
276 iit = inserts->insert(iit, Change(-
277 iit->index,-
278 count,-
279 insert->moveId,-
280 insert->offset + qMax(0, -overlapOffset)));-
281 ++iit;-
282 iit->index += count;-
283 iit->count -= count;-
284 iit->offset += count;-
285 }
executed 204 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
204
286 }-
287 }
executed 548 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
548
288-
289 // Subtract the number of intersecting items from the current remove and insert.-
290 insert->count -= difference;-
291 insert->offset += difference;-
292 rit->count -= difference;-
293 rit->offset += difference;-
294-
295 index += difference;-
296 count -= difference;-
297 removeCount += difference;-
298-
299 if (insert->count == 0) {
insert->count == 0Description
TRUEevaluated 412 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 464 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
412-464
300 insert = m_inserts.erase(insert);-
301 } else if (rit->count == -offset || rit->count == 0) {
executed 412 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
rit->count == -offsetDescription
TRUEevaluated 268 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
FALSEevaluated 196 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
rit->count == 0Description
TRUEevaluated 144 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
FALSEevaluated 52 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
52-412
302 insert->index += difference;-
303 break;
executed 412 times by 3 tests: break;
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
412
304 } else {-
305 insert->index -= removeCount - difference;-
306 rit->index -= insert->count;-
307 insertCount += insert->count;-
308 ++insert;-
309 }
executed 52 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
52
310 }-
311 removeCount += rit->count;-
312 }
executed 9708 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
9708
313 for (; insert != m_inserts.end(); ++insert)
insert != m_inserts.end()Description
TRUEevaluated 5730 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 32876 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
5730-32876
314 insert->index -= removeCount;
executed 5730 times by 5 tests: insert->index -= removeCount;
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
5730
315-
316 removeCount = 0;-
317 QVector<Change>::iterator remove = m_removes.begin();-
318 for (rit = removes->begin(); rit != removes->end(); ++rit) {
rit != removes->end()Description
TRUEevaluated 9506 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 32876 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
9506-32876
319 if (rit->count == 0)
rit->count == 0Description
TRUEevaluated 620 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 8886 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
620-8886
320 continue;
executed 620 times by 7 tests: continue;
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
620
321 // Accumulate consecutive removes into a single delta before attempting to apply.-
322 for (QVector<Change>::iterator next = rit + 1; next != removes->end()
next != removes->end()Description
TRUEevaluated 816 times by 5 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 8410 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
816-8410
323 && next->index == rit->index
next->index == rit->indexDescription
TRUEevaluated 762 times by 5 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
54-762
324 && next->moveId == -1
next->moveId == -1Description
TRUEevaluated 416 times by 5 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 346 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
346-416
325 && rit->moveId == -1; ++next) {
rit->moveId == -1Description
TRUEevaluated 340 times by 5 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 76 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
76-340
326 next->count += rit->count;-
327 rit = next;-
328 }
executed 340 times by 5 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
340
329 int index = rit->index + removeCount;-
330 // Decrement the accumulated remove count from the indexes of any inserts prior to the-
331 // current remove.-
332 for (; remove != m_removes.end() && index > remove->index; ++remove)
remove != m_removes.end()Description
TRUEevaluated 1797 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 7614 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
index > remove->indexDescription
TRUEevaluated 525 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 1272 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
525-7614
333 remove->index -= removeCount;
executed 525 times by 4 tests: remove->index -= removeCount;
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
525
334 while (remove != m_removes.end() && index + rit->count >= remove->index) {
remove != m_removes.end()Description
TRUEevaluated 1483 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 8464 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
index + rit->c... remove->indexDescription
TRUEevaluated 1061 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 422 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
422-8464
335 int count = 0;-
336 const int offset = remove->index - index;-
337 QVector<Change>::iterator rend = remove;-
338 for (; rend != m_removes.end()
rend != m_removes.end()Description
TRUEevaluated 1141 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 654 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
654-1141
339 && rit->moveId == -1
rit->moveId == -1Description
TRUEevaluated 913 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 228 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
228-913
340 && rend->moveId == -1
rend->moveId == -1Description
TRUEevaluated 789 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 124 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
124-789
341 && index + rit->count >= rend->index; ++rend) {
index + rit->c...>= rend->indexDescription
TRUEevaluated 734 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 55 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
55-734
342 count += rend->count;-
343 }
executed 734 times by 4 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
734
344 if (remove != rend) {
remove != rendDescription
TRUEevaluated 715 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 346 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
346-715
345 // Accumulate all existing non-move removes that are encapsulated by or immediately-
346 // follow the current remove into it.-
347 int difference = 0;-
348 if (rend == m_removes.end()) {
rend == m_removes.end()Description
TRUEevaluated 654 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 61 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
61-654
349 difference = rit->count;-
350 } else if (rit->index + rit->count < rend->index - removeCount) {
executed 654 times by 4 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
rit->index + r... - removeCountDescription
TRUEevaluated 57 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
4-654
351 difference = rit->count;-
352 } else if (rend->moveId != -1) {
executed 57 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
rend->moveId != -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEnever evaluated
0-57
353 difference = rend->index - removeCount - rit->index;-
354 index += difference;-
355 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
4
356 count += difference;-
357-
358 rit->count -= difference;-
359 removeCount += difference;-
360 remove->index = rit->index;-
361 remove->count = count;-
362 remove = m_removes.erase(++remove, rend);-
363 } else {
executed 715 times by 4 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
715
364 // Insert a remove for the portion of the unmergable current remove prior to the-
365 // point of intersection.-
366 if (offset > 0) {
offset > 0Description
TRUEevaluated 206 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
FALSEevaluated 140 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
140-206
367 remove = m_removes.insert(remove, Change(-
368 rit->index, offset, rit->moveId, rit->offset));-
369 ++remove;-
370 rit->count -= offset;-
371 rit->offset += offset;-
372 removeCount += offset;-
373 index += offset;-
374 }
executed 206 times by 2 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
206
375 remove->index = rit->index;-
376-
377 ++remove;-
378 }
executed 346 times by 4 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
346
379 }-
380-
381 if (rit->count > 0) {
rit->count > 0Description
TRUEevaluated 8113 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 773 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
773-8113
382 remove = m_removes.insert(remove, *rit);-
383 ++remove;-
384 }
executed 8113 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
8113
385 removeCount += rit->count;-
386 }
executed 8886 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
8886
387 for (; remove != m_removes.end(); ++remove)
remove != m_removes.end()Description
TRUEevaluated 2931 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 32876 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
2931-32876
388 remove->index -= removeCount;
executed 2931 times by 4 tests: remove->index -= removeCount;
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
2931
389 m_difference -= removeCount;-
390}
executed 32876 times by 29 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
32876
391-
392/*!-
393 Applies a list of \a inserts to a change set.-
394*/-
395-
396void QQmlChangeSet::insert(const QVector<Change> &inserts)-
397{-
398 int insertCount = 0;-
399 QVector<Change>::iterator insert = m_inserts.begin();-
400 QVector<Change>::iterator change = m_changes.begin();-
401 for (QVector<Change>::const_iterator iit = inserts.begin(); iit != inserts.end(); ++iit) {
iit != inserts.end()Description
TRUEevaluated 29464 times by 28 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
FALSEevaluated 60200 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
29464-60200
402 if (iit->count == 0)
iit->count == 0Description
TRUEevaluated 1504 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquicktableview
FALSEevaluated 27960 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
1504-27960
403 continue;
executed 1504 times by 11 tests: continue;
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquicktableview
1504
404 int index = iit->index - insertCount;-
405-
406 Change current = *iit;-
407 // Accumulate consecutive inserts into a single delta before attempting to insert.-
408 for (QVector<Change>::const_iterator next = iit + 1; next != inserts.end()
next != inserts.end()Description
TRUEevaluated 724 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 27268 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
724-27268
409 && next->index == iit->index + iit->count
next->index ==...x + iit->countDescription
TRUEevaluated 620 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 104 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
104-620
410 && next->moveId == -1
next->moveId == -1Description
TRUEevaluated 172 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 448 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
172-448
411 && iit->moveId == -1; ++next) {
iit->moveId == -1Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
FALSEevaluated 140 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
32-140
412 current.count += next->count;-
413 iit = next;-
414 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickvisualdatamodel
32
415-
416 // Increment the index of any changes before the current insert by the accumlated insert-
417 // count.-
418 for (; change != m_changes.end() && change->index >= index; ++change)
change != m_changes.end()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 27958 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
change->index >= indexDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
2-27958
419 change->index += insertCount;
executed 12 times by 1 test: change->index += insertCount;
Executed by:
  • tst_qqmlhangeset
12
420 // If the current insert index is in the middle of a change split it in two at that-
421 // point and increment the index of the latter half.-
422 if (change != m_changes.end() && change->index < index + iit->count) {
change != m_changes.end()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 27958 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
change->index ...x + iit->countDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEnever evaluated
0-27958
423 int offset = index - change->index;-
424 change = m_changes.insert(change, Change(change->index + insertCount, offset));-
425 ++change;-
426 change->index += iit->count + offset;-
427 change->count -= offset;-
428 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
2
429-
430 // Increment the index of any inserts before the current insert by the accumlated insert-
431 // count.-
432 for (; insert != m_inserts.end() && index > insert->index + insert->count; ++insert)
insert != m_inserts.end()Description
TRUEevaluated 6384 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 22901 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
index > insert... insert->countDescription
TRUEevaluated 1325 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 5059 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1325-22901
433 insert->index += insertCount;
executed 1325 times by 4 tests: insert->index += insertCount;
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1325
434 if (insert == m_inserts.end()) {
insert == m_inserts.end()Description
TRUEevaluated 22901 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
FALSEevaluated 5059 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
5059-22901
435 insert = m_inserts.insert(insert, current);-
436 ++insert;-
437 } else {
executed 22901 times by 27 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
22901
438 const int offset = index - insert->index;-
439-
440 if (offset < 0) {
offset < 0Description
TRUEevaluated 425 times by 4 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4634 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
425-4634
441 // If the current insert is before an existing insert and not adjacent just insert-
442 // it into the list.-
443 insert = m_inserts.insert(insert, current);-
444 ++insert;-
445 } else if (iit->moveId == -1 && insert->moveId == -1) {
executed 425 times by 4 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
iit->moveId == -1Description
TRUEevaluated 4480 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
insert->moveId == -1Description
TRUEevaluated 4320 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 160 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
154-4480
446 // If neither the current nor existing insert has a moveId add the current insert-
447 // to the existing one.-
448 if (offset < insert->count) {
offset < insert->countDescription
TRUEevaluated 256 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 4064 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
256-4064
449 insert->index -= current.count;-
450 insert->count += current.count;-
451 } else {
executed 256 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
256
452 insert->index += insertCount;-
453 insert->count += current.count;-
454 ++insert;-
455 }
executed 4064 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4064
456 } else if (offset < insert->count) {
offset < insert->countDescription
TRUEevaluated 288 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 26 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
26-288
457 // If either insert has a moveId then split the existing insert and insert the-
458 // current one in the middle.-
459 if (offset > 0) {
offset > 0Description
TRUEevaluated 180 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 108 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
108-180
460 insert = m_inserts.insert(insert, Change(-
461 insert->index + insertCount, offset, insert->moveId, insert->offset));-
462 ++insert;-
463 insert->index += offset;-
464 insert->count -= offset;-
465 insert->offset += offset;-
466 }
executed 180 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
180
467 insert = m_inserts.insert(insert, current);-
468 ++insert;-
469 } else {
executed 288 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
288
470 insert->index += insertCount;-
471 ++insert;-
472 insert = m_inserts.insert(insert, current);-
473 ++insert;-
474 }
executed 26 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
26
475 }-
476 insertCount += current.count;-
477 }
executed 27960 times by 27 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
27960
478 for (; insert != m_inserts.end(); ++insert)
insert != m_inserts.end()Description
TRUEevaluated 1947 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 60200 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
1947-60200
479 insert->index += insertCount;
executed 1947 times by 5 tests: insert->index += insertCount;
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1947
480 m_difference += insertCount;-
481}
executed 60200 times by 29 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlhangeset
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlobjectmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • ...
60200
482-
483/*!-
484 Applies a combined list of \a removes and \a inserts to a change set. This is equivalent-
485 calling \l remove() followed by \l insert() with the same lists.-
486*/-
487-
488void QQmlChangeSet::move(const QVector<Change> &removes, const QVector<Change> &inserts)-
489{-
490 QVector<Change> r = removes;-
491 QVector<Change> i = inserts;-
492 remove(&r, &i);-
493 insert(i);-
494}
executed 8602 times by 27 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquicktableview
  • tst_qquickvisualdatamodel
  • ...
8602
495-
496/*!-
497 Applies a list of \a changes to a change set.-
498*/-
499-
500void QQmlChangeSet::change(const QVector<Change> &changes)-
501{-
502 QVector<Change> c = changes;-
503 change(&c);-
504}
executed 17888 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
17888
505-
506void QQmlChangeSet::change(QVector<Change> *changes)-
507{-
508 QVector<Change>::iterator insert = m_inserts.begin();-
509 QVector<Change>::iterator change = m_changes.begin();-
510 for (QVector<Change>::iterator cit = changes->begin(); cit != changes->end(); ++cit) {
cit != changes->end()Description
TRUEevaluated 916 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 17888 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
916-17888
511 for (; insert != m_inserts.end() && insert->end() < cit->index; ++insert) {}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
insert != m_inserts.end()Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 896 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
insert->end() < cit->indexDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
10-896
512 for (; insert != m_inserts.end() && insert->index < cit->end(); ++insert) {
insert != m_inserts.end()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 912 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
insert->index < cit->end()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
4-912
513 const int offset = insert->index - cit->index;-
514 const int count = cit->count + cit->index - insert->index - insert->count;-
515 if (offset == 0) {
offset == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
4-12
516 cit->index = insert->index + insert->count;-
517 cit->count = count;-
518 } else {
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
4
519 cit = changes->insert(++cit, Change(insert->index + insert->count, count));-
520 --cit;-
521 cit->count = offset;-
522 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
12
523 }-
524-
525 for (; change != m_changes.end() && change->index + change->count < cit->index; ++change) {}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
change != m_changes.end()Description
TRUEevaluated 220 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
FALSEevaluated 700 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
change->index ...t < cit->indexDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 216 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
4-700
526 if (change == m_changes.end() || change->index > cit->index + cit->count) {
change == m_changes.end()Description
TRUEevaluated 700 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 216 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
change->index ...x + cit->countDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 214 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
2-700
527 if (cit->count > 0) {
cit->count > 0Description
TRUEevaluated 684 times by 3 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
18-684
528 change = m_changes.insert(change, *cit);-
529 ++change;-
530 }
executed 684 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
684
531 } else {
executed 702 times by 3 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
702
532 if (cit->index < change->index) {
cit->index < change->indexDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
8-206
533 change->count += change->index - cit->index;-
534 change->index = cit->index;-
535 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
8
536-
537 if (cit->index + cit->count > change->index + change->count) {
cit->index + c... change->countDescription
TRUEevaluated 46 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
FALSEevaluated 168 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
46-168
538 change->count = cit->index + cit->count - change->index;-
539 QVector<Change>::iterator cbegin = change;-
540 QVector<Change>::iterator cend = ++cbegin;-
541 for (; cend != m_changes.end() && cend->index <= change->index + change->count; ++cend) {
cend != m_changes.end()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
cend->index <=... change->countDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEnever evaluated
0-46
542 if (cend->index + cend->count > change->index + change->count)
cend->index + ... change->countDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEnever evaluated
0-2
543 change->count = cend->index + cend->count - change->index;
executed 2 times by 1 test: change->count = cend->index + cend->count - change->index;
Executed by:
  • tst_qqmlhangeset
2
544 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
2
545 if (cbegin != cend) {
cbegin != cendDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlhangeset
FALSEevaluated 44 times by 2 tests
Evaluated by:
  • tst_qqmlhangeset
  • tst_qquicklistview
2-44
546 change = m_changes.erase(cbegin, cend);-
547 --change;-
548 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlhangeset
2
549 }
executed 46 times by 2 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquicklistview
46
550 }
executed 214 times by 2 tests: end of block
Executed by:
  • tst_qqmlhangeset
  • tst_qquicklistview
214
551 }-
552}
executed 17888 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlhangeset
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
17888
553-
554/*!-
555 Prints the contents of a change \a set to the \a debug stream.-
556*/-
557-
558QDebug operator <<(QDebug debug, const QQmlChangeSet &set)-
559{-
560 debug.nospace() << "QQmlChangeSet(";-
561 const QVector<QQmlChangeSet::Change> &removes = set.removes();-
562 for (const QQmlChangeSet::Change &remove : removes)-
563 debug << remove;
executed 6 times by 1 test: debug << remove;
Executed by:
  • tst_qqmlhangeset
6
564 const QVector<QQmlChangeSet::Change> &inserts = set.inserts();-
565 for (const QQmlChangeSet::Change &insert : inserts)-
566 debug << insert;
executed 6 times by 1 test: debug << insert;
Executed by:
  • tst_qqmlhangeset
6
567 const QVector<QQmlChangeSet::Change> &changes = set.changes();-
568 for (const QQmlChangeSet::Change &change : changes)-
569 debug << change;
executed 2 times by 1 test: debug << change;
Executed by:
  • tst_qqmlhangeset
2
570 return debug.nospace() << ')';
executed 4 times by 1 test: return debug.nospace() << ')';
Executed by:
  • tst_qqmlhangeset
4
571}-
572-
573/*!-
574 Prints a \a change to the \a debug stream.-
575*/-
576-
577QDebug operator <<(QDebug debug, const QQmlChangeSet::Change &change)-
578{-
579 return (debug.nospace() << "Change(" << change.index << ',' << change.count << ')').space();
executed 14 times by 1 test: return (debug.nospace() << "Change(" << change.index << ',' << change.count << ')').space();
Executed by:
  • tst_qqmlhangeset
14
580}-
581-
582QT_END_NAMESPACE-
583-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0