OpenCoverage

qquicklistview.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicklistview.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 "qquicklistview_p.h"-
41#include "qquickitemview_p_p.h"-
42-
43#include <private/qqmlobjectmodel_p.h>-
44#include <QtQml/qqmlexpression.h>-
45#include <QtQml/qqmlengine.h>-
46#include <QtQml/qqmlinfo.h>-
47#include <QtGui/qevent.h>-
48#include <QtCore/qcoreapplication.h>-
49#include <QtCore/qmath.h>-
50-
51#include <private/qquicksmoothedanimation_p_p.h>-
52#include "qplatformdefs.h"-
53-
54QT_BEGIN_NAMESPACE-
55-
56#ifndef QML_FLICK_SNAPONETHRESHOLD-
57#define QML_FLICK_SNAPONETHRESHOLD 30-
58#endif-
59-
60class FxListItemSG;-
61-
62class QQuickListViewPrivate : public QQuickItemViewPrivate-
63{-
64 Q_DECLARE_PUBLIC(QQuickListView)-
65public:-
66 static QQuickListViewPrivate* get(QQuickListView *item) { return item->d_func(); }
executed 46 times by 4 tests: return item->d_func();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
46
67-
68 Qt::Orientation layoutOrientation() const override;-
69 bool isContentFlowReversed() const override;-
70 bool isRightToLeft() const;-
71 bool isBottomToTop() const;-
72-
73 qreal positionAt(int index) const override;-
74 qreal endPositionAt(int index) const override;-
75 qreal originPosition() const override;-
76 qreal lastPosition() const override;-
77-
78 FxViewItem *itemBefore(int modelIndex) const;-
79 QString sectionAt(int modelIndex);-
80 qreal snapPosAt(qreal pos);-
81 FxViewItem *snapItemAt(qreal pos);-
82-
83 void init() override;-
84 void clear() override;-
85-
86 bool addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer) override;-
87 bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) override;-
88 void visibleItemsChanged() override;-
89-
90 void removeItem(FxViewItem *item);-
91-
92 FxViewItem *newViewItem(int index, QQuickItem *item) override;-
93 void initializeViewItem(FxViewItem *item) override;-
94 bool releaseItem(FxViewItem *item) override;-
95 void repositionItemAt(FxViewItem *item, int index, qreal sizeBuffer) override;-
96 void repositionPackageItemAt(QQuickItem *item, int index) override;-
97 void resetFirstItemPosition(qreal pos = 0.0) override;-
98 void adjustFirstItem(qreal forwards, qreal backwards, int) override;-
99 void updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult) override;-
100-
101 void createHighlight() override;-
102 void updateHighlight() override;-
103 void resetHighlightPosition() override;-
104 bool movingFromHighlight() override;-
105-
106 void setPosition(qreal pos) override;-
107 void layoutVisibleItems(int fromModelIndex = 0) override;-
108-
109 bool applyInsertionChange(const QQmlChangeSet::Change &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView) override;-
110 void translateAndTransitionItemsAfter(int afterIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult) override;-
111-
112 void updateSectionCriteria() override;-
113 void updateSections() override;-
114 QQuickItem *getSectionItem(const QString &section);-
115 void releaseSectionItem(QQuickItem *item);-
116 void releaseSectionItems();-
117 void updateInlineSection(FxListItemSG *);-
118 void updateCurrentSection();-
119 void updateStickySections();-
120-
121 qreal headerSize() const override;-
122 qreal footerSize() const override;-
123 bool showHeaderForIndex(int index) const override;-
124 bool showFooterForIndex(int index) const override;-
125 void updateHeader() override;-
126 void updateFooter() override;-
127 bool hasStickyHeader() const override;-
128 bool hasStickyFooter() const override;-
129-
130 void changedVisibleIndex(int newIndex) override;-
131 void initializeCurrentItem() override;-
132-
133 void updateAverage();-
134-
135 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override;-
136 void fixupPosition() override;-
137 void fixup(AxisData &data, qreal minExtent, qreal maxExtent) override;-
138 bool flick(QQuickItemViewPrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,-
139 QQuickTimeLineCallback::Callback fixupCallback, qreal velocity) override;-
140-
141 QQuickListView::Orientation orient;-
142 qreal visiblePos;-
143 qreal averageSize;-
144 qreal spacing;-
145 QQuickListView::SnapMode snapMode;-
146-
147 QQuickListView::HeaderPositioning headerPositioning;-
148 QQuickListView::FooterPositioning footerPositioning;-
149-
150 QSmoothedAnimation *highlightPosAnimator;-
151 QSmoothedAnimation *highlightWidthAnimator;-
152 QSmoothedAnimation *highlightHeightAnimator;-
153 qreal highlightMoveVelocity;-
154 qreal highlightResizeVelocity;-
155 int highlightResizeDuration;-
156-
157 QQuickViewSection *sectionCriteria;-
158 QString currentSection;-
159 static const int sectionCacheSize = 5;-
160 QQuickItem *sectionCache[sectionCacheSize];-
161 QQuickItem *currentSectionItem;-
162 QString currentStickySection;-
163 QQuickItem *nextSectionItem;-
164 QString nextStickySection;-
165 QString lastVisibleSection;-
166 QString nextSection;-
167-
168 qreal overshootDist;-
169 bool correctFlick : 1;-
170 bool inFlickCorrection : 1;-
171-
172 QQuickListViewPrivate()-
173 : orient(QQuickListView::Vertical)-
174 , visiblePos(0)-
175 , averageSize(100.0), spacing(0.0)-
176 , snapMode(QQuickListView::NoSnap)-
177 , headerPositioning(QQuickListView::InlineHeader)-
178 , footerPositioning(QQuickListView::InlineFooter)-
179 , highlightPosAnimator(nullptr), highlightWidthAnimator(nullptr), highlightHeightAnimator(nullptr)-
180 , highlightMoveVelocity(400), highlightResizeVelocity(400), highlightResizeDuration(-1)-
181 , sectionCriteria(nullptr), currentSectionItem(nullptr), nextSectionItem(nullptr)-
182 , overshootDist(0.0), correctFlick(false), inFlickCorrection(false)-
183 {-
184 highlightMoveDuration = -1; //override default value set in base class-
185 }
executed 1920 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1920
186 ~QQuickListViewPrivate() {-
187 delete highlightPosAnimator;-
188 delete highlightWidthAnimator;-
189 delete highlightHeightAnimator;-
190 }
executed 1912 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1912
191-
192 friend class QQuickViewSection;-
193};-
194-
195//-----------------------------------------------------------------------------
196-
197QQuickViewSection::QQuickViewSection(QQuickListView *parent)-
198 : QObject(parent), m_criteria(FullString), m_delegate(nullptr), m_labelPositioning(InlineLabels)-
199 , m_view(parent ? QQuickListViewPrivate::get(parent) : nullptr)-
200{-
201}
executed 46 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
46
202-
203void QQuickViewSection::setProperty(const QString &property)-
204{-
205 if (property != m_property) {
property != m_propertyDescription
TRUEevaluated 58 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-58
206 m_property = property;-
207 emit propertyChanged();-
208 // notify view that the contents of the sections must be recalculated-
209 m_view->updateSectionCriteria();-
210 }
executed 58 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
58
211}
executed 58 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
58
212-
213void QQuickViewSection::setCriteria(QQuickViewSection::SectionCriteria criteria)-
214{-
215 if (criteria != m_criteria) {
criteria != m_criteriaDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
2-8
216 m_criteria = criteria;-
217 emit criteriaChanged();-
218 // notify view that the contents of the sections must be recalculated-
219 m_view->updateSectionCriteria();-
220 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
221}
executed 10 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
10
222-
223void QQuickViewSection::setDelegate(QQmlComponent *delegate)-
224{-
225 if (delegate != m_delegate) {
delegate != m_delegateDescription
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-42
226 if (m_delegate)
m_delegateDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
2-40
227 m_view->releaseSectionItems();
executed 2 times by 1 test: m_view->releaseSectionItems();
Executed by:
  • tst_qquicklistview
2
228 m_delegate = delegate;-
229 emit delegateChanged();-
230 m_view->forceLayoutPolish();-
231 }
executed 42 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
42
232}
executed 42 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
42
233-
234QString QQuickViewSection::sectionString(const QString &value)-
235{-
236 if (m_criteria == FirstCharacter)
m_criteria == FirstCharacterDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 7392 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
12-7392
237 return value.isEmpty() ? QString() : value.at(0);
executed 12 times by 1 test: return value.isEmpty() ? QString() : value.at(0);
Executed by:
  • tst_qquicklistview
12
238 else-
239 return value;
executed 7392 times by 4 tests: return value;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
7392
240}-
241-
242void QQuickViewSection::setLabelPositioning(int l)-
243{-
244 if (m_labelPositioning != l) {
m_labelPositioning != lDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicklistview
8-14
245 m_labelPositioning = l;-
246 emit labelPositioningChanged();-
247 m_view->forceLayoutPolish();-
248 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
8
249}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
22
250-
251//-----------------------------------------------------------------------------
252-
253class FxListItemSG : public FxViewItem-
254{-
255public:-
256 FxListItemSG(QQuickItem *i, QQuickListView *v, bool own) : FxViewItem(i, v, own, static_cast<QQuickItemViewAttached*>(qmlAttachedPropertiesObject<QQuickListView>(i))), view(v)-
257 {-
258 }
executed 36217 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
36217
259-
260 inline QQuickItem *section() const {-
261 return item && attached ? static_cast<QQuickListViewAttached*>(attached)->m_sectionItem : nullptr;
executed 817572 times by 10 tests: return item && attached ? static_cast<QQuickListViewAttached*>(attached)->m_sectionItem : nullptr;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
817572
262 }-
263 void setSection(QQuickItem *s) {-
264 static_cast<QQuickListViewAttached*>(attached)->m_sectionItem = s;-
265 }
executed 226 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
226
266-
267 qreal position() const override {-
268 if (section()) {
section()Description
TRUEevaluated 9212 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 284354 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
9212-284354
269 if (view->orientation() == QQuickListView::Vertical)
view->orientat...View::VerticalDescription
TRUEevaluated 9212 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-9212
270 return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -section()->height()-section()->y() : section()->y());
executed 9212 times by 3 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -section()->height()-section()->y() : section()->y());
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
9212
271 else-
272 return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -section()->width()-section()->x() : section()->x());
never executed: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -section()->width()-section()->x() : section()->x());
0
273 } else {-
274 return itemPosition();
executed 284354 times by 10 tests: return itemPosition();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
284354
275 }-
276 }-
277 qreal itemPosition() const {-
278 if (view->orientation() == QQuickListView::Vertical)
view->orientat...View::VerticalDescription
TRUEevaluated 241869 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 58592 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
58592-241869
279 return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -itemHeight()-itemY() : itemY());
executed 241869 times by 10 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -itemHeight()-itemY() : itemY());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
241869
280 else-
281 return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -itemWidth()-itemX() : itemX());
executed 58592 times by 2 tests: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -itemWidth()-itemX() : itemX());
Executed by:
  • tst_examples
  • tst_qquicklistview
58592
282 }-
283 qreal size() const override {-
284 if (section())
section()Description
TRUEevaluated 5536 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 305361 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5536-305361
285 return (view->orientation() == QQuickListView::Vertical ? itemHeight()+section()->height() : itemWidth()+section()->width());
executed 5536 times by 3 tests: return (view->orientation() == QQuickListView::Vertical ? itemHeight()+section()->height() : itemWidth()+section()->width());
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
5536
286 else-
287 return (view->orientation() == QQuickListView::Vertical ? itemHeight() : itemWidth());
executed 305361 times by 10 tests: return (view->orientation() == QQuickListView::Vertical ? itemHeight() : itemWidth());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
305361
288 }-
289 qreal itemSize() const {-
290 return (view->orientation() == QQuickListView::Vertical ? itemHeight() : itemWidth());
executed 3458 times by 10 tests: return (view->orientation() == QQuickListView::Vertical ? itemHeight() : itemWidth());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3458
291 }-
292 qreal sectionSize() const override {-
293 if (section())
section()Description
TRUEevaluated 194 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 13500 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
194-13500
294 return (view->orientation() == QQuickListView::Vertical ? section()->height() : section()->width());
executed 194 times by 3 tests: return (view->orientation() == QQuickListView::Vertical ? section()->height() : section()->width());
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
194
295 return 0.0;
executed 13500 times by 9 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
13500
296 }-
297 qreal endPosition() const override {-
298 if (view->orientation() == QQuickListView::Vertical) {
view->orientat...View::VerticalDescription
TRUEevaluated 223019 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 48962 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
48962-223019
299 return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop
executed 223019 times by 10 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -itemY() : itemY() + itemHeight());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
223019
300 ? -itemY()
executed 223019 times by 10 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -itemY() : itemY() + itemHeight());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
223019
301 : itemY() + itemHeight());
executed 223019 times by 10 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -itemY() : itemY() + itemHeight());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
223019
302 } else {-
303 return (view->effectiveLayoutDirection() == Qt::RightToLeft
executed 48962 times by 2 tests: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -itemX() : itemX() + itemWidth());
Executed by:
  • tst_examples
  • tst_qquicklistview
48962
304 ? -itemX()
executed 48962 times by 2 tests: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -itemX() : itemX() + itemWidth());
Executed by:
  • tst_examples
  • tst_qquicklistview
48962
305 : itemX() + itemWidth());
executed 48962 times by 2 tests: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -itemX() : itemX() + itemWidth());
Executed by:
  • tst_examples
  • tst_qquicklistview
48962
306 }-
307 }-
308 void setPosition(qreal pos, bool immediate = false) {-
309 // position the section immediately even if there is a transition-
310 if (section()) {
section()Description
TRUEevaluated 2669 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 77366 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2669-77366
311 if (view->orientation() == QQuickListView::Vertical) {
view->orientat...View::VerticalDescription
TRUEevaluated 2669 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-2669
312 if (view->verticalLayoutDirection() == QQuickItemView::BottomToTop)
view->vertical...w::BottomToTopDescription
TRUEnever evaluated
FALSEevaluated 2669 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-2669
313 section()->setY(-section()->height()-pos);
never executed: section()->setY(-section()->height()-pos);
0
314 else-
315 section()->setY(pos);
executed 2669 times by 3 tests: section()->setY(pos);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
2669
316 } else {-
317 if (view->effectiveLayoutDirection() == Qt::RightToLeft)
view->effectiv...t::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
0
318 section()->setX(-section()->width()-pos);
never executed: section()->setX(-section()->width()-pos);
0
319 else-
320 section()->setX(pos);
never executed: section()->setX(pos);
0
321 }-
322 }-
323 moveTo(pointForPosition(pos), immediate);-
324 }
executed 80035 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
80035
325 void setSize(qreal size) {-
326 if (view->orientation() == QQuickListView::Vertical)
view->orientat...View::VerticalDescription
TRUEevaluated 1984 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 210 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
210-1984
327 item->setHeight(size);
executed 1984 times by 10 tests: item->setHeight(size);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1984
328 else-
329 item->setWidth(size);
executed 210 times by 2 tests: item->setWidth(size);
Executed by:
  • tst_examples
  • tst_qquicklistview
210
330 }-
331 bool contains(qreal x, qreal y) const override {-
332 return (x >= itemX() && x < itemX() + itemWidth() &&
executed 13428 times by 1 test: return (x >= itemX() && x < itemX() + itemWidth() && y >= itemY() && y < itemY() + itemHeight());
Executed by:
  • tst_qquicklistview
13428
333 y >= itemY() && y < itemY() + itemHeight());
executed 13428 times by 1 test: return (x >= itemX() && x < itemX() + itemWidth() && y >= itemY() && y < itemY() + itemHeight());
Executed by:
  • tst_qquicklistview
13428
334 }-
335-
336 QQuickListView *view;-
337-
338private:-
339 QPointF pointForPosition(qreal pos) const {-
340 if (view->orientation() == QQuickListView::Vertical) {
view->orientat...View::VerticalDescription
TRUEevaluated 74944 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 5091 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
5091-74944
341 if (view->verticalLayoutDirection() == QQuickItemView::BottomToTop) {
view->vertical...w::BottomToTopDescription
TRUEevaluated 9413 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 65531 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
9413-65531
342 if (section())
section()Description
TRUEnever evaluated
FALSEevaluated 9413 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-9413
343 pos += section()->height();
never executed: pos += section()->height();
0
344 return QPointF(itemX(), -itemHeight() - pos);
executed 9413 times by 1 test: return QPointF(itemX(), -itemHeight() - pos);
Executed by:
  • tst_qquicklistview
9413
345 } else {-
346 if (section())
section()Description
TRUEevaluated 2669 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 62862 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2669-62862
347 pos += section()->height();
executed 2669 times by 3 tests: pos += section()->height();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
2669
348 return QPointF(itemX(), pos);
executed 65531 times by 10 tests: return QPointF(itemX(), pos);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
65531
349 }-
350 } else {-
351 if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
view->effectiv...t::RightToLeftDescription
TRUEevaluated 1915 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
1915-3176
352 if (section())
section()Description
TRUEnever evaluated
FALSEevaluated 1915 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-1915
353 pos += section()->width();
never executed: pos += section()->width();
0
354 return QPointF(-itemWidth() - pos, itemY());
executed 1915 times by 1 test: return QPointF(-itemWidth() - pos, itemY());
Executed by:
  • tst_qquicklistview
1915
355 } else {-
356 if (section())
section()Description
TRUEnever evaluated
FALSEevaluated 3176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
0-3176
357 pos += section()->width();
never executed: pos += section()->width();
0
358 return QPointF(pos, itemY());
executed 3176 times by 2 tests: return QPointF(pos, itemY());
Executed by:
  • tst_examples
  • tst_qquicklistview
3176
359 }-
360 }-
361 }-
362};-
363-
364//-----------------------------------------------------------------------------
365-
366bool QQuickListViewPrivate::isContentFlowReversed() const-
367{-
368 return isRightToLeft() || isBottomToTop();
executed 231360 times by 11 tests: return isRightToLeft() || isBottomToTop();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
231360
369}-
370-
371Qt::Orientation QQuickListViewPrivate::layoutOrientation() const-
372{-
373 return static_cast<Qt::Orientation>(orient);
executed 559523 times by 11 tests: return static_cast<Qt::Orientation>(orient);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
559523
374}-
375-
376bool QQuickListViewPrivate::isRightToLeft() const-
377{-
378 Q_Q(const QQuickListView);-
379 return orient == QQuickListView::Horizontal && q->effectiveLayoutDirection() == Qt::RightToLeft;
executed 239349 times by 11 tests: return orient == QQuickListView::Horizontal && q->effectiveLayoutDirection() == Qt::RightToLeft;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
239349
380}-
381-
382bool QQuickListViewPrivate::isBottomToTop() const-
383{-
384 return orient == QQuickListView::Vertical && verticalLayoutDirection == QQuickItemView::BottomToTop;
executed 233222 times by 11 tests: return orient == QQuickListView::Vertical && verticalLayoutDirection == QQuickItemView::BottomToTop;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
233222
385}-
386-
387// Returns the item before modelIndex, if created.-
388// May return an item marked for removal.-
389FxViewItem *QQuickListViewPrivate::itemBefore(int modelIndex) const-
390{-
391 if (modelIndex < visibleIndex)
modelIndex < visibleIndexDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 460 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
46-460
392 return nullptr;
executed 46 times by 1 test: return nullptr;
Executed by:
  • tst_qquicklistview
46
393 int idx = 1;-
394 int lastIndex = -1;-
395 while (idx < visibleItems.count()) {
idx < visibleItems.count()Description
TRUEevaluated 3492 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 456 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
456-3492
396 FxViewItem *item = visibleItems.at(idx);-
397 if (item->index != -1)
item->index != -1Description
TRUEevaluated 3488 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-3488
398 lastIndex = item->index;
executed 3488 times by 3 tests: lastIndex = item->index;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
3488
399 if (item->index == modelIndex)
item->index == modelIndexDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3488 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4-3488
400 return visibleItems.at(idx-1);
executed 4 times by 1 test: return visibleItems.at(idx-1);
Executed by:
  • tst_qquicklistview
4
401 ++idx;-
402 }
executed 3488 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
3488
403 if (lastIndex == modelIndex-1)
lastIndex == modelIndex-1Description
TRUEevaluated 392 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 64 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
64-392
404 return visibleItems.constLast();
executed 392 times by 3 tests: return visibleItems.constLast();
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
392
405 return nullptr;
executed 64 times by 3 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
64
406}-
407-
408void QQuickListViewPrivate::setPosition(qreal pos)-
409{-
410 Q_Q(QQuickListView);-
411 if (orient == QQuickListView::Vertical) {
orient == QQui...View::VerticalDescription
TRUEevaluated 5030 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 533 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
533-5030
412 if (isBottomToTop())
isBottomToTop()Description
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4822 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
208-4822
413 q->QQuickFlickable::setContentY(-pos-size());
executed 208 times by 1 test: q->QQuickFlickable::setContentY(-pos-size());
Executed by:
  • tst_qquicklistview
208
414 else-
415 q->QQuickFlickable::setContentY(pos);
executed 4822 times by 11 tests: q->QQuickFlickable::setContentY(pos);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4822
416 } else {-
417 if (isRightToLeft())
isRightToLeft()Description
TRUEevaluated 130 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 403 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
130-403
418 q->QQuickFlickable::setContentX(-pos-size());
executed 130 times by 1 test: q->QQuickFlickable::setContentX(-pos-size());
Executed by:
  • tst_qquicklistview
130
419 else-
420 q->QQuickFlickable::setContentX(pos);
executed 403 times by 2 tests: q->QQuickFlickable::setContentX(pos);
Executed by:
  • tst_examples
  • tst_qquicklistview
403
421 }-
422}-
423-
424qreal QQuickListViewPrivate::originPosition() const-
425{-
426 qreal pos = 0;-
427 if (!visibleItems.isEmpty()) {
!visibleItems.isEmpty()Description
TRUEevaluated 25232 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 9076 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
9076-25232
428 pos = (*visibleItems.constBegin())->position();-
429 if (visibleIndex > 0)
visibleIndex > 0Description
TRUEevaluated 4445 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 20787 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4445-20787
430 pos -= visibleIndex * (averageSize + spacing);
executed 4445 times by 3 tests: pos -= visibleIndex * (averageSize + spacing);
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
4445
431 }
executed 25232 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
25232
432 return pos;
executed 34308 times by 11 tests: return pos;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
34308
433}-
434-
435qreal QQuickListViewPrivate::lastPosition() const-
436{-
437 qreal pos = 0;-
438 if (!visibleItems.isEmpty()) {
!visibleItems.isEmpty()Description
TRUEevaluated 23622 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 4366 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4366-23622
439 int invisibleCount = INT_MIN;-
440 int delayRemovedCount = 0;-
441 for (int i = visibleItems.count()-1; i >= 0; --i) {
i >= 0Description
TRUEevaluated 23803 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_qquicklistview
15-23803
442 FxViewItem *item = visibleItems.at(i);-
443 if (item->index != -1) {
item->index != -1Description
TRUEevaluated 23607 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 196 times by 1 test
Evaluated by:
  • tst_qquicklistview
196-23607
444 // Find the invisible count after the last visible item with known index-
445 invisibleCount = model->count() - (item->index + 1 + delayRemovedCount);-
446 break;
executed 23607 times by 10 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
23607
447 } else if (item->attached->delayRemove()) {
item->attached->delayRemove()Description
TRUEevaluated 196 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-196
448 ++delayRemovedCount;-
449 }
executed 196 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
196
450 }
executed 196 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
196
451 if (invisibleCount == INT_MIN) {
invisibleCount...x7fffffff - 1)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 23607 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
15-23607
452 // All visible items are in delayRemove state-
453 invisibleCount = model->count();-
454 }
executed 15 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
15
455 pos = (*(--visibleItems.constEnd()))->endPosition();-
456 if (invisibleCount > 0)
invisibleCount > 0Description
TRUEevaluated 15071 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 8551 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
8551-15071
457 pos += invisibleCount * (averageSize + spacing);
executed 15071 times by 6 tests: pos += invisibleCount * (averageSize + spacing);
Executed by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
15071
458 } else if (model && model->count()) {
executed 23622 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
model->count()Description
TRUEevaluated 4300 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquicklistview
66-23622
459 pos = (model->count() * averageSize + (model->count()-1) * spacing);-
460 }
executed 4300 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4300
461 return pos;
executed 27988 times by 10 tests: return pos;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
27988
462}-
463-
464qreal QQuickListViewPrivate::positionAt(int modelIndex) const-
465{-
466 if (FxViewItem *item = visibleItem(modelIndex)) {
FxViewItem *it...em(modelIndex)Description
TRUEevaluated 5319 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 11425 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5319-11425
467 return item->position();
executed 5319 times by 8 tests: return item->position();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5319
468 }-
469 if (!visibleItems.isEmpty()) {
!visibleItems.isEmpty()Description
TRUEevaluated 9187 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 2238 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2238-9187
470 if (modelIndex < visibleIndex) {
modelIndex < visibleIndexDescription
TRUEevaluated 1174 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 8013 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1174-8013
471 int count = visibleIndex - modelIndex;-
472 qreal cs = 0;-
473 if (modelIndex == currentIndex && currentItem) {
modelIndex == currentIndexDescription
TRUEevaluated 1154 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
currentItemDescription
TRUEevaluated 1154 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-1154
474 cs = currentItem->size() + spacing;-
475 --count;-
476 }
executed 1154 times by 3 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1154
477 return (*visibleItems.constBegin())->position() - count * (averageSize + spacing) - cs;
executed 1174 times by 3 tests: return (*visibleItems.constBegin())->position() - count * (averageSize + spacing) - cs;
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1174
478 } else {-
479 int count = modelIndex - findLastVisibleIndex(visibleIndex) - 1;-
480 return (*(--visibleItems.constEnd()))->endPosition() + spacing + count * (averageSize + spacing);
executed 8013 times by 6 tests: return (*(--visibleItems.constEnd()))->endPosition() + spacing + count * (averageSize + spacing);
Executed by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
8013
481 }-
482 }-
483 return 0;
executed 2238 times by 10 tests: return 0;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2238
484}-
485-
486qreal QQuickListViewPrivate::endPositionAt(int modelIndex) const-
487{-
488 if (FxViewItem *item = visibleItem(modelIndex))
FxViewItem *it...em(modelIndex)Description
TRUEevaluated 9775 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 7739 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
7739-9775
489 return item->endPosition();
executed 9775 times by 10 tests: return item->endPosition();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
9775
490 if (!visibleItems.isEmpty()) {
!visibleItems.isEmpty()Description
TRUEevaluated 1431 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 6308 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1431-6308
491 if (modelIndex < visibleIndex) {
modelIndex < visibleIndexDescription
TRUEevaluated 1403 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicklistview
28-1403
492 int count = visibleIndex - modelIndex;-
493 return (*visibleItems.constBegin())->position() - (count - 1) * (averageSize + spacing) - spacing;
executed 1403 times by 3 tests: return (*visibleItems.constBegin())->position() - (count - 1) * (averageSize + spacing) - spacing;
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1403
494 } else {-
495 int count = modelIndex - findLastVisibleIndex(visibleIndex) - 1;-
496 return (*(--visibleItems.constEnd()))->endPosition() + count * (averageSize + spacing);
executed 28 times by 1 test: return (*(--visibleItems.constEnd()))->endPosition() + count * (averageSize + spacing);
Executed by:
  • tst_qquicklistview
28
497 }-
498 }-
499 return 0;
executed 6308 times by 11 tests: return 0;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
6308
500}-
501-
502QString QQuickListViewPrivate::sectionAt(int modelIndex)-
503{-
504 if (FxViewItem *item = visibleItem(modelIndex))
FxViewItem *it...em(modelIndex)Description
TRUEevaluated 5898 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 660 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
660-5898
505 return item->attached->section();
executed 5898 times by 3 tests: return item->attached->section();
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
5898
506-
507 QString section;-
508 if (sectionCriteria && modelIndex >= 0 && modelIndex < itemCount) {
sectionCriteriaDescription
TRUEevaluated 660 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
modelIndex >= 0Description
TRUEevaluated 660 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
modelIndex < itemCountDescription
TRUEevaluated 610 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-660
509 QString propValue = model->stringValue(modelIndex, sectionCriteria->property());-
510 section = sectionCriteria->sectionString(propValue);-
511 }
executed 610 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
610
512-
513 return section;
executed 660 times by 4 tests: return section;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
660
514}-
515-
516qreal QQuickListViewPrivate::snapPosAt(qreal pos)-
517{-
518 if (FxViewItem *snapItem = snapItemAt(pos))
FxViewItem *sn...napItemAt(pos)Description
TRUEevaluated 1989 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qquicklistview
11-1989
519 return snapItem->position();
executed 1989 times by 1 test: return snapItem->position();
Executed by:
  • tst_qquicklistview
1989
520 if (visibleItems.count()) {
visibleItems.count()Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-11
521 qreal firstPos = (*visibleItems.constBegin())->position();-
522 qreal endPos = (*(--visibleItems.constEnd()))->position();-
523 if (pos < firstPos) {
pos < firstPosDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-11
524 return firstPos - qRound((firstPos - pos) / averageSize) * averageSize;
executed 11 times by 1 test: return firstPos - qRound((firstPos - pos) / averageSize) * averageSize;
Executed by:
  • tst_qquicklistview
11
525 } else if (pos > endPos)
pos > endPosDescription
TRUEnever evaluated
FALSEnever evaluated
0
526 return endPos + qRound((pos - endPos) / averageSize) * averageSize;
never executed: return endPos + qRound((pos - endPos) / averageSize) * averageSize;
0
527 }
never executed: end of block
0
528 return qRound((pos - originPosition()) / averageSize) * averageSize + originPosition();
never executed: return qRound((pos - originPosition()) / averageSize) * averageSize + originPosition();
0
529}-
530-
531FxViewItem *QQuickListViewPrivate::snapItemAt(qreal pos)-
532{-
533 FxViewItem *snapItem = nullptr;-
534 qreal prevItemSize = 0;-
535 for (FxViewItem *item : qAsConst(visibleItems)) {-
536 if (item->index == -1)
item->index == -1Description
TRUEnever evaluated
FALSEevaluated 38694 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
0-38694
537 continue;
never executed: continue;
0
538 qreal itemTop = item->position();-
539 if (highlight && itemTop >= pos && item->endPosition() <= pos + highlight->size())
highlightDescription
TRUEevaluated 38102 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 592 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
itemTop >= posDescription
TRUEevaluated 22051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 16051 times by 1 test
Evaluated by:
  • tst_qquicklistview
item->endPosit...hlight->size()Description
TRUEevaluated 2410 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 19641 times by 1 test
Evaluated by:
  • tst_qquicklistview
592-38102
540 return item;
executed 2410 times by 2 tests: return item;
Executed by:
  • tst_examples
  • tst_qquicklistview
2410
541-
542 // Middle of item and spacing (i.e. the middle of the distance between this item and the next-
543 qreal halfwayToNextItem = itemTop + (item->size()+spacing) / 2;-
544 qreal halfwayToPrevItem = itemTop - (prevItemSize+spacing) / 2;-
545 if (halfwayToNextItem >= pos && halfwayToPrevItem < pos)
halfwayToNextItem >= posDescription
TRUEevaluated 21909 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 14375 times by 1 test
Evaluated by:
  • tst_qquicklistview
halfwayToPrevItem < posDescription
TRUEevaluated 3286 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 18623 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
3286-21909
546 snapItem = item;
executed 3286 times by 1 test: snapItem = item;
Executed by:
  • tst_qquicklistview
3286
547-
548 prevItemSize = item->size();-
549 }
executed 36284 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
36284
550 return snapItem;
executed 4271 times by 2 tests: return snapItem;
Executed by:
  • tst_examples
  • tst_qquicklistview
4271
551}-
552-
553void QQuickListViewPrivate::changedVisibleIndex(int newIndex)-
554{-
555 visiblePos = positionAt(newIndex);-
556 visibleIndex = newIndex;-
557}
executed 118 times by 3 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
118
558-
559void QQuickListViewPrivate::init()-
560{-
561 QQuickItemViewPrivate::init();-
562 ::memset(sectionCache, 0, sizeof(QQuickItem*) * sectionCacheSize);-
563}
executed 1920 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1920
564-
565void QQuickListViewPrivate::clear()-
566{-
567 for (int i = 0; i < sectionCacheSize; ++i) {
i < sectionCacheSizeDescription
TRUEevaluated 21040 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 4208 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4208-21040
568 delete sectionCache[i];-
569 sectionCache[i] = nullptr;-
570 }
executed 21040 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
21040
571 visiblePos = 0;-
572 releaseSectionItem(currentSectionItem);-
573 currentSectionItem = nullptr;-
574 releaseSectionItem(nextSectionItem);-
575 nextSectionItem = nullptr;-
576 lastVisibleSection = QString();-
577 QQuickItemViewPrivate::clear();-
578}
executed 4208 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4208
579-
580FxViewItem *QQuickListViewPrivate::newViewItem(int modelIndex, QQuickItem *item)-
581{-
582 Q_Q(QQuickListView);-
583-
584 FxListItemSG *listItem = new FxListItemSG(item, q, false);-
585 listItem->index = modelIndex;-
586-
587 // initialise attached properties-
588 if (sectionCriteria) {
sectionCriteriaDescription
TRUEevaluated 620 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 33073 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
620-33073
589 QString propValue = model->stringValue(modelIndex, sectionCriteria->property());-
590 QString section = sectionCriteria->sectionString(propValue);-
591 QString prevSection;-
592 QString nextSection;-
593 if (modelIndex > 0) {
modelIndex > 0Description
TRUEevaluated 506 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 114 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
114-506
594 if (FxViewItem *item = itemBefore(modelIndex))
FxViewItem *it...re(modelIndex)Description
TRUEevaluated 396 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 110 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
110-396
595 prevSection = item->attached->section();
executed 396 times by 3 tests: prevSection = item->attached->section();
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
396
596 else-
597 prevSection = sectionAt(modelIndex-1);
executed 110 times by 3 tests: prevSection = sectionAt(modelIndex-1);
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
110
598 }-
599 if (modelIndex < model->count()-1) {
modelIndex < model->count()-1Description
TRUEevaluated 574 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 46 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
46-574
600 nextSection = sectionAt(modelIndex+1);-
601 }
executed 574 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
574
602 listItem->attached->setSections(prevSection, section, nextSection);-
603 }
executed 620 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
620
604-
605 return listItem;
executed 33693 times by 10 tests: return listItem;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
33693
606}-
607-
608void QQuickListViewPrivate::initializeViewItem(FxViewItem *item)-
609{-
610 QQuickItemViewPrivate::initializeViewItem(item);-
611-
612 // need to track current items that are animating-
613 item->trackGeometry(true);-
614-
615 if (sectionCriteria && sectionCriteria->delegate()) {
sectionCriteriaDescription
TRUEevaluated 620 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 33073 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
sectionCriteria->delegate()Description
TRUEevaluated 502 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 118 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
118-33073
616 if (QString::compare(item->attached->m_prevSection, item->attached->m_section, Qt::CaseInsensitive))
QString::compa...seInsensitive)Description
TRUEevaluated 206 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 296 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
206-296
617 updateInlineSection(static_cast<FxListItemSG*>(item));
executed 206 times by 3 tests: updateInlineSection(static_cast<FxListItemSG*>(item));
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
206
618 }
executed 502 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
502
619}
executed 33693 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
33693
620-
621bool QQuickListViewPrivate::releaseItem(FxViewItem *item)-
622{-
623 if (!item || !model)
!itemDescription
TRUEevaluated 4602 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 33683 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
!modelDescription
TRUEevaluated 2410 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 31273 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2410-33683
624 return true;
executed 7012 times by 11 tests: return true;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
7012
625-
626 QPointer<QQuickItem> it = item->item;-
627 QQuickListViewAttached *att = static_cast<QQuickListViewAttached*>(item->attached);-
628-
629 bool released = QQuickItemViewPrivate::releaseItem(item);-
630 if (released && it && att && att->m_sectionItem) {
releasedDescription
TRUEevaluated 29071 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 2202 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
attDescription
TRUEevaluated 29071 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-29071
631 // We hold no more references to this item-
632 int i = 0;-
633 do {-
634 if (!sectionCache[i]) {
!sectionCache[i]Description
TRUEevaluated 132 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 198 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
132-198
635 sectionCache[i] = att->m_sectionItem;-
636 sectionCache[i]->setVisible(false);-
637 att->m_sectionItem = nullptr;-
638 break;
executed 132 times by 3 tests: break;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
132
639 }-
640 ++i;-
641 } while (i < sectionCacheSize);
executed 198 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
i < sectionCacheSizeDescription
TRUEevaluated 188 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
10-198
642 delete att->m_sectionItem;-
643 att->m_sectionItem = nullptr;-
644 }
executed 142 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
142
645-
646 return released;
executed 31273 times by 9 tests: return released;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
31273
647}-
648-
649bool QQuickListViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer)-
650{-
651 qreal itemEnd = visiblePos;-
652 if (visibleItems.count()) {
visibleItems.count()Description
TRUEevaluated 30181 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 2190 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2190-30181
653 visiblePos = (*visibleItems.constBegin())->position();-
654 itemEnd = (*(--visibleItems.constEnd()))->endPosition() + spacing;-
655 }
executed 30181 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
30181
656-
657 int modelIndex = findLastVisibleIndex();-
658 bool haveValidItems = modelIndex >= 0;-
659 modelIndex = modelIndex < 0 ? visibleIndex : modelIndex + 1;
modelIndex < 0Description
TRUEevaluated 2190 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 30181 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2190-30181
660-
661 if (haveValidItems && (bufferFrom > itemEnd+averageSize+spacing
haveValidItemsDescription
TRUEevaluated 30181 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 2190 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
bufferFrom > i...geSize+spacingDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 30121 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
60-30181
662 || bufferTo < visiblePos - averageSize - spacing)) {
bufferTo < vis...Size - spacingDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 30105 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
16-30105
663 // We've jumped more than a page. Estimate which items are now-
664 // visible and fill from there.-
665 int count = (fillFrom - itemEnd) / (averageSize + spacing);-
666 int newModelIdx = qBound(0, modelIndex + count, model->count());-
667 count = newModelIdx - modelIndex;-
668 if (count) {
countDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquicklistview
34-42
669 releaseVisibleItems();-
670 modelIndex = newModelIdx;-
671 visibleIndex = modelIndex;-
672 visiblePos = itemEnd + count * (averageSize + spacing);-
673 itemEnd = visiblePos;-
674 }
executed 42 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
42
675 }
executed 76 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
76
676-
677 QQmlIncubator::IncubationMode incubationMode = doBuffer ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested;
doBufferDescription
TRUEevaluated 12752 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 19619 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
12752-19619
678-
679 bool changed = false;-
680 FxListItemSG *item = nullptr;-
681 qreal pos = itemEnd;-
682 while (modelIndex < model->count() && pos <= fillTo) {
modelIndex < model->count()Description
TRUEevaluated 37706 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 18691 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
pos <= fillToDescription
TRUEevaluated 25809 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 11897 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
11897-37706
683 if (!(item = static_cast<FxListItemSG*>(createItem(modelIndex, incubationMode))))
!(item = stati...ubationMode)))Description
TRUEevaluated 1783 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 24026 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1783-24026
684 break;
executed 1783 times by 3 tests: break;
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1783
685 qCDebug(lcItemViewDelegateLifecycle) << "refill: append item" << modelIndex << "pos" << pos << "buffer" << doBuffer << "item" << (QObject *)(item->item);
never executed: QMessageLogger(__FILE__, 685, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: append item" << modelIndex << "pos" << pos << "buffer" << doBuffer << "item" << (QObject *)(item->item);
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 24026 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
0-24026
686 if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
!transitionerDescription
TRUEevaluated 20118 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 3908 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickspringanimation
!transitioner-...nsition, true)Description
TRUEevaluated 3768 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 140 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickspringanimation
140-20118
687 item->setPosition(pos, true);
executed 23886 times by 9 tests: item->setPosition(pos, true);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
23886
688 if (item->item)
item->itemDescription
TRUEevaluated 24026 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-24026
689 QQuickItemPrivate::get(item->item)->setCulled(doBuffer);
executed 24026 times by 10 tests: QQuickItemPrivate::get(item->item)->setCulled(doBuffer);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
24026
690 pos += item->size() + spacing;-
691 visibleItems.append(item);-
692 ++modelIndex;-
693 changed = true;-
694 }
executed 24026 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
24026
695-
696 if (doBuffer && requestedIndex != -1) // already waiting for an item
doBufferDescription
TRUEevaluated 12752 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 19619 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
requestedIndex != -1Description
TRUEevaluated 1761 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 10991 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1761-19619
697 return changed;
executed 1761 times by 3 tests: return changed;
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1761
698-
699 while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos > fillFrom) {
visibleIndex > 0Description
TRUEevaluated 7111 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 25180 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
visibleIndex <= model->count()Description
TRUEevaluated 7111 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEnever evaluated
visiblePos > fillFromDescription
TRUEevaluated 1828 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 5283 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
0-25180
700 if (!(item = static_cast<FxListItemSG*>(createItem(visibleIndex-1, incubationMode))))
!(item = stati...ubationMode)))Description
TRUEevaluated 147 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1681 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
147-1681
701 break;
executed 147 times by 1 test: break;
Executed by:
  • tst_qquicklistview
147
702 qCDebug(lcItemViewDelegateLifecycle) << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos << "buffer" << doBuffer << "item" << (QObject *)(item->item);
never executed: QMessageLogger(__FILE__, 702, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos << "buffer" << doBuffer << "item" << (QObject *)(item->item);
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 1681 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1681
703 --visibleIndex;-
704 visiblePos -= item->size() + spacing;-
705 if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
!transitionerDescription
TRUEevaluated 1673 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
!transitioner-...nsition, true)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-1673
706 item->setPosition(visiblePos, true);
executed 1681 times by 2 tests: item->setPosition(visiblePos, true);
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1681
707 if (item->item)
item->itemDescription
TRUEevaluated 1681 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-1681
708 QQuickItemPrivate::get(item->item)->setCulled(doBuffer);
executed 1681 times by 2 tests: QQuickItemPrivate::get(item->item)->setCulled(doBuffer);
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1681
709 visibleItems.prepend(item);-
710 changed = true;-
711 }
executed 1681 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1681
712-
713 return changed;
executed 30610 times by 10 tests: return changed;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
30610
714}-
715-
716void QQuickListViewPrivate::removeItem(FxViewItem *item)-
717{-
718 if (item->transitionScheduledOrRunning()) {
item->transiti...ledOrRunning()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2578 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
14-2578
719 qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << (QObject *)(item->item);
never executed: QMessageLogger(__FILE__, 719, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "\tnot releasing animating item" << item->index << (QObject *)(item->item);
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-14
720 item->releaseAfterTransition = true;-
721 releasePendingTransition.append(item);-
722 } else {
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
14
723 qCDebug(lcItemViewDelegateLifecycle) << "\treleasing stationary item" << item->index << (QObject *)(item->item);
never executed: QMessageLogger(__FILE__, 723, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "\treleasing stationary item" << item->index << (QObject *)(item->item);
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 2578 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-2578
724 releaseItem(item);-
725 }
executed 2578 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
2578
726}-
727-
728bool QQuickListViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)-
729{-
730 FxViewItem *item = nullptr;-
731 bool changed = false;-
732-
733 // Remove items from the start of the view.-
734 // Zero-sized items shouldn't be removed unless a non-zero-sized item is also being-
735 // removed, otherwise a zero-sized item is infinitely added and removed over and-
736 // over by refill().-
737 int index = 0;-
738 while (visibleItems.count() > 1 && index < visibleItems.count()
visibleItems.count() > 1Description
TRUEevaluated 20597 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 322 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
index < visibleItems.count()Description
TRUEevaluated 20597 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-20597
739 && (item = visibleItems.at(index)) && item->endPosition() < bufferFrom) {
(item = visibl...ems.at(index))Description
TRUEevaluated 20597 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
item->endPosit...) < bufferFromDescription
TRUEevaluated 1300 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 19297 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
0-20597
740 if (item->attached->delayRemove())
item->attached->delayRemove()Description
TRUEnever evaluated
FALSEevaluated 1300 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1300
741 break;
never executed: break;
0
742-
743 if (item->size() > 0) {
item->size() > 0Description
TRUEevaluated 1292 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
8-1292
744 qCDebug(lcItemViewDelegateLifecycle) << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
never executed: QMessageLogger(__FILE__, 744, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 1292 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1292
745 // remove this item and all zero-sized items before it-
746 while (item) {
itemDescription
TRUEevaluated 1296 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-1296
747 if (item->index != -1)
item->index != -1Description
TRUEevaluated 1296 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-1296
748 visibleIndex++;
executed 1296 times by 2 tests: visibleIndex++;
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1296
749 visibleItems.removeAt(index);-
750 removeItem(item);-
751 if (index == 0)
index == 0Description
TRUEevaluated 1292 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-1292
752 break;
executed 1292 times by 2 tests: break;
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1292
753 item = visibleItems.at(--index);-
754 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
755 changed = true;-
756 } else {
executed 1292 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1292
757 index++;-
758 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
8
759 }-
760-
761 while (visibleItems.count() > 1 && (item = visibleItems.constLast()) && item->position() > bufferTo) {
visibleItems.count() > 1Description
TRUEevaluated 20492 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 324 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
(item = visibl...s.constLast())Description
TRUEevaluated 20492 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
item->position() > bufferToDescription
TRUEevaluated 1197 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 19295 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
0-20492
762 if (item->attached->delayRemove())
item->attached->delayRemove()Description
TRUEnever evaluated
FALSEevaluated 1197 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1197
763 break;
never executed: break;
0
764 qCDebug(lcItemViewDelegateLifecycle) << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position() << (QObject *)(item->item);
never executed: QMessageLogger(__FILE__, 764, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position() << (QObject *)(item->item);
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 1197 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1197
765 visibleItems.removeLast();-
766 removeItem(item);-
767 changed = true;-
768 }
executed 1197 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1197
769-
770 return changed;
executed 19619 times by 10 tests: return changed;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
19619
771}-
772-
773void QQuickListViewPrivate::visibleItemsChanged()-
774{-
775 if (visibleItems.count())
visibleItems.count()Description
TRUEevaluated 5566 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-5566
776 visiblePos = (*visibleItems.constBegin())->position();
executed 5566 times by 10 tests: visiblePos = (*visibleItems.constBegin())->position();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5566
777 updateAverage();-
778 if (currentIndex >= 0 && currentItem && !visibleItem(currentIndex)) {
currentIndex >= 0Description
TRUEevaluated 3918 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 1648 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
currentItemDescription
TRUEevaluated 3628 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 290 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
!visibleItem(currentIndex)Description
TRUEevaluated 901 times by 3 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 2727 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
290-3918
779 static_cast<FxListItemSG*>(currentItem)->setPosition(positionAt(currentIndex));-
780 updateHighlight();-
781 }
executed 901 times by 3 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
901
782 if (sectionCriteria)
sectionCriteriaDescription
TRUEevaluated 201 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 5365 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
201-5365
783 updateCurrentSection();
executed 201 times by 4 tests: updateCurrentSection();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
201
784 updateUnrequestedPositions();-
785}
executed 5566 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5566
786-
787void QQuickListViewPrivate::layoutVisibleItems(int fromModelIndex)-
788{-
789 if (!visibleItems.isEmpty()) {
!visibleItems.isEmpty()Description
TRUEevaluated 3341 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 124 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
124-3341
790 const qreal from = isContentFlowReversed() ? -position()-displayMarginBeginning-size() : position()-displayMarginBeginning;
isContentFlowReversed()Description
TRUEevaluated 370 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2971 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
370-2971
791 const qreal to = isContentFlowReversed() ? -position()+displayMarginEnd : position()+size()+displayMarginEnd;
isContentFlowReversed()Description
TRUEevaluated 370 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2971 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
370-2971
792-
793 FxViewItem *firstItem = *visibleItems.constBegin();-
794 bool fixedCurrent = currentItem && firstItem->item == currentItem->item;
currentItemDescription
TRUEevaluated 3318 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qquicklistview
firstItem->ite...rentItem->itemDescription
TRUEevaluated 2286 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 1032 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
23-3318
795 qreal sum = firstItem->size();-
796 qreal pos = firstItem->position() + firstItem->size() + spacing;-
797 firstItem->setVisible(firstItem->endPosition() >= from && firstItem->position() <= to);-
798-
799 for (int i=1; i < visibleItems.count(); ++i) {
i < visibleItems.count()Description
TRUEevaluated 39094 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 3341 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3341-39094
800 FxListItemSG *item = static_cast<FxListItemSG*>(visibleItems.at(i));-
801 if (item->index >= fromModelIndex) {
item->index >= fromModelIndexDescription
TRUEevaluated 36903 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 2191 times by 1 test
Evaluated by:
  • tst_qquicklistview
2191-36903
802 item->setPosition(pos);-
803 item->setVisible(item->endPosition() >= from && item->position() <= to);-
804 }
executed 36903 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
36903
805 pos += item->size() + spacing;-
806 sum += item->size();-
807 fixedCurrent = fixedCurrent || (currentItem && item->item == currentItem->item);
fixedCurrentDescription
TRUEevaluated 29997 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 9097 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
currentItemDescription
TRUEevaluated 8896 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 201 times by 1 test
Evaluated by:
  • tst_qquicklistview
item->item == ...rentItem->itemDescription
TRUEevaluated 647 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 8249 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
201-29997
808 }
executed 39094 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
39094
809 averageSize = qRound(sum / visibleItems.count());-
810-
811 // move current item if it is not a visible item.-
812 if (currentIndex >= 0 && currentItem && !fixedCurrent)
currentIndex >= 0Description
TRUEevaluated 3320 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_qquicklistview
currentItemDescription
TRUEevaluated 3318 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
!fixedCurrentDescription
TRUEevaluated 385 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickmousearea
FALSEevaluated 2933 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2-3320
813 static_cast<FxListItemSG*>(currentItem)->setPosition(positionAt(currentIndex));
executed 385 times by 2 tests: static_cast<FxListItemSG*>(currentItem)->setPosition(positionAt(currentIndex));
Executed by:
  • tst_qquicklistview
  • tst_qquickmousearea
385
814-
815 updateCurrentSection();-
816 updateStickySections();-
817 }
executed 3341 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3341
818}
executed 3465 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3465
819-
820void QQuickListViewPrivate::repositionItemAt(FxViewItem *item, int index, qreal sizeBuffer)-
821{-
822 static_cast<FxListItemSG *>(item)->setPosition(positionAt(index) + sizeBuffer);-
823}
executed 34 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
34
824-
825void QQuickListViewPrivate::repositionPackageItemAt(QQuickItem *item, int index)-
826{-
827 Q_Q(QQuickListView);-
828 qreal pos = position();-
829 if (orient == QQuickListView::Vertical) {
orient == QQui...View::VerticalDescription
TRUEevaluated 342 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-342
830 if (item->y() + item->height() > pos && item->y() < pos + q->height()) {
item->y() + it...height() > posDescription
TRUEevaluated 320 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicklistview
item->y() < pos + q->height()Description
TRUEevaluated 304 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
16-320
831 if (isBottomToTop())
isBottomToTop()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 300 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4-300
832 item->setY(-positionAt(index)-item->height());
executed 4 times by 1 test: item->setY(-positionAt(index)-item->height());
Executed by:
  • tst_qquicklistview
4
833 else-
834 item->setY(positionAt(index));
executed 300 times by 2 tests: item->setY(positionAt(index));
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
300
835 }-
836 } else {
executed 342 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
342
837 if (item->x() + item->width() > pos && item->x() < pos + q->width()) {
item->x() + it...>width() > posDescription
TRUEnever evaluated
FALSEnever evaluated
item->x() < pos + q->width()Description
TRUEnever evaluated
FALSEnever evaluated
0
838 if (isRightToLeft())
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0
839 item->setX(-positionAt(index)-item->width());
never executed: item->setX(-positionAt(index)-item->width());
0
840 else-
841 item->setX(positionAt(index));
never executed: item->setX(positionAt(index));
0
842 }-
843 }
never executed: end of block
0
844}-
845-
846void QQuickListViewPrivate::resetFirstItemPosition(qreal pos)-
847{-
848 FxListItemSG *item = static_cast<FxListItemSG*>(visibleItems.constFirst());-
849 item->setPosition(pos);-
850}
executed 817 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
817
851-
852void QQuickListViewPrivate::adjustFirstItem(qreal forwards, qreal backwards, int)-
853{-
854 if (!visibleItems.count())
!visibleItems.count()Description
TRUEnever evaluated
FALSEevaluated 1443 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1443
855 return;
never executed: return;
0
856 qreal diff = forwards - backwards;-
857 static_cast<FxListItemSG*>(visibleItems.constFirst())->setPosition(visibleItems.constFirst()->position() + diff);-
858}
executed 1443 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1443
859-
860void QQuickListViewPrivate::updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult)-
861{-
862 if (item != visibleItems.constFirst())
item != visibl...s.constFirst()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_qquicklistview
28-78
863 QQuickItemViewPrivate::updateSizeChangesBeforeVisiblePos(item, removeResult);
executed 28 times by 1 test: QQuickItemViewPrivate::updateSizeChangesBeforeVisiblePos(item, removeResult);
Executed by:
  • tst_qquicklistview
28
864}
executed 106 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
106
865-
866void QQuickListViewPrivate::createHighlight()-
867{-
868 Q_Q(QQuickListView);-
869 bool changed = false;-
870 if (highlight) {
highlightDescription
TRUEevaluated 2200 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 4924 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2200-4924
871 if (trackedItem == highlight)
trackedItem == highlightDescription
TRUEevaluated 2200 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-2200
872 trackedItem = nullptr;
executed 2200 times by 9 tests: trackedItem = nullptr;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2200
873 delete highlight;-
874 highlight = nullptr;-
875-
876 delete highlightPosAnimator;-
877 delete highlightWidthAnimator;-
878 delete highlightHeightAnimator;-
879 highlightPosAnimator = nullptr;-
880 highlightWidthAnimator = nullptr;-
881 highlightHeightAnimator = nullptr;-
882-
883 changed = true;-
884 }
executed 2200 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2200
885-
886 if (currentItem) {
currentItemDescription
TRUEevaluated 2212 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 4912 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2212-4912
887 QQuickItem *item = createHighlightItem();-
888 if (item) {
itemDescription
TRUEevaluated 2204 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
8-2204
889 FxListItemSG *newHighlight = new FxListItemSG(item, q, true);-
890 newHighlight->trackGeometry(true);-
891-
892 if (autoHighlight) {
autoHighlightDescription
TRUEevaluated 2194 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
10-2194
893 newHighlight->setSize(static_cast<FxListItemSG*>(currentItem)->itemSize());-
894 newHighlight->setPosition(static_cast<FxListItemSG*>(currentItem)->itemPosition());-
895 }
executed 2194 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2194
896 const QLatin1String posProp(orient == QQuickListView::Vertical ? "y" : "x");-
897 highlightPosAnimator = new QSmoothedAnimation;-
898 highlightPosAnimator->target = QQmlProperty(item, posProp);-
899 highlightPosAnimator->velocity = highlightMoveVelocity;-
900 highlightPosAnimator->userDuration = highlightMoveDuration;-
901-
902 highlightWidthAnimator = new QSmoothedAnimation;-
903 highlightWidthAnimator->velocity = highlightResizeVelocity;-
904 highlightWidthAnimator->userDuration = highlightResizeDuration;-
905 highlightWidthAnimator->target = QQmlProperty(item, QStringLiteral("width"));
executed 2204 times by 10 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2204
906-
907 highlightHeightAnimator = new QSmoothedAnimation;-
908 highlightHeightAnimator->velocity = highlightResizeVelocity;-
909 highlightHeightAnimator->userDuration = highlightResizeDuration;-
910 highlightHeightAnimator->target = QQmlProperty(item, QStringLiteral("height"));
executed 2204 times by 10 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2204
911-
912 highlight = newHighlight;-
913 changed = true;-
914 }
executed 2204 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2204
915 }
executed 2212 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2212
916 if (changed)
changedDescription
TRUEevaluated 4402 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 2722 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2722-4402
917 emit q->highlightItemChanged();
executed 4402 times by 10 tests: q->highlightItemChanged();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
4402
918}
executed 7124 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
7124
919-
920void QQuickListViewPrivate::updateHighlight()-
921{-
922 applyPendingChanges();-
923-
924 if ((!currentItem && highlight) || (currentItem && !highlight))
!currentItemDescription
TRUEevaluated 79 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 11043 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
highlightDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 27 times by 1 test
Evaluated by:
  • tst_qquicklistview
currentItemDescription
TRUEevaluated 11043 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 27 times by 1 test
Evaluated by:
  • tst_qquicklistview
!highlightDescription
TRUEevaluated 2202 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 8841 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
27-11043
925 createHighlight();
executed 2254 times by 10 tests: createHighlight();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2254
926 bool strictHighlight = haveHighlightRange && highlightRange == QQuickListView::StrictlyEnforceRange;
haveHighlightRangeDescription
TRUEevaluated 1360 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 9762 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
highlightRange...lyEnforceRangeDescription
TRUEevaluated 1342 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
18-9762
927 if (currentItem && autoHighlight && highlight && (!strictHighlight || !pressed)) {
currentItemDescription
TRUEevaluated 11043 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 79 times by 1 test
Evaluated by:
  • tst_qquicklistview
autoHighlightDescription
TRUEevaluated 11013 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
highlightDescription
TRUEevaluated 11009 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
!strictHighlightDescription
TRUEevaluated 9667 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 1342 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
!pressedDescription
TRUEevaluated 1246 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-11043
928 // auto-update highlight-
929 FxListItemSG *listItem = static_cast<FxListItemSG*>(currentItem);-
930 highlightPosAnimator->to = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 1124 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 9789 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1124-9789
931 ? -listItem->itemPosition()-listItem->itemSize()-
932 : listItem->itemPosition();-
933 highlightWidthAnimator->to = listItem->item->width();-
934 highlightHeightAnimator->to = listItem->item->height();-
935 if (orient == QQuickListView::Vertical) {
orient == QQui...View::VerticalDescription
TRUEevaluated 9936 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 977 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
977-9936
936 if (highlight->item->width() == 0)
highlight->item->width() == 0Description
TRUEevaluated 1935 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 8001 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1935-8001
937 highlight->item->setWidth(currentItem->item->width());
executed 1935 times by 10 tests: highlight->item->setWidth(currentItem->item->width());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1935
938 } else {
executed 9936 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
9936
939 if (highlight->item->height() == 0)
highlight->item->height() == 0Description
TRUEevaluated 178 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 799 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
178-799
940 highlight->item->setHeight(currentItem->item->height());
executed 178 times by 2 tests: highlight->item->setHeight(currentItem->item->height());
Executed by:
  • tst_examples
  • tst_qquicklistview
178
941 }
executed 977 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
977
942-
943 highlightPosAnimator->restart();-
944 highlightWidthAnimator->restart();-
945 highlightHeightAnimator->restart();-
946 }
executed 10913 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
10913
947 updateTrackedItem();-
948}
executed 11122 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
11122
949-
950void QQuickListViewPrivate::resetHighlightPosition()-
951{-
952 if (highlight && currentItem)
highlightDescription
TRUEevaluated 1930 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
currentItemDescription
TRUEevaluated 1930 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-1930
953 static_cast<FxListItemSG*>(highlight)->setPosition(static_cast<FxListItemSG*>(currentItem)->itemPosition());
executed 1930 times by 10 tests: static_cast<FxListItemSG*>(highlight)->setPosition(static_cast<FxListItemSG*>(currentItem)->itemPosition());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1930
954}
executed 1930 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1930
955-
956bool QQuickListViewPrivate::movingFromHighlight()-
957{-
958 if (!haveHighlightRange || highlightRange != QQuickListView::StrictlyEnforceRange)
!haveHighlightRangeDescription
TRUEevaluated 2893 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 128 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
highlightRange...lyEnforceRangeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 126 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
2-2893
959 return false;
executed 2895 times by 7 tests: return false;
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2895
960-
961 return (highlightPosAnimator && highlightPosAnimator->isRunning()) ||
executed 126 times by 2 tests: return (highlightPosAnimator && highlightPosAnimator->isRunning()) || (highlightHeightAnimator && highlightHeightAnimator->isRunning()) || (highlightWidthAnimator && highlightWidthAnimator->isRunning());
Executed by:
  • tst_examples
  • tst_qquicklistview
126
962 (highlightHeightAnimator && highlightHeightAnimator->isRunning()) ||
executed 126 times by 2 tests: return (highlightPosAnimator && highlightPosAnimator->isRunning()) || (highlightHeightAnimator && highlightHeightAnimator->isRunning()) || (highlightWidthAnimator && highlightWidthAnimator->isRunning());
Executed by:
  • tst_examples
  • tst_qquicklistview
126
963 (highlightWidthAnimator && highlightWidthAnimator->isRunning());
executed 126 times by 2 tests: return (highlightPosAnimator && highlightPosAnimator->isRunning()) || (highlightHeightAnimator && highlightHeightAnimator->isRunning()) || (highlightWidthAnimator && highlightWidthAnimator->isRunning());
Executed by:
  • tst_examples
  • tst_qquicklistview
126
964}-
965-
966-
967QQuickItem * QQuickListViewPrivate::getSectionItem(const QString &section)-
968{-
969 Q_Q(QQuickListView);-
970 QQuickItem *sectionItem = nullptr;-
971 int i = sectionCacheSize-1;-
972 while (i >= 0 && !sectionCache[i])
i >= 0Description
TRUEevaluated 1008 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 182 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
!sectionCache[i]Description
TRUEevaluated 988 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicklistview
20-1008
973 --i;
executed 988 times by 3 tests: --i;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
988
974 if (i >= 0) {
i >= 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 182 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
20-182
975 sectionItem = sectionCache[i];-
976 sectionCache[i] = nullptr;-
977 sectionItem->setVisible(true);-
978 QQmlContext *context = QQmlEngine::contextForObject(sectionItem)->parentContext();-
979 context->setContextProperty(QLatin1String("section"), section);-
980 } else {
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
20
981 QQmlContext *creationContext = sectionCriteria->delegate()->creationContext();-
982 QQmlContext *context = new QQmlContext(-
983 creationContext ? creationContext : qmlContext(q));-
984 context->setContextProperty(QLatin1String("section"), section);-
985 QObject *nobj = sectionCriteria->delegate()->beginCreate(context);-
986 if (nobj) {
nobjDescription
TRUEevaluated 182 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-182
987 QQml_setParent_noEvent(context, nobj);-
988 sectionItem = qobject_cast<QQuickItem *>(nobj);-
989 if (!sectionItem) {
!sectionItemDescription
TRUEnever evaluated
FALSEevaluated 182 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-182
990 delete nobj;-
991 } else {
never executed: end of block
0
992 if (qFuzzyIsNull(sectionItem->z()))
qFuzzyIsNull(sectionItem->z())Description
TRUEevaluated 180 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-180
993 sectionItem->setZ(2);
executed 180 times by 3 tests: sectionItem->setZ(2);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
180
994 QQml_setParent_noEvent(sectionItem, contentItem);-
995 sectionItem->setParentItem(contentItem);-
996 }
executed 182 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
182
997 // sections are not controlled by FxListItemSG, so apply attached properties here-
998 QQuickItemViewAttached *attached = static_cast<QQuickItemViewAttached*>(qmlAttachedPropertiesObject<QQuickListView>(sectionItem));-
999 attached->setView(q);-
1000 } else {
executed 182 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
182
1001 delete context;-
1002 }
never executed: end of block
0
1003 sectionCriteria->delegate()->completeCreate();-
1004 }
executed 182 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
182
1005-
1006 return sectionItem;
executed 202 times by 3 tests: return sectionItem;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
202
1007}-
1008-
1009void QQuickListViewPrivate::releaseSectionItem(QQuickItem *item)-
1010{-
1011 if (!item)
!itemDescription
TRUEevaluated 8416 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicklistview
40-8416
1012 return;
executed 8416 times by 11 tests: return;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
8416
1013 int i = 0;-
1014 do {-
1015 if (!sectionCache[i]) {
!sectionCache[i]Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 106 times by 1 test
Evaluated by:
  • tst_qquicklistview
24-106
1016 sectionCache[i] = item;-
1017 sectionCache[i]->setVisible(false);-
1018 return;
executed 24 times by 1 test: return;
Executed by:
  • tst_qquicklistview
24
1019 }-
1020 ++i;-
1021 } while (i < sectionCacheSize);
executed 106 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
i < sectionCacheSizeDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
16-106
1022 delete item;-
1023}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
16
1024-
1025-
1026void QQuickListViewPrivate::releaseSectionItems()-
1027{-
1028 for (FxViewItem *item : qAsConst(visibleItems)) {-
1029 FxListItemSG *listItem = static_cast<FxListItemSG *>(item);-
1030 if (listItem->section()) {
listItem->section()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-26
1031 qreal pos = listItem->position();-
1032 releaseSectionItem(listItem->section());-
1033 listItem->setSection(nullptr);-
1034 listItem->setPosition(pos);-
1035 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
26
1036 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
26
1037 for (int i = 0; i < sectionCacheSize; ++i) {
i < sectionCacheSizeDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-10
1038 delete sectionCache[i];-
1039 sectionCache[i] = nullptr;-
1040 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
10
1041}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
1042-
1043void QQuickListViewPrivate::updateInlineSection(FxListItemSG *listItem)-
1044{-
1045 if (!sectionCriteria || !sectionCriteria->delegate())
!sectionCriteriaDescription
TRUEnever evaluated
FALSEevaluated 6418 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
!sectionCriteria->delegate()Description
TRUEevaluated 792 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 5626 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-6418
1046 return;
executed 792 times by 2 tests: return;
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
792
1047 if (QString::compare(listItem->attached->m_prevSection, listItem->attached->m_section, Qt::CaseInsensitive)
QString::compa...seInsensitive)Description
TRUEevaluated 4688 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 938 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
938-4688
1048 && (sectionCriteria->labelPositioning() & QQuickViewSection::InlineLabels
sectionCriteri...::InlineLabelsDescription
TRUEevaluated 4688 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-4688
1049 || (listItem->index == 0 && sectionCriteria->labelPositioning() & QQuickViewSection::CurrentLabelAtStart))) {
listItem->index == 0Description
TRUEnever evaluated
FALSEnever evaluated
sectionCriteri...ntLabelAtStartDescription
TRUEnever evaluated
FALSEnever evaluated
0
1050 if (!listItem->section()) {
!listItem->section()Description
TRUEevaluated 194 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 4494 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
194-4494
1051 qreal pos = listItem->position();-
1052 listItem->setSection(getSectionItem(listItem->attached->m_section));-
1053 listItem->setPosition(pos);-
1054 } else {
executed 194 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
194
1055 QQmlContext *context = QQmlEngine::contextForObject(listItem->section())->parentContext();-
1056 context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);-
1057 }
executed 4494 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
4494
1058 } else if (listItem->section()) {
listItem->section()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 932 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
6-932
1059 qreal pos = listItem->position();-
1060 releaseSectionItem(listItem->section());-
1061 listItem->setSection(nullptr);-
1062 listItem->setPosition(pos);-
1063 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
6
1064}
executed 5626 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
5626
1065-
1066void QQuickListViewPrivate::updateStickySections()-
1067{-
1068 if (!sectionCriteria || !sectionCriteria->delegate()
!sectionCriteriaDescription
TRUEevaluated 3014 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 975 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
!sectionCriteria->delegate()Description
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 925 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
50-3014
1069 || (!sectionCriteria->labelPositioning() && !currentSectionItem && !nextSectionItem))
!sectionCriter...lPositioning()Description
TRUEnever evaluated
FALSEevaluated 925 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
!currentSectionItemDescription
TRUEnever evaluated
FALSEnever evaluated
!nextSectionItemDescription
TRUEnever evaluated
FALSEnever evaluated
0-925
1070 return;
executed 3064 times by 6 tests: return;
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3064
1071-
1072 bool isFlowReversed = isContentFlowReversed();-
1073 qreal viewPos = isFlowReversed ? -position()-size() : position();
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 925 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-925
1074 qreal startPos = hasStickyHeader() ? header->endPosition() : viewPos;
hasStickyHeader()Description
TRUEnever evaluated
FALSEevaluated 925 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-925
1075 qreal endPos = hasStickyFooter() ? footer->position() : viewPos + size();
hasStickyFooter()Description
TRUEnever evaluated
FALSEevaluated 925 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-925
1076-
1077 QQuickItem *sectionItem = nullptr;-
1078 QQuickItem *lastSectionItem = nullptr;-
1079 int index = 0;-
1080 while (index < visibleItems.count()) {
index < visibleItems.count()Description
TRUEevaluated 8887 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 925 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
925-8887
1081 if (QQuickItem *section = static_cast<FxListItemSG *>(visibleItems.at(index))->section()) {
QQuickItem *se...x))->section()Description
TRUEevaluated 3872 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 5015 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
3872-5015
1082 // Find the current section header and last visible section header-
1083 // and hide them if they will overlap a static section header.-
1084 qreal sectionPos = orient == QQuickListView::Vertical ? section->y() : section->x();
orient == QQui...View::VerticalDescription
TRUEevaluated 3872 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-3872
1085 qreal sectionSize = orient == QQuickListView::Vertical ? section->height() : section->width();
orient == QQui...View::VerticalDescription
TRUEevaluated 3872 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEnever evaluated
0-3872
1086 bool visTop = true;-
1087 if (sectionCriteria->labelPositioning() & QQuickViewSection::CurrentLabelAtStart)
sectionCriteri...ntLabelAtStartDescription
TRUEevaluated 403 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3469 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
403-3469
1088 visTop = isFlowReversed ? -sectionPos-sectionSize >= startPos : sectionPos >= startPos;
executed 403 times by 1 test: visTop = isFlowReversed ? -sectionPos-sectionSize >= startPos : sectionPos >= startPos;
Executed by:
  • tst_qquicklistview
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 403 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-403
1089 bool visBot = true;-
1090 if (sectionCriteria->labelPositioning() & QQuickViewSection::NextLabelAtEnd)
sectionCriteri...NextLabelAtEndDescription
TRUEevaluated 383 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3489 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
383-3489
1091 visBot = isFlowReversed ? -sectionPos <= endPos : sectionPos + sectionSize < endPos;
executed 383 times by 1 test: visBot = isFlowReversed ? -sectionPos <= endPos : sectionPos + sectionSize < endPos;
Executed by:
  • tst_qquicklistview
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 383 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-383
1092 section->setVisible(visBot && visTop);-
1093 if (visTop && !sectionItem)
visTopDescription
TRUEevaluated 3832 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicklistview
!sectionItemDescription
TRUEevaluated 865 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 2967 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
40-3832
1094 sectionItem = section;
executed 865 times by 3 tests: sectionItem = section;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
865
1095 if (isFlowReversed) {
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 3872 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
0-3872
1096 if (-sectionPos <= endPos)
-sectionPos <= endPosDescription
TRUEnever evaluated
FALSEnever evaluated
0
1097 lastSectionItem = section;
never executed: lastSectionItem = section;
0
1098 } else {
never executed: end of block
0
1099 if (sectionPos + sectionSize < endPos)
sectionPos + s...nSize < endPosDescription
TRUEevaluated 3212 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 660 times by 1 test
Evaluated by:
  • tst_qquicklistview
660-3212
1100 lastSectionItem = section;
executed 3212 times by 3 tests: lastSectionItem = section;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
3212
1101 }
executed 3872 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
3872
1102 }-
1103 ++index;-
1104 }
executed 8887 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
8887
1105-
1106 // Current section header-
1107 if (sectionCriteria->labelPositioning() & QQuickViewSection::CurrentLabelAtStart && isValid() && visibleItems.count()) {
sectionCriteri...ntLabelAtStartDescription
TRUEevaluated 103 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 822 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
isValid()Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qquicklistview
visibleItems.count()Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-822
1108 if (!currentSectionItem) {
!currentSectionItemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-86
1109 currentSectionItem = getSectionItem(currentSection);-
1110 } else if (QString::compare(currentStickySection, currentSection, Qt::CaseInsensitive)) {
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
QString::compa...seInsensitive)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-76
1111 QQmlContext *context = QQmlEngine::contextForObject(currentSectionItem)->parentContext();-
1112 context->setContextProperty(QLatin1String("section"), currentSection);-
1113 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
10
1114 currentStickySection = currentSection;-
1115 if (!currentSectionItem)
!currentSectionItemDescription
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-90
1116 return;
never executed: return;
0
1117-
1118 qreal sectionSize = orient == QQuickListView::Vertical ? currentSectionItem->height() : currentSectionItem->width();
orient == QQui...View::VerticalDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-90
1119 bool atBeginning = orient == QQuickListView::Vertical ? (isBottomToTop() ? vData.atEnd : vData.atBeginning) : (isRightToLeft() ? hData.atEnd : hData.atBeginning);
orient == QQui...View::VerticalDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
isBottomToTop()Description
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0-90
1120-
1121 currentSectionItem->setVisible(!atBeginning && (!header || hasStickyHeader() || header->endPosition() < viewPos));-
1122 qreal pos = isFlowReversed ? position() + size() - sectionSize : startPos;
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-90
1123 if (header)
headerDescription
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-90
1124 pos = isFlowReversed ? qMin(-header->endPosition() - sectionSize, pos) : qMax(header->endPosition(), pos);
never executed: pos = isFlowReversed ? qMin(-header->endPosition() - sectionSize, pos) : qMax(header->endPosition(), pos);
isFlowReversedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1125 if (sectionItem) {
sectionItemDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-90
1126 qreal sectionPos = orient == QQuickListView::Vertical ? sectionItem->y() : sectionItem->x();
orient == QQui...View::VerticalDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-90
1127 pos = isFlowReversed ? qMax(pos, sectionPos + sectionSize) : qMin(pos, sectionPos - sectionSize);
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-90
1128 }
executed 90 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
90
1129 if (footer)
footerDescription
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-90
1130 pos = isFlowReversed ? qMax(-footer->position(), pos) : qMin(footer->position() - sectionSize, pos);
never executed: pos = isFlowReversed ? qMax(-footer->position(), pos) : qMin(footer->position() - sectionSize, pos);
isFlowReversedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1131 if (orient == QQuickListView::Vertical)
orient == QQui...View::VerticalDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-90
1132 currentSectionItem->setY(pos);
executed 90 times by 1 test: currentSectionItem->setY(pos);
Executed by:
  • tst_qquicklistview
90
1133 else-
1134 currentSectionItem->setX(pos);
never executed: currentSectionItem->setX(pos);
0
1135 } else if (currentSectionItem) {
currentSectionItemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 831 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
4-831
1136 releaseSectionItem(currentSectionItem);-
1137 currentSectionItem = nullptr;-
1138 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
1139-
1140 // Next section footer-
1141 if (sectionCriteria->labelPositioning() & QQuickViewSection::NextLabelAtEnd && isValid() && visibleItems.count()) {
sectionCriteri...NextLabelAtEndDescription
TRUEevaluated 99 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 826 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
isValid()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qquicklistview
visibleItems.count()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-826
1142 if (!nextSectionItem) {
!nextSectionItemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-82
1143 nextSectionItem = getSectionItem(nextSection);-
1144 } else if (QString::compare(nextStickySection, nextSection, Qt::CaseInsensitive)) {
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
QString::compa...seInsensitive)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-66
1145 QQmlContext *context = QQmlEngine::contextForObject(nextSectionItem)->parentContext();-
1146 context->setContextProperty(QLatin1String("section"), nextSection);-
1147 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
16
1148 nextStickySection = nextSection;-
1149 if (!nextSectionItem)
!nextSectionItemDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
1150 return;
never executed: return;
0
1151-
1152 qreal sectionSize = orient == QQuickListView::Vertical ? nextSectionItem->height() : nextSectionItem->width();
orient == QQui...View::VerticalDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-86
1153 nextSectionItem->setVisible(!nextSection.isEmpty());-
1154 qreal pos = isFlowReversed ? position() : endPos - sectionSize;
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
1155 if (footer)
footerDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
1156 pos = isFlowReversed ? qMax(-footer->position(), pos) : qMin(footer->position() - sectionSize, pos);
never executed: pos = isFlowReversed ? qMax(-footer->position(), pos) : qMin(footer->position() - sectionSize, pos);
isFlowReversedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1157 if (lastSectionItem) {
lastSectionItemDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-86
1158 qreal sectionPos = orient == QQuickListView::Vertical ? lastSectionItem->y() : lastSectionItem->x();
orient == QQui...View::VerticalDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-86
1159 pos = isFlowReversed ? qMin(pos, sectionPos - sectionSize) : qMax(pos, sectionPos + sectionSize);
isFlowReversedDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
1160 }
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
86
1161 if (header)
headerDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
1162 pos = isFlowReversed ? qMin(-header->endPosition() - sectionSize, pos) : qMax(header->endPosition(), pos);
never executed: pos = isFlowReversed ? qMin(-header->endPosition() - sectionSize, pos) : qMax(header->endPosition(), pos);
isFlowReversedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1163 if (orient == QQuickListView::Vertical)
orient == QQui...View::VerticalDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-86
1164 nextSectionItem->setY(pos);
executed 86 times by 1 test: nextSectionItem->setY(pos);
Executed by:
  • tst_qquicklistview
86
1165 else-
1166 nextSectionItem->setX(pos);
never executed: nextSectionItem->setX(pos);
0
1167 } else if (nextSectionItem) {
nextSectionItemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 835 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
4-835
1168 releaseSectionItem(nextSectionItem);-
1169 nextSectionItem = nullptr;-
1170 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
1171}
executed 925 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
925
1172-
1173void QQuickListViewPrivate::updateSections()-
1174{-
1175 Q_Q(QQuickListView);-
1176 if (!q->isComponentComplete())
!q->isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 6944 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
0-6944
1177 return;
never executed: return;
0
1178-
1179 QQuickItemViewPrivate::updateSections();-
1180-
1181 if (sectionCriteria && !visibleItems.isEmpty() && isValid()) {
sectionCriteriaDescription
TRUEevaluated 627 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 6317 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
!visibleItems.isEmpty()Description
TRUEevaluated 575 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 52 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
isValid()Description
TRUEevaluated 560 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_qquicklistview
15-6317
1182 QString prevSection;-
1183 if (visibleIndex > 0)
visibleIndex > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 556 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4-556
1184 prevSection = sectionAt(visibleIndex-1);
executed 4 times by 1 test: prevSection = sectionAt(visibleIndex-1);
Executed by:
  • tst_qquicklistview
4
1185 QQuickListViewAttached *prevAtt = nullptr;-
1186 int prevIdx = -1;-
1187 int idx = -1;-
1188 for (FxViewItem *item : qAsConst(visibleItems)) {-
1189 QQuickListViewAttached *attached = static_cast<QQuickListViewAttached*>(item->attached);-
1190 attached->setPrevSection(prevSection);-
1191 if (item->index != -1) {
item->index != -1Description
TRUEevaluated 6174 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicklistview
38-6174
1192 QString propValue = model->stringValue(item->index, sectionCriteria->property());-
1193 attached->setSection(sectionCriteria->sectionString(propValue));-
1194 idx = item->index;-
1195 }
executed 6174 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
6174
1196 updateInlineSection(static_cast<FxListItemSG*>(item));-
1197 if (prevAtt)
prevAttDescription
TRUEevaluated 5652 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 560 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
560-5652
1198 prevAtt->setNextSection(sectionAt(prevIdx+1));
executed 5652 times by 3 tests: prevAtt->setNextSection(sectionAt(prevIdx+1));
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
5652
1199 prevSection = attached->section();-
1200 prevAtt = attached;-
1201 prevIdx = item->index;-
1202 }
executed 6212 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
6212
1203 if (prevAtt) {
prevAttDescription
TRUEevaluated 560 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-560
1204 if (idx > 0 && idx < model->count()-1)
idx > 0Description
TRUEevaluated 556 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qquickgridview
  • tst_qquicklistview
idx < model->count()-1Description
TRUEevaluated 114 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 442 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4-556
1205 prevAtt->setNextSection(sectionAt(idx+1));
executed 114 times by 2 tests: prevAtt->setNextSection(sectionAt(idx+1));
Executed by:
  • tst_examples
  • tst_qquicklistview
114
1206 else-
1207 prevAtt->setNextSection(QString());
executed 446 times by 4 tests: prevAtt->setNextSection(QString());
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
446
1208 }-
1209 }
executed 560 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
560
1210-
1211 lastVisibleSection = QString();-
1212}
executed 6944 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
6944
1213-
1214void QQuickListViewPrivate::updateCurrentSection()-
1215{-
1216 Q_Q(QQuickListView);-
1217 if (!sectionCriteria || visibleItems.isEmpty()) {
!sectionCriteriaDescription
TRUEevaluated 3014 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 1000 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
visibleItems.isEmpty()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
14-3014
1218 if (!currentSection.isEmpty()) {
!currentSection.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3026 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2-3026
1219 currentSection.clear();-
1220 emit q->currentSectionChanged();-
1221 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
1222 return;
executed 3028 times by 6 tests: return;
Executed by:
  • tst_examples
  • tst_qqmltypeloader
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3028
1223 }-
1224 bool inlineSections = sectionCriteria->labelPositioning() & QQuickViewSection::InlineLabels;-
1225 qreal viewPos = isContentFlowReversed() ? -position()-size() : position();
isContentFlowReversed()Description
TRUEnever evaluated
FALSEevaluated 986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-986
1226 qreal startPos = hasStickyHeader() ? header->endPosition() : viewPos;
hasStickyHeader()Description
TRUEnever evaluated
FALSEevaluated 986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-986
1227 int index = 0;-
1228 int modelIndex = visibleIndex;-
1229 while (index < visibleItems.count()) {
index < visibleItems.count()Description
TRUEevaluated 1380 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 57 times by 1 test
Evaluated by:
  • tst_qquicklistview
57-1380
1230 FxViewItem *item = visibleItems.at(index);-
1231 if (item->endPosition() > startPos)
item->endPosition() > startPosDescription
TRUEevaluated 929 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 451 times by 1 test
Evaluated by:
  • tst_qquicklistview
451-929
1232 break;
executed 929 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
929
1233 if (item->index != -1)
item->index != -1Description
TRUEevaluated 451 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-451
1234 modelIndex = item->index;
executed 451 times by 1 test: modelIndex = item->index;
Executed by:
  • tst_qquicklistview
451
1235 ++index;-
1236 }
executed 451 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
451
1237-
1238 QString newSection = currentSection;-
1239 if (index < visibleItems.count())
index < visibleItems.count()Description
TRUEevaluated 929 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 57 times by 1 test
Evaluated by:
  • tst_qquicklistview
57-929
1240 newSection = visibleItems.at(index)->attached->section();
executed 929 times by 4 tests: newSection = visibleItems.at(index)->attached->section();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
929
1241 else-
1242 newSection = (*visibleItems.constBegin())->attached->section();
executed 57 times by 1 test: newSection = (*visibleItems.constBegin())->attached->section();
Executed by:
  • tst_qquicklistview
57
1243 if (newSection != currentSection) {
newSection != currentSectionDescription
TRUEevaluated 142 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 844 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
142-844
1244 currentSection = newSection;-
1245 updateStickySections();-
1246 emit q->currentSectionChanged();-
1247 }
executed 142 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
142
1248-
1249 if (sectionCriteria->labelPositioning() & QQuickViewSection::NextLabelAtEnd) {
sectionCriteri...NextLabelAtEndDescription
TRUEevaluated 69 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 917 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
69-917
1250 // Don't want to scan for next section on every movement, so remember-
1251 // the last section in the visible area and only scan for the next-
1252 // section when that changes. Clearing lastVisibleSection will also-
1253 // force searching.-
1254 QString lastSection = currentSection;-
1255 qreal endPos = hasStickyFooter() ? footer->position() : viewPos + size();
hasStickyFooter()Description
TRUEnever evaluated
FALSEevaluated 69 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-69
1256 if (nextSectionItem && !inlineSections)
nextSectionItemDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_qquicklistview
!inlineSectionsDescription
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-54
1257 endPos -= orient == QQuickListView::Vertical ? nextSectionItem->height() : nextSectionItem->width();
never executed: endPos -= orient == QQuickListView::Vertical ? nextSectionItem->height() : nextSectionItem->width();
orient == QQui...View::VerticalDescription
TRUEnever evaluated
FALSEnever evaluated
0
1258 while (index < visibleItems.count()) {
index < visibleItems.count()Description
TRUEevaluated 994 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-994
1259 FxListItemSG *listItem = static_cast<FxListItemSG *>(visibleItems.at(index));-
1260 if (listItem->itemPosition() >= endPos)
listItem->item...on() >= endPosDescription
TRUEevaluated 65 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 929 times by 1 test
Evaluated by:
  • tst_qquicklistview
65-929
1261 break;
executed 65 times by 1 test: break;
Executed by:
  • tst_qquicklistview
65
1262 if (listItem->index != -1)
listItem->index != -1Description
TRUEevaluated 736 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 193 times by 1 test
Evaluated by:
  • tst_qquicklistview
193-736
1263 modelIndex = listItem->index;
executed 736 times by 1 test: modelIndex = listItem->index;
Executed by:
  • tst_qquicklistview
736
1264 lastSection = listItem->attached->section();-
1265 ++index;-
1266 }
executed 929 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
929
1267-
1268 if (lastVisibleSection != lastSection) {
lastVisibleSec...!= lastSectionDescription
TRUEevaluated 47 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicklistview
22-47
1269 nextSection = QString();-
1270 lastVisibleSection = lastSection;-
1271 for (int i = modelIndex; i < itemCount; ++i) {
i < itemCountDescription
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qquicklistview
13-104
1272 QString section = sectionAt(i);-
1273 if (section != lastSection) {
section != lastSectionDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qquicklistview
34-70
1274 nextSection = section;-
1275 updateStickySections();-
1276 break;
executed 34 times by 1 test: break;
Executed by:
  • tst_qquicklistview
34
1277 }-
1278 }
executed 70 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
70
1279 }
executed 47 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
47
1280 }
executed 69 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
69
1281}
executed 986 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
986
1282-
1283void QQuickListViewPrivate::initializeCurrentItem()-
1284{-
1285 QQuickItemViewPrivate::initializeCurrentItem();-
1286-
1287 if (currentItem) {
currentItemDescription
TRUEevaluated 3584 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-3584
1288 FxListItemSG *listItem = static_cast<FxListItemSG *>(currentItem);-
1289-
1290 // don't reposition the item if it is already in the visibleItems list-
1291 FxViewItem *actualItem = visibleItem(currentIndex);-
1292 if (!actualItem) {
!actualItemDescription
TRUEevaluated 167 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 3417 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
167-3417
1293 if (currentIndex == visibleIndex - 1 && visibleItems.count()) {
currentIndex =...sibleIndex - 1Description
TRUEnever evaluated
FALSEevaluated 167 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
visibleItems.count()Description
TRUEnever evaluated
FALSEnever evaluated
0-167
1294 // We can calculate exact postion in this case-
1295 listItem->setPosition(visibleItems.constFirst()->position() - currentItem->size() - spacing);-
1296 } else {
never executed: end of block
0
1297 // Create current item now and position as best we can.-
1298 // Its position will be corrected when it becomes visible.-
1299 listItem->setPosition(positionAt(currentIndex));-
1300 }
executed 167 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
167
1301 }-
1302-
1303 if (visibleItems.isEmpty())
visibleItems.isEmpty()Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3534 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
50-3534
1304 averageSize = listItem->size();
executed 50 times by 1 test: averageSize = listItem->size();
Executed by:
  • tst_qquicklistview
50
1305 }
executed 3584 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3584
1306}
executed 3584 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3584
1307-
1308void QQuickListViewPrivate::updateAverage()-
1309{-
1310 if (!visibleItems.count())
!visibleItems.count()Description
TRUEnever evaluated
FALSEevaluated 5566 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
0-5566
1311 return;
never executed: return;
0
1312 qreal sum = 0.0;-
1313 for (FxViewItem *item : qAsConst(visibleItems))-
1314 sum += item->size();
executed 70254 times by 10 tests: sum += item->size();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
70254
1315 averageSize = qRound(sum / visibleItems.count());-
1316}
executed 5566 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5566
1317-
1318qreal QQuickListViewPrivate::headerSize() const-
1319{-
1320 return header ? header->size() : 0.0;
executed 42252 times by 11 tests: return header ? header->size() : 0.0;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
42252
1321}-
1322-
1323qreal QQuickListViewPrivate::footerSize() const-
1324{-
1325 return footer ? footer->size() : 0.0;
executed 33805 times by 11 tests: return footer ? footer->size() : 0.0;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
33805
1326}-
1327-
1328bool QQuickListViewPrivate::showHeaderForIndex(int index) const-
1329{-
1330 return index == 0;
executed 6526 times by 10 tests: return index == 0;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
6526
1331}-
1332-
1333bool QQuickListViewPrivate::showFooterForIndex(int index) const-
1334{-
1335 return model && index == model->count()-1;
executed 2661 times by 3 tests: return model && index == model->count()-1;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
2661
1336}-
1337-
1338void QQuickListViewPrivate::updateFooter()-
1339{-
1340 Q_Q(QQuickListView);-
1341 bool created = false;-
1342 if (!footer) {
!footerDescription
TRUEevaluated 10385 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 1140 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
1140-10385
1343 QQuickItem *item = createComponentItem(footerComponent, 1.0);-
1344 if (!item)
!itemDescription
TRUEevaluated 10241 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 144 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
144-10241
1345 return;
executed 10241 times by 11 tests: return;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
10241
1346 footer = new FxListItemSG(item, q, true);-
1347 footer->trackGeometry(true);-
1348 created = true;-
1349 }
executed 144 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
144
1350-
1351 FxListItemSG *listItem = static_cast<FxListItemSG*>(footer);-
1352 if (footerPositioning == QQuickListView::OverlayFooter) {
footerPosition...:OverlayFooterDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1192 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
92-1192
1353 listItem->setPosition(isContentFlowReversed() ? -position() - footerSize() : position() + size() - footerSize());-
1354 } else if (visibleItems.count()) {
executed 92 times by 1