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 test: end of block
Executed by:
  • tst_qquicklistview
visibleItems.count()Description
TRUEevaluated 922 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 270 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
92-922
1355 if (footerPositioning == QQuickListView::PullBackFooter) {
footerPosition...PullBackFooterDescription
TRUEevaluated 684 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 238 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
238-684
1356 qreal viewPos = isContentFlowReversed() ? -position() : position() + size();
isContentFlowReversed()Description
TRUEevaluated 196 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 488 times by 1 test
Evaluated by:
  • tst_qquicklistview
196-488
1357 qreal clampedPos = qBound(originPosition() - footerSize() + size(), listItem->position(), lastPosition());-
1358 listItem->setPosition(qBound(viewPos - footerSize(), clampedPos, viewPos));-
1359 } else {
executed 684 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
684
1360 qreal endPos = lastPosition();-
1361 if (findLastVisibleIndex() == model->count()-1) {
findLastVisibl...del->count()-1Description
TRUEevaluated 188 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquicklistview
50-188
1362 listItem->setPosition(endPos);-
1363 } else {
executed 188 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
188
1364 qreal visiblePos = position() + q->height();-
1365 if (endPos <= visiblePos || listItem->position() < endPos)
endPos <= visiblePosDescription
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquicklistview
listItem->position() < endPosDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-50
1366 listItem->setPosition(endPos);
executed 22 times by 1 test: listItem->setPosition(endPos);
Executed by:
  • tst_qquicklistview
22
1367 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
50
1368 }-
1369 } else {-
1370 listItem->setPosition(visiblePos);-
1371 }
executed 270 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
270
1372-
1373 if (created)
createdDescription
TRUEevaluated 144 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 1140 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
144-1140
1374 emit q->footerItemChanged();
executed 144 times by 2 tests: q->footerItemChanged();
Executed by:
  • tst_examples
  • tst_qquicklistview
144
1375}
executed 1284 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
1284
1376-
1377void QQuickListViewPrivate::updateHeader()-
1378{-
1379 Q_Q(QQuickListView);-
1380 bool created = false;-
1381 if (!header) {
!headerDescription
TRUEevaluated 10332 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 1079 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
1079-10332
1382 QQuickItem *item = createComponentItem(headerComponent, 1.0);-
1383 if (!item)
!itemDescription
TRUEevaluated 10156 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 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
176-10156
1384 return;
executed 10156 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
10156
1385 header = new FxListItemSG(item, q, true);-
1386 header->trackGeometry(true);-
1387 created = true;-
1388 }
executed 176 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
176
1389-
1390 FxListItemSG *listItem = static_cast<FxListItemSG*>(header);-
1391 if (headerPositioning == QQuickListView::OverlayHeader) {
headerPosition...:OverlayHeaderDescription
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1127 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
128-1127
1392 listItem->setPosition(isContentFlowReversed() ? -position() - size() : position());-
1393 } else if (visibleItems.count()) {
executed 128 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
visibleItems.count()Description
TRUEevaluated 717 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 410 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
128-717
1394 if (headerPositioning == QQuickListView::PullBackHeader) {
headerPosition...PullBackHeaderDescription
TRUEevaluated 502 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 215 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
215-502
1395 qreal viewPos = isContentFlowReversed() ? -position() - size() : position();
isContentFlowReversed()Description
TRUEevaluated 124 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 378 times by 1 test
Evaluated by:
  • tst_qquicklistview
124-378
1396 qreal clampedPos = qBound(originPosition() - headerSize(), listItem->position(), lastPosition() - headerSize() - size());-
1397 listItem->setPosition(qBound(viewPos - headerSize(), clampedPos, viewPos));-
1398 } else {
executed 502 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
502
1399 qreal startPos = originPosition();-
1400 if (visibleIndex == 0) {
visibleIndex == 0Description
TRUEevaluated 203 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
12-203
1401 listItem->setPosition(startPos - headerSize());-
1402 } else {
executed 203 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
203
1403 if (position() <= startPos || listItem->position() > startPos - headerSize())
position() <= startPosDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
listItem->posi...- headerSize()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-12
1404 listItem->setPosition(startPos - headerSize());
executed 2 times by 1 test: listItem->setPosition(startPos - headerSize());
Executed by:
  • tst_qquicklistview
2
1405 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
12
1406 }-
1407 } else {-
1408 listItem->setPosition(-headerSize());-
1409 }
executed 410 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
410
1410-
1411 if (created)
createdDescription
TRUEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 1079 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
176-1079
1412 emit q->headerItemChanged();
executed 176 times by 2 tests: q->headerItemChanged();
Executed by:
  • tst_examples
  • tst_qquicklistview
176
1413}
executed 1255 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
1255
1414-
1415bool QQuickListViewPrivate::hasStickyHeader() const-
1416{-
1417 return header && headerPositioning != QQuickListView::InlineHeader;
executed 12278 times by 5 tests: return header && headerPositioning != QQuickListView::InlineHeader;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
12278
1418}-
1419-
1420bool QQuickListViewPrivate::hasStickyFooter() const-
1421{-
1422 return footer && footerPositioning != QQuickListView::InlineFooter;
executed 11361 times by 5 tests: return footer && footerPositioning != QQuickListView::InlineFooter;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
11361
1423}-
1424-
1425void QQuickListViewPrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change,-
1426 const QRectF &oldGeometry)-
1427{-
1428 Q_Q(QQuickListView);-
1429-
1430 QQuickItemViewPrivate::itemGeometryChanged(item, change, oldGeometry);-
1431 if (!q->isComponentComplete())
!q->isComponentComplete()Description
TRUEevaluated 3412 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 80231 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
3412-80231
1432 return;
executed 3412 times by 8 tests: return;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
3412
1433-
1434 if (currentItem && currentItem->item == item) {
currentItemDescription
TRUEevaluated 55640 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 24591 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
currentItem->item == itemDescription
TRUEevaluated 2939 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 52701 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
2939-55640
1435 const bool contentFlowReversed = isContentFlowReversed();-
1436 const qreal pos = position();-
1437 const qreal sz = size();-
1438 const qreal from = contentFlowReversed ? -pos - displayMarginBeginning - sz : pos - displayMarginBeginning;
contentFlowReversedDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2865 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
74-2865
1439 const qreal to = contentFlowReversed ? -pos + displayMarginEnd : pos + sz + displayMarginEnd;
contentFlowReversedDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2865 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
74-2865
1440 QQuickItemPrivate::get(currentItem->item)->setCulled(currentItem->endPosition() < from || currentItem->position() > to);-
1441 }
executed 2939 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2939
1442-
1443 if (item != contentItem && (!highlight || item != highlight->item)) {
item != contentItemDescription
TRUEevaluated 63911 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 16320 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 22134 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 41777 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
item != highlight->itemDescription
TRUEevaluated 33974 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 7803 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
7803-63911
1444 if ((orient == QQuickListView::Vertical && change.heightChange())
orient == QQui...View::VerticalDescription
TRUEevaluated 53530 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 2578 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
change.heightChange()Description
TRUEevaluated 2865 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 50665 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
2578-53530
1445 || (orient == QQuickListView::Horizontal && change.widthChange())) {
orient == QQui...ew::HorizontalDescription
TRUEevaluated 2578 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 50665 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
change.widthChange()Description
TRUEevaluated 222 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 2356 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
222-50665
1446-
1447 // if visibleItems.first() has resized, adjust its pos since it is used to-
1448 // position all subsequent items-
1449 if (visibleItems.count() && item == visibleItems.constFirst()->item) {
visibleItems.count()Description
TRUEevaluated 3057 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 1 test
Evaluated by:
  • tst_qquicklistview
item == visibl...tFirst()->itemDescription
TRUEevaluated 126 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2931 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
30-3057
1450 FxListItemSG *listItem = static_cast<FxListItemSG*>(visibleItems.constFirst());-
1451 if (listItem->transitionScheduledOrRunning())
listItem->tran...ledOrRunning()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 110 times by 1 test
Evaluated by:
  • tst_qquicklistview
16-110
1452 return;
executed 16 times by 1 test: return;
Executed by:
  • tst_qquicklistview
16
1453 if (orient == QQuickListView::Vertical) {
orient == QQui...View::VerticalDescription
TRUEevaluated 106 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-106
1454 const qreal oldItemEndPosition = verticalLayoutDirection == QQuickItemView::BottomToTop ? -oldGeometry.y() : oldGeometry.y() + oldGeometry.height();
verticalLayout...w::BottomToTopDescription
TRUEnever evaluated
FALSEevaluated 106 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-106
1455 const qreal heightDiff = item->height() - oldGeometry.height();-
1456 if (verticalLayoutDirection == QQuickListView::TopToBottom && oldItemEndPosition < q->contentY())
verticalLayout...w::TopToBottomDescription
TRUEevaluated 106 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
oldItemEndPosi... q->contentY()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-106
1457 listItem->setPosition(listItem->position() - heightDiff, true);
executed 8 times by 1 test: listItem->setPosition(listItem->position() - heightDiff, true);
Executed by:
  • tst_qquicklistview
8
1458 else if (verticalLayoutDirection == QQuickListView::BottomToTop && oldItemEndPosition > q->contentY())
verticalLayout...w::BottomToTopDescription
TRUEnever evaluated
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquicklistview
oldItemEndPosi... q->contentY()Description
TRUEnever evaluated
FALSEnever evaluated
0-98
1459 listItem->setPosition(listItem->position() + heightDiff, true);
never executed: listItem->setPosition(listItem->position() + heightDiff, true);
0
1460 } else {
executed 106 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
106
1461 const qreal oldItemEndPosition = q->effectiveLayoutDirection() == Qt::RightToLeft ? -oldGeometry.x() : oldGeometry.x() + oldGeometry.width();
q->effectiveLa...t::RightToLeftDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-4
1462 const qreal widthDiff = item->width() - oldGeometry.width();-
1463 if (q->effectiveLayoutDirection() == Qt::LeftToRight && oldItemEndPosition < q->contentX())
q->effectiveLa...t::LeftToRightDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
oldItemEndPosi... q->contentX()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-4
1464 listItem->setPosition(listItem->position() - widthDiff, true);
executed 4 times by 1 test: listItem->setPosition(listItem->position() - widthDiff, true);
Executed by:
  • tst_qquicklistview
4
1465 else if (q->effectiveLayoutDirection() == Qt::RightToLeft && oldItemEndPosition > q->contentX())
q->effectiveLa...t::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
oldItemEndPosi... q->contentX()Description
TRUEnever evaluated
FALSEnever evaluated
0
1466 listItem->setPosition(listItem->position() + widthDiff, true);
never executed: listItem->setPosition(listItem->position() + widthDiff, true);
0
1467 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
1468 }-
1469 forceLayoutPolish();-
1470 }
executed 3071 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
3071
1471 }
executed 56092 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
56092
1472}
executed 80215 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
80215
1473-
1474void QQuickListViewPrivate::fixupPosition()-
1475{-
1476 if (orient == QQuickListView::Vertical)
orient == QQui...View::VerticalDescription
TRUEevaluated 5117 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 686 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
686-5117
1477 fixupY();
executed 5117 times by 10 tests: fixupY();
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5117
1478 else-
1479 fixupX();
executed 686 times by 2 tests: fixupX();
Executed by:
  • tst_examples
  • tst_qquicklistview
686
1480}-
1481-
1482void QQuickListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)-
1483{-
1484 if (orient == QQuickListView::Horizontal && &data == &vData) {
orient == QQui...ew::HorizontalDescription
TRUEevaluated 1474 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 11081 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
&data == &vDataDescription
TRUEevaluated 190 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 1284 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
190-11081
1485 if (flickableDirection != QQuickFlickable::HorizontalFlick)
flickableDirec...orizontalFlickDescription
TRUEnever evaluated
FALSEevaluated 190 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
0-190
1486 QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);
never executed: QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);
0
1487 return;
executed 190 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquicklistview
190
1488 } else if (orient == QQuickListView::Vertical && &data == &hData) {
orient == QQui...View::VerticalDescription
TRUEevaluated 11081 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 1284 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
&data == &hDataDescription
TRUEevaluated 352 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 10729 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
352-11081
1489 if (flickableDirection != QQuickFlickable::VerticalFlick)
flickableDirec...:VerticalFlickDescription
TRUEnever evaluated
FALSEevaluated 352 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
0-352
1490 QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);
never executed: QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);
0
1491 return;
executed 352 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
352
1492 }-
1493-
1494 correctFlick = false;-
1495 fixupMode = moveReason == Mouse ? fixupMode : Immediate;
moveReason == MouseDescription
TRUEevaluated 317 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 11696 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
317-11696
1496 bool strictHighlightRange = haveHighlightRange && highlightRange == QQuickListView::StrictlyEnforceRange;
haveHighlightRangeDescription
TRUEevaluated 585 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 11428 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
highlightRange...lyEnforceRangeDescription
TRUEevaluated 537 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
48-11428
1497-
1498 qreal viewPos = isContentFlowReversed() ? -position()-size() : position();
isContentFlowReversed()Description
TRUEevaluated 1146 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 10867 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
1146-10867
1499-
1500 if (snapMode != QQuickListView::NoSnap && moveReason != QQuickListViewPrivate::SetIndex) {
snapMode != QQ...stView::NoSnapDescription
TRUEevaluated 945 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 11068 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
moveReason != ...vate::SetIndexDescription
TRUEevaluated 867 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_qquicklistview
78-11068
1501 qreal tempPosition = isContentFlowReversed() ? -position()-size() : position();
isContentFlowReversed()Description
TRUEevaluated 330 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 537 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
330-537
1502 if (snapMode == QQuickListView::SnapOneItem && moveReason == Mouse) {
snapMode == QQ...w::SnapOneItemDescription
TRUEevaluated 321 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 546 times by 1 test
Evaluated by:
  • tst_qquicklistview
moveReason == MouseDescription
TRUEevaluated 121 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 200 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
121-546
1503 // if we've been dragged < averageSize/2 then bias towards the next item-
1504 qreal dist = data.move.value() - data.pressPos;-
1505 qreal bias = 0;-
1506 if (data.velocity > 0 && dist > QML_FLICK_SNAPONETHRESHOLD && dist < averageSize/2)
data.velocity > 0Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicklistview
dist > 30Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
dist < averageSize/2Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 49 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-61
1507 bias = averageSize/2;
executed 12 times by 1 test: bias = averageSize/2;
Executed by:
  • tst_qquicklistview
12
1508 else if (data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -averageSize/2)
data.velocity < 0Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 49 times by 1 test
Evaluated by:
  • tst_qquicklistview
dist < -30Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
dist > -averageSize/2Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-60
1509 bias = -averageSize/2;
executed 12 times by 1 test: bias = -averageSize/2;
Executed by:
  • tst_qquicklistview
12
1510 if (isContentFlowReversed())
isContentFlowReversed()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 73 times by 1 test
Evaluated by:
  • tst_qquicklistview
48-73
1511 bias = -bias;
executed 48 times by 1 test: bias = -bias;
Executed by:
  • tst_qquicklistview
48
1512 tempPosition -= bias;-
1513 }
executed 121 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
121
1514 FxViewItem *topItem = snapItemAt(tempPosition+highlightRangeStart);-
1515 if (strictHighlightRange && currentItem && (!topItem || (topItem->index != currentIndex && fixupMode == Immediate))) {
strictHighlightRangeDescription
TRUEevaluated 391 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 476 times by 1 test
Evaluated by:
  • tst_qquicklistview
currentItemDescription
TRUEevaluated 233 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 158 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
!topItemDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 232 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
topItem->index != currentIndexDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 194 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
fixupMode == ImmediateDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
1-476
1516 // StrictlyEnforceRange always keeps an item in range-
1517 updateHighlight();-
1518 topItem = currentItem;-
1519 }
executed 27 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
27
1520 FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd);-
1521 if (strictHighlightRange && currentItem && (!bottomItem || (bottomItem->index != currentIndex && fixupMode == Immediate))) {
strictHighlightRangeDescription
TRUEevaluated 391 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 476 times by 1 test
Evaluated by:
  • tst_qquicklistview
currentItemDescription
TRUEevaluated 233 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 158 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
!bottomItemDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 214 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
bottomItem->in...= currentIndexDescription
TRUEevaluated 168 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
fixupMode == ImmediateDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicklistview
19-476
1522 // StrictlyEnforceRange always keeps an item in range-
1523 updateHighlight();-
1524 bottomItem = currentItem;-
1525 }
executed 103 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
103
1526 qreal pos;-
1527 bool isInBounds = -position() > maxExtent && -position() <= minExtent;
-position() > maxExtentDescription
TRUEevaluated 633 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 234 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
-position() <= minExtentDescription
TRUEevaluated 562 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 71 times by 1 test
Evaluated by:
  • tst_qquicklistview
71-633
1528 if (topItem && (isInBounds || strictHighlightRange)) {
topItemDescription
TRUEevaluated 461 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 406 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
isInBoundsDescription
TRUEevaluated 350 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 111 times by 1 test
Evaluated by:
  • tst_qquicklistview
strictHighlightRangeDescription
TRUEevaluated 57 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicklistview
54-461
1529 if (topItem->index == 0 && header && tempPosition+highlightRangeStart < header->position()+header->size()/2 && !strictHighlightRange) {
topItem->index == 0Description
TRUEevaluated 227 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 180 times by 1 test
Evaluated by:
  • tst_qquicklistview
headerDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 211 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
tempPosition+h...ader->size()/2Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
!strictHighlightRangeDescription
TRUEnever evaluated
FALSEnever evaluated
0-227
1530 pos = isContentFlowReversed() ? - header->position() + highlightRangeStart - size() : header->position() - highlightRangeStart;
isContentFlowReversed()Description
TRUEnever evaluated
FALSEnever evaluated
0
1531 } else {
never executed: end of block
0
1532 if (isContentFlowReversed())
isContentFlowReversed()Description
TRUEevaluated 168 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 239 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
168-239
1533 pos = qMax(qMin(-topItem->position() + highlightRangeStart - size(), -maxExtent), -minExtent);
executed 168 times by 1 test: pos = qMax(qMin(-topItem->position() + highlightRangeStart - size(), -maxExtent), -minExtent);
Executed by:
  • tst_qquicklistview
168
1534 else-
1535 pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
executed 239 times by 2 tests: pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
Executed by:
  • tst_examples
  • tst_qquicklistview
239
1536 }-
1537 } else if (bottomItem && isInBounds) {
bottomItemDescription
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 398 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
isInBoundsDescription
TRUEnever evaluated
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-398
1538 if (isContentFlowReversed())
isContentFlowReversed()Description
TRUEnever evaluated
FALSEnever evaluated
0
1539 pos = qMax(qMin(-bottomItem->position() + highlightRangeEnd - size(), -maxExtent), -minExtent);
never executed: pos = qMax(qMin(-bottomItem->position() + highlightRangeEnd - size(), -maxExtent), -minExtent);
0
1540 else-
1541 pos = qMax(qMin(bottomItem->position() - highlightRangeEnd, -maxExtent), -minExtent);
never executed: pos = qMax(qMin(bottomItem->position() - highlightRangeEnd, -maxExtent), -minExtent);
0
1542 } else {-
1543 QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);-
1544 return;
executed 460 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquicklistview
460
1545 }-
1546-
1547 qreal dist = qAbs(data.move + pos);-
1548 if (dist > 0) {
dist > 0Description
TRUEevaluated 239 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 168 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
168-239
1549 timeline.reset(data.move);-
1550 if (fixupMode != Immediate) {
fixupMode != ImmediateDescription
TRUEevaluated 145 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_qquicklistview
94-145
1551 timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);-
1552 data.fixingUp = true;-
1553 } else {
executed 145 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
145
1554 timeline.set(data.move, -pos);-
1555 }
executed 94 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
94
1556 vTime = timeline.time();-
1557 }
executed 239 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
239
1558 } else if (currentItem && strictHighlightRange && moveReason != QQuickListViewPrivate::SetIndex) {
executed 407 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
currentItemDescription
TRUEevaluated 6934 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 4212 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
strictHighlightRangeDescription
TRUEevaluated 78 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 6856 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
moveReason != ...vate::SetIndexDescription
TRUEevaluated 76 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-6934
1559 updateHighlight();-
1560 qreal pos = static_cast<FxListItemSG*>(currentItem)->itemPosition();-
1561 if (viewPos < pos + static_cast<FxListItemSG*>(currentItem)->itemSize() - highlightRangeEnd)
viewPos < pos ...hlightRangeEndDescription
TRUEevaluated 64 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
12-64
1562 viewPos = pos + static_cast<FxListItemSG*>(currentItem)->itemSize() - highlightRangeEnd;
executed 64 times by 2 tests: viewPos = pos + static_cast<FxListItemSG*>(currentItem)->itemSize() - highlightRangeEnd;
Executed by:
  • tst_examples
  • tst_qquicklistview
64
1563 if (viewPos > pos - highlightRangeStart)
viewPos > pos ...ightRangeStartDescription
TRUEevaluated 76 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEnever evaluated
0-76
1564 viewPos = pos - highlightRangeStart;
executed 76 times by 2 tests: viewPos = pos - highlightRangeStart;
Executed by:
  • tst_examples
  • tst_qquicklistview
76
1565 if (isContentFlowReversed())
isContentFlowReversed()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 66 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
10-66
1566 viewPos = -viewPos-size();
executed 10 times by 1 test: viewPos = -viewPos-size();
Executed by:
  • tst_qquicklistview
10
1567-
1568 timeline.reset(data.move);-
1569 if (viewPos != position()) {
viewPos != position()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 60 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
16-60
1570 if (fixupMode != Immediate) {
fixupMode != ImmediateDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-14
1571 timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);-
1572 data.fixingUp = true;-
1573 } else {
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
1574 timeline.set(data.move, -viewPos);-
1575 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
14
1576 }-
1577 vTime = timeline.time();-
1578 } else {
executed 76 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
76
1579 QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);-
1580 }
executed 11070 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
11070
1581 data.inOvershoot = false;-
1582 fixupMode = Normal;-
1583}
executed 11553 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
11553
1584-
1585bool QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,-
1586 QQuickTimeLineCallback::Callback fixupCallback, qreal velocity)-
1587{-
1588 data.fixingUp = false;-
1589 moveReason = Mouse;-
1590 if ((!haveHighlightRange || highlightRange != QQuickListView::StrictlyEnforceRange) && snapMode == QQuickListView::NoSnap) {
!haveHighlightRangeDescription
TRUEevaluated 1097 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1002 times by 1 test
Evaluated by:
  • tst_qquicklistview
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEevaluated 1002 times by 1 test
Evaluated by:
  • tst_qquicklistview
snapMode == QQ...stView::NoSnapDescription
TRUEevaluated 51 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1046 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-1097
1591 correctFlick = true;-
1592 return QQuickItemViewPrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
executed 51 times by 1 test: return QQuickItemViewPrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
Executed by:
  • tst_qquicklistview
51
1593 }-
1594 qreal maxDistance = 0;-
1595 qreal dataValue = isContentFlowReversed() ? -data.move.value()+size() : data.move.value();
isContentFlowReversed()Description
TRUEevaluated 1000 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1048 times by 1 test
Evaluated by:
  • tst_qquicklistview
1000-1048
1596-
1597 // -ve velocity means list is moving up/left-
1598 if (velocity > 0) {
velocity > 0Description
TRUEevaluated 1006 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1042 times by 1 test
Evaluated by:
  • tst_qquicklistview
1006-1042
1599 if (data.move.value() < minExtent) {
data.move.value() < minExtentDescription
TRUEevaluated 992 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicklistview
14-992
1600 if (snapMode == QQuickListView::SnapOneItem && !hData.flicking && !vData.flicking) {
snapMode == QQ...w::SnapOneItemDescription
TRUEevaluated 212 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 780 times by 1 test
Evaluated by:
  • tst_qquicklistview
!hData.flickingDescription
TRUEevaluated 130 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicklistview
!vData.flickingDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicklistview
48-780
1601 // if we've been dragged < averageSize/2 then bias towards the next item-
1602 qreal dist = data.move.value() - data.pressPos;-
1603 qreal bias = dist < averageSize/2 ? averageSize/2 : 0;
dist < averageSize/2Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-48
1604 if (isContentFlowReversed())
isContentFlowReversed()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
24
1605 bias = -bias;
executed 24 times by 1 test: bias = -bias;
Executed by:
  • tst_qquicklistview
24
1606 data.flickTarget = -snapPosAt(-(dataValue - highlightRangeStart) - bias) + highlightRangeStart;-
1607 maxDistance = qAbs(data.flickTarget - data.move.value());-
1608 velocity = maxVelocity;-
1609 } else {
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
48
1610 maxDistance = qAbs(minExtent - data.move.value());-
1611 }
executed 944 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
944
1612 }-
1613 if (snapMode == QQuickListView::NoSnap && highlightRange != QQuickListView::StrictlyEnforceRange)
snapMode == QQ...stView::NoSnapDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1002 times by 1 test
Evaluated by:
  • tst_qquicklistview
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-1002
1614 data.flickTarget = minExtent;
never executed: data.flickTarget = minExtent;
0
1615 } else {
executed 1006 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
1006
1616 if (data.move.value() > maxExtent) {
data.move.value() > maxExtentDescription
TRUEevaluated 1026 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
16-1026
1617 if (snapMode == QQuickListView::SnapOneItem && !hData.flicking && !vData.flicking) {
snapMode == QQ...w::SnapOneItemDescription
TRUEevaluated 215 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 811 times by 1 test
Evaluated by:
  • tst_qquicklistview
!hData.flickingDescription
TRUEevaluated 134 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 81 times by 1 test
Evaluated by:
  • tst_qquicklistview
!vData.flickingDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
48-811
1618 // if we've been dragged < averageSize/2 then bias towards the next item-
1619 qreal dist = data.move.value() - data.pressPos;-
1620 qreal bias = -dist < averageSize/2 ? averageSize/2 : 0;
-dist < averageSize/2Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-48
1621 if (isContentFlowReversed())
isContentFlowReversed()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
24
1622 bias = -bias;
executed 24 times by 1 test: bias = -bias;
Executed by:
  • tst_qquicklistview
24
1623 data.flickTarget = -snapPosAt(-(dataValue - highlightRangeStart) + bias) + highlightRangeStart;-
1624 maxDistance = qAbs(data.flickTarget - data.move.value());-
1625 velocity = -maxVelocity;-
1626 } else {
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
48
1627 maxDistance = qAbs(maxExtent - data.move.value());-
1628 }
executed 978 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
978
1629 }-
1630 if (snapMode == QQuickListView::NoSnap && highlightRange != QQuickListView::StrictlyEnforceRange)
snapMode == QQ...stView::NoSnapDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1038 times by 1 test
Evaluated by:
  • tst_qquicklistview
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-1038
1631 data.flickTarget = maxExtent;
never executed: data.flickTarget = maxExtent;
0
1632 }
executed 1042 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
1042
1633 bool overShoot = boundsBehavior & QQuickFlickable::OvershootBounds;-
1634 if (maxDistance > 0 || overShoot) {
maxDistance > 0Description
TRUEevaluated 2018 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicklistview
overShootDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-2018
1635 // These modes require the list to stop exactly on an item boundary.-
1636 // The initial flick will estimate the boundary to stop on.-
1637 // Since list items can have variable sizes, the boundary will be-
1638 // reevaluated and adjusted as we approach the boundary.-
1639 qreal v = velocity;-
1640 if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
maxVelocity != -1Description
TRUEevaluated 2048 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
maxVelocity < qAbs(v)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2045 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-2048
1641 if (v < 0)
v < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qquicklistview
1-2
1642 v = -maxVelocity;
executed 2 times by 1 test: v = -maxVelocity;
Executed by:
  • tst_qquicklistview
2
1643 else-
1644 v = maxVelocity;
executed 1 time by 1 test: v = maxVelocity;
Executed by:
  • tst_qquicklistview
1
1645 }-
1646 if (!hData.flicking && !vData.flicking) {
!hData.flickingDescription
TRUEevaluated 1113 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 935 times by 1 test
Evaluated by:
  • tst_qquicklistview
!vData.flickingDescription
TRUEevaluated 210 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 903 times by 1 test
Evaluated by:
  • tst_qquicklistview
210-1113
1647 // the initial flick - estimate boundary-
1648 qreal accel = deceleration;-
1649 qreal v2 = v * v;-
1650 overshootDist = 0.0;-
1651 // + averageSize/4 to encourage moving at least one item in the flick direction-
1652 qreal dist = v2 / (accel * 2.0) + averageSize/4;-
1653 if (maxDistance > 0)
maxDistance > 0Description
TRUEevaluated 180 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicklistview
30-180
1654 dist = qMin(dist, maxDistance);
executed 180 times by 1 test: dist = qMin(dist, maxDistance);
Executed by:
  • tst_qquicklistview
180
1655 if (v > 0)
v > 0Description
TRUEevaluated 102 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_qquicklistview
102-108
1656 dist = -dist;
executed 102 times by 1 test: dist = -dist;
Executed by:
  • tst_qquicklistview
102
1657 if ((maxDistance > 0.0 && v2 / (2.0f * maxDistance) < accel) || snapMode == QQuickListView::SnapOneItem) {
maxDistance > 0.0Description
TRUEevaluated 180 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicklistview
v2 / (2.0f * m...tance) < accelDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 114 times by 1 test
Evaluated by:
  • tst_qquicklistview
snapMode == QQ...w::SnapOneItemDescription
TRUEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicklistview
30-180
1658 if (snapMode != QQuickListView::SnapOneItem) {
snapMode != QQ...w::SnapOneItemDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquicklistview
66-98
1659 qreal distTemp = isContentFlowReversed() ? -dist : dist;
isContentFlowReversed()Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquicklistview
32-34
1660 data.flickTarget = -snapPosAt(-(dataValue - highlightRangeStart) + distTemp) + highlightRangeStart;-
1661 }
executed 66 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
66
1662 data.flickTarget = isContentFlowReversed() ? -data.flickTarget+size() : data.flickTarget;
isContentFlowReversed()Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicklistview
80-84
1663 if (overShoot) {
overShootDescription
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-164
1664 if (data.flickTarget > minExtent) {
data.flickTarget > minExtentDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquicklistview
10-154
1665 overshootDist = overShootDistance(vSize);-
1666 data.flickTarget += overshootDist;-
1667 } else if (data.flickTarget < maxExtent) {
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
data.flickTarget < maxExtentDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquicklistview
8-146
1668 overshootDist = overShootDistance(vSize);-
1669 data.flickTarget -= overshootDist;-
1670 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
8
1671 }
executed 164 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
164
1672 qreal adjDist = -data.flickTarget + data.move.value();-
1673 if (qAbs(adjDist) > qAbs(dist)) {
qAbs(adjDist) > qAbs(dist)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 149 times by 1 test
Evaluated by:
  • tst_qquicklistview
15-149
1674 // Prevent painfully slow flicking - adjust velocity to suit flickDeceleration-
1675 qreal adjv2 = accel * 2.0f * qAbs(adjDist);-
1676 if (adjv2 > v2) {
adjv2 > v2Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
7-8
1677 v2 = adjv2;-
1678 v = qSqrt(v2);-
1679 if (dist > 0)
dist > 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-5
1680 v = -v;
executed 2 times by 1 test: v = -v;
Executed by:
  • tst_qquicklistview
2
1681 }
executed 7 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
7
1682 }
executed 15 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
15
1683 dist = adjDist;-
1684 accel = v2 / (2.0f * qAbs(dist));-
1685 } else if (overShoot) {
executed 164 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
overShootDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-164
1686 data.flickTarget = data.move.value() - dist;-
1687 if (data.flickTarget > minExtent) {
data.flickTarget > minExtentDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquicklistview
12-34
1688 overshootDist = overShootDistance(vSize);-
1689 data.flickTarget += overshootDist;-
1690 } else if (data.flickTarget < maxExtent) {
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
data.flickTarget < maxExtentDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
12-18
1691 overshootDist = overShootDistance(vSize);-
1692 data.flickTarget -= overshootDist;-
1693 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
16
1694 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
46
1695 timeline.reset(data.move);-
1696 timeline.accel(data.move, v, accel, maxDistance + overshootDist);-
1697 timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this));-
1698 correctFlick = true;-
1699 return true;
executed 210 times by 1 test: return true;
Executed by:
  • tst_qquicklistview
210
1700 } else {-
1701 // reevaluate the target boundary.-
1702 qreal newtarget = data.flickTarget;-
1703 if (snapMode != QQuickListView::NoSnap || highlightRange == QQuickListView::StrictlyEnforceRange) {
snapMode != QQ...stView::NoSnapDescription
TRUEevaluated 1838 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEnever evaluated
0-1838
1704 qreal tempFlickTarget = isContentFlowReversed() ? -data.flickTarget+size() : data.flickTarget;
isContentFlowReversed()Description
TRUEevaluated 904 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 934 times by 1 test
Evaluated by:
  • tst_qquicklistview
904-934
1705 newtarget = -snapPosAt(-(tempFlickTarget - highlightRangeStart)) + highlightRangeStart;-
1706 newtarget = isContentFlowReversed() ? -newtarget+size() : newtarget;
isContentFlowReversed()Description
TRUEevaluated 904 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 934 times by 1 test
Evaluated by:
  • tst_qquicklistview
904-934
1707 }
executed 1838 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
1838
1708 if (velocity < 0 && newtarget <= maxExtent)
velocity < 0Description
TRUEevaluated 934 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 904 times by 1 test
Evaluated by:
  • tst_qquicklistview
newtarget <= maxExtentDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 922 times by 1 test
Evaluated by:
  • tst_qquicklistview
12-934
1709 newtarget = maxExtent - overshootDist;
executed 12 times by 1 test: newtarget = maxExtent - overshootDist;
Executed by:
  • tst_qquicklistview
12
1710 else if (velocity > 0 && newtarget >= minExtent)
velocity > 0Description
TRUEevaluated 904 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 922 times by 1 test
Evaluated by:
  • tst_qquicklistview
newtarget >= minExtentDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 891 times by 1 test
Evaluated by:
  • tst_qquicklistview
13-922
1711 newtarget = minExtent + overshootDist;
executed 13 times by 1 test: newtarget = minExtent + overshootDist;
Executed by:
  • tst_qquicklistview
13
1712 if (newtarget == data.flickTarget) { // boundary unchanged - nothing to do
newtarget == data.flickTargetDescription
TRUEevaluated 1822 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicklistview
16-1822
1713 if (qAbs(velocity) < MinimumFlickVelocity)
qAbs(velocity)...mFlickVelocityDescription
TRUEevaluated 93 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1729 times by 1 test
Evaluated by:
  • tst_qquicklistview
93-1729
1714 correctFlick = false;
executed 93 times by 1 test: correctFlick = false;
Executed by:
  • tst_qquicklistview
93
1715 return false;
executed 1822 times by 1 test: return false;
Executed by:
  • tst_qquicklistview
1822
1716 }-
1717 data.flickTarget = newtarget;-
1718 qreal dist = -newtarget + data.move.value();-
1719 if ((v < 0 && dist < 0) || (v > 0 && dist > 0)) {
v < 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
dist < 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
v > 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
dist > 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-8
1720 correctFlick = false;-
1721 timeline.reset(data.move);-
1722 fixup(data, minExtent, maxExtent);-
1723 return false;
never executed: return false;
0
1724 }-
1725 timeline.reset(data.move);-
1726 timeline.accelDistance(data.move, v, -dist);-
1727 timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this));-
1728 return false;
executed 16 times by 1 test: return false;
Executed by:
  • tst_qquicklistview
16
1729 }-
1730 } else {-
1731 correctFlick = false;-
1732 timeline.reset(data.move);-
1733 fixup(data, minExtent, maxExtent);-
1734 return false;
never executed: return false;
0
1735 }-
1736}-
1737-
1738//-----------------------------------------------------------------------------
1739-
1740/*!-
1741 \qmltype ListView-
1742 \instantiates QQuickListView-
1743 \inqmlmodule QtQuick-
1744 \ingroup qtquick-views-
1745 \inherits Flickable-
1746 \brief Provides a list view of items provided by a model.-
1747-
1748 A ListView displays data from models created from built-in QML types like ListModel-
1749 and XmlListModel, or custom model classes defined in C++ that inherit from-
1750 QAbstractItemModel or QAbstractListModel.-
1751-
1752 A ListView has a \l model, which defines the data to be displayed, and-
1753 a \l delegate, which defines how the data should be displayed. Items in a-
1754 ListView are laid out horizontally or vertically. List views are inherently-
1755 flickable because ListView inherits from \l Flickable.-
1756-
1757 \section1 Example Usage-
1758-
1759 The following example shows the definition of a simple list model defined-
1760 in a file called \c ContactModel.qml:-
1761-
1762 \snippet qml/listview/ContactModel.qml 0-
1763-
1764 Another component can display this model data in a ListView, like this:-
1765-
1766 \snippet qml/listview/listview.qml import-
1767 \codeline-
1768 \snippet qml/listview/listview.qml classdocs simple-
1769-
1770 \image listview-simple.png-
1771-
1772 Here, the ListView creates a \c ContactModel component for its model, and a \l Text item-
1773 for its delegate. The view will create a new \l Text component for each item in the model. Notice-
1774 the delegate is able to access the model's \c name and \c number data directly.-
1775-
1776 An improved list view is shown below. The delegate is visually improved and is moved-
1777 into a separate \c contactDelegate component.-
1778-
1779 \snippet qml/listview/listview.qml classdocs advanced-
1780 \image listview-highlight.png-
1781-
1782 The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property,-
1783 and \c focus is set to \c true to enable keyboard navigation for the list view.-
1784 The list view itself is a focus scope (see \l{Keyboard Focus in Qt Quick} for more details).-
1785-
1786 Delegates are instantiated as needed and may be destroyed at any time.-
1787 They are parented to ListView's \l {Flickable::contentItem}{contentItem}, not to the view itself.-
1788 State should \e never be stored in a delegate.-
1789-
1790 ListView attaches a number of properties to the root item of the delegate, for example-
1791 \c ListView.isCurrentItem. In the following example, the root delegate item can access-
1792 this attached property directly as \c ListView.isCurrentItem, while the child-
1793 \c contactInfo object must refer to this property as \c wrapper.ListView.isCurrentItem.-
1794-
1795 \snippet qml/listview/listview.qml isCurrentItem-
1796-
1797 \note Views do not enable \e clip automatically. If the view-
1798 is not clipped by another item or the screen, it will be necessary-
1799 to set \e {clip: true} in order to have the out of view items clipped-
1800 nicely.-
1801-
1802-
1803 \section1 ListView Layouts-
1804-
1805 The layout of the items in a ListView can be controlled by these properties:-
1806-
1807 \list-
1808 \li \l orientation - controls whether items flow horizontally or vertically.-
1809 This value can be either Qt.Horizontal or Qt.Vertical.-
1810 \li \l layoutDirection - controls the horizontal layout direction for a-
1811 horizontally-oriented view: that is, whether items are laid out from the left side of-
1812 the view to the right, or vice-versa. This value can be either Qt.LeftToRight or Qt.RightToLeft.-
1813 \li \l verticalLayoutDirection - controls the vertical layout direction for a vertically-oriented-
1814 view: that is, whether items are laid out from the top of the view down towards the bottom of-
1815 the view, or vice-versa. This value can be either ListView.TopToBottom or ListView.BottomToTop.-
1816 \endlist-
1817-
1818 By default, a ListView has a vertical orientation, and items are laid out from top to bottom. The-
1819 table below shows the different layouts that a ListView can have, depending on the values of-
1820 the properties listed above.-
1821-
1822 \table-
1823 \header-
1824 \li {2, 1}-
1825 \b ListViews with Qt.Vertical orientation-
1826 \row-
1827 \li Top to bottom-
1828 \image listview-layout-toptobottom.png-
1829 \li Bottom to top-
1830 \image listview-layout-bottomtotop.png-
1831 \header-
1832 \li {2, 1}-
1833 \b ListViews with Qt.Horizontal orientation-
1834 \row-
1835 \li Left to right-
1836 \image listview-layout-lefttoright.png-
1837 \li Right to left-
1838 \image listview-layout-righttoleft.png-
1839 \endtable-
1840-
1841 \section1 Flickable Direction-
1842-
1843 By default, a vertical ListView sets \l {Flickable::}{flickableDirection} to \e Flickable.Vertical,-
1844 and a horizontal ListView sets it to \e Flickable.Horizontal. Furthermore, a vertical ListView only-
1845 calculates (estimates) the \l {Flickable::}{contentHeight}, and a horizontal ListView only calculates-
1846 the \l {Flickable::}{contentWidth}. The other dimension is set to \e -1.-
1847-
1848 Since Qt 5.9 (Qt Quick 2.9), it is possible to make a ListView that can be flicked to both directions.-
1849 In order to do this, the \l {Flickable::}{flickableDirection} can be set to \e Flickable.AutoFlickDirection-
1850 or \e Flickable.AutoFlickIfNeeded, and the desired \e contentWidth or \e contentHeight must be provided.-
1851-
1852 \snippet qml/listview/listview.qml flickBothDirections-
1853-
1854 \section1 Stacking Order in ListView-
1855-
1856 The \l {QQuickItem::z}{Z value} of items determines whether they are-
1857 rendered above or below other items. ListView uses several different-
1858 default Z values, depending on what type of item is being created:-
1859-
1860 \table-
1861 \header-
1862 \li Property-
1863 \li Default Z value-
1864 \row-
1865 \li \l delegate-
1866 \li 1-
1867 \row-
1868 \li \l footer-
1869 \li 1-
1870 \row-
1871 \li \l header-
1872 \li 1-
1873 \row-
1874 \li \l highlight-
1875 \li 0-
1876 \row-
1877 \li \l section.delegate-
1878 \li 2-
1879 \endtable-
1880-
1881 These default values are set if the Z value of the item is \c 0, so setting-
1882 the Z value of these items to \c 0 has no effect. Note that the Z value is-
1883 of type \l [QML] {real}, so it is possible to set fractional-
1884 values like \c 0.1.-
1885-
1886 \sa {QML Data Models}, GridView, PathView, {Qt Quick Examples - Views}-
1887*/-
1888QQuickListView::QQuickListView(QQuickItem *parent)-
1889 : QQuickItemView(*(new QQuickListViewPrivate), parent)-
1890{-
1891}
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
1892-
1893QQuickListView::~QQuickListView()-
1894{-
1895}-
1896-
1897/*!-
1898 \qmlattachedproperty bool QtQuick::ListView::isCurrentItem-
1899 This attached property is true if this delegate is the current item; otherwise false.-
1900-
1901 It is attached to each instance of the delegate.-
1902-
1903 This property may be used to adjust the appearance of the current item, for example:-
1904-
1905 \snippet qml/listview/listview.qml isCurrentItem-
1906*/-
1907-
1908/*!-
1909 \qmlattachedproperty ListView QtQuick::ListView::view-
1910 This attached property holds the view that manages this delegate instance.-
1911-
1912 It is attached to each instance of the delegate and also to the header, the footer,-
1913 the section and the highlight delegates.-
1914*/-
1915-
1916/*!-
1917 \qmlattachedproperty string QtQuick::ListView::previousSection-
1918 This attached property holds the section of the previous element.-
1919-
1920 It is attached to each instance of the delegate.-
1921-
1922 The section is evaluated using the \l {ListView::section.property}{section} properties.-
1923*/-
1924-
1925/*!-
1926 \qmlattachedproperty string QtQuick::ListView::nextSection-
1927 This attached property holds the section of the next element.-
1928-
1929 It is attached to each instance of the delegate.-
1930-
1931 The section is evaluated using the \l {ListView::section.property}{section} properties.-
1932*/-
1933-
1934/*!-
1935 \qmlattachedproperty string QtQuick::ListView::section-
1936 This attached property holds the section of this element.-
1937-
1938 It is attached to each instance of the delegate.-
1939-
1940 The section is evaluated using the \l {ListView::section.property}{section} properties.-
1941*/-
1942-
1943/*!-
1944 \qmlattachedproperty bool QtQuick::ListView::delayRemove-
1945-
1946 This attached property holds whether the delegate may be destroyed. It-
1947 is attached to each instance of the delegate. The default value is false.-
1948-
1949 It is sometimes necessary to delay the destruction of an item-
1950 until an animation completes. The example delegate below ensures that the-
1951 animation completes before the item is removed from the list.-
1952-
1953 \snippet qml/listview/listview.qml delayRemove-
1954-
1955 If a \l remove transition has been specified, it will not be applied until-
1956 delayRemove is returned to \c false.-
1957*/-
1958-
1959/*!-
1960 \qmlattachedsignal QtQuick::ListView::add()-
1961 This attached signal is emitted immediately after an item is added to the view.-
1962-
1963 If an \l add transition is specified, it is applied immediately after-
1964 this signal is handled.-
1965-
1966 The corresponding handler is \c onAdd.-
1967*/-
1968-
1969/*!-
1970 \qmlattachedsignal QtQuick::ListView::remove()-
1971 This attached signal is emitted immediately before an item is removed from the view.-
1972-
1973 If a \l remove transition has been specified, it is applied after-
1974 this signal is handled, providing that \l delayRemove is false.-
1975-
1976 The corresponding handler is \c onRemove.-
1977*/-
1978-
1979/*!-
1980 \qmlproperty model QtQuick::ListView::model-
1981 This property holds the model providing data for the list.-
1982-
1983 The model provides the set of data that is used to create the items-
1984 in the view. Models can be created directly in QML using \l ListModel, \l XmlListModel-
1985 or \l VisualItemModel, or provided by C++ model classes. If a C++ model class is-
1986 used, it must be a subclass of \l QAbstractItemModel or a simple list.-
1987-
1988 \sa {qml-data-models}{Data Models}-
1989*/-
1990-
1991/*!-
1992 \qmlproperty Component QtQuick::ListView::delegate-
1993-
1994 The delegate provides a template defining each item instantiated by the view.-
1995 The index is exposed as an accessible \c index property. Properties of the-
1996 model are also available depending upon the type of \l {qml-data-models}{Data Model}.-
1997-
1998 The number of objects and bindings in the delegate has a direct effect on the-
1999 flicking performance of the view. If at all possible, place functionality-
2000 that is not needed for the normal display of the delegate in a \l Loader which-
2001 can load additional components when needed.-
2002-
2003 The ListView will lay out the items based on the size of the root item-
2004 in the delegate.-
2005-
2006 It is recommended that the delegate's size be a whole number to avoid sub-pixel-
2007 alignment of items.-
2008-
2009 The default \l {QQuickItem::z}{stacking order} of delegate instances is \c 1.-
2010-
2011 \note Delegates are instantiated as needed and may be destroyed at any time.-
2012 They are parented to ListView's \l {Flickable::contentItem}{contentItem}, not to the view itself.-
2013 State should \e never be stored in a delegate.-
2014-
2015 \sa {Stacking Order in ListView}-
2016*/-
2017/*!-
2018 \qmlproperty int QtQuick::ListView::currentIndex-
2019 \qmlproperty Item QtQuick::ListView::currentItem-
2020-
2021 The \c currentIndex property holds the index of the current item, and-
2022 \c currentItem holds the current item. Setting the currentIndex to -1-
2023 will clear the highlight and set currentItem to null.-
2024-
2025 If highlightFollowsCurrentItem is \c true, setting either of these-
2026 properties will smoothly scroll the ListView so that the current-
2027 item becomes visible.-
2028-
2029 Note that the position of the current item-
2030 may only be approximate until it becomes visible in the view.-
2031*/-
2032-
2033/*!-
2034 \qmlproperty Item QtQuick::ListView::highlightItem-
2035-
2036 This holds the highlight item created from the \l highlight component.-
2037-
2038 The \c highlightItem is managed by the view unless-
2039 \l highlightFollowsCurrentItem is set to false.-
2040 The default \l {QQuickItem::z}{stacking order}-
2041 of the highlight item is \c 0.-
2042-
2043 \sa highlight, highlightFollowsCurrentItem, {Stacking Order in ListView}-
2044*/-
2045-
2046/*!-
2047 \qmlproperty int QtQuick::ListView::count-
2048 This property holds the number of items in the view.-
2049*/-
2050-
2051/*!-
2052 \qmlproperty Component QtQuick::ListView::highlight-
2053 This property holds the component to use as the highlight.-
2054-
2055 An instance of the highlight component is created for each list.-
2056 The geometry of the resulting component instance is managed by the list-
2057 so as to stay with the current item, unless the highlightFollowsCurrentItem-
2058 property is false. The default \l {QQuickItem::z}{stacking order} of the-
2059 highlight item is \c 0.-
2060-
2061 \sa highlightItem, highlightFollowsCurrentItem,-
2062 {Qt Quick Examples - Views#Highlight}{ListView highlight example},-
2063 {Stacking Order in ListView}-
2064*/-
2065-
2066/*!-
2067 \qmlproperty bool QtQuick::ListView::highlightFollowsCurrentItem-
2068 This property holds whether the highlight is managed by the view.-
2069-
2070 If this property is true (the default value), the highlight is moved smoothly-
2071 to follow the current item. Otherwise, the-
2072 highlight is not moved by the view, and any movement must be implemented-
2073 by the highlight.-
2074-
2075 Here is a highlight with its motion defined by a \l {SpringAnimation} item:-
2076-
2077 \snippet qml/listview/listview.qml highlightFollowsCurrentItem-
2078-
2079 Note that the highlight animation also affects the way that the view-
2080 is scrolled. This is because the view moves to maintain the-
2081 highlight within the preferred highlight range (or visible viewport).-
2082-
2083 \sa highlight, highlightMoveVelocity-
2084*/-
2085//###Possibly rename these properties, since they are very useful even without a highlight?-
2086/*!-
2087 \qmlproperty real QtQuick::ListView::preferredHighlightBegin-
2088 \qmlproperty real QtQuick::ListView::preferredHighlightEnd-
2089 \qmlproperty enumeration QtQuick::ListView::highlightRangeMode-
2090-
2091 These properties define the preferred range of the highlight (for the current item)-
2092 within the view. The \c preferredHighlightBegin value must be less than the-
2093 \c preferredHighlightEnd value.-
2094-
2095 These properties affect the position of the current item when the list is scrolled.-
2096 For example, if the currently selected item should stay in the middle of the-
2097 list when the view is scrolled, set the \c preferredHighlightBegin and-
2098 \c preferredHighlightEnd values to the top and bottom coordinates of where the middle-
2099 item would be. If the \c currentItem is changed programmatically, the list will-
2100 automatically scroll so that the current item is in the middle of the view.-
2101 Furthermore, the behavior of the current item index will occur whether or not a-
2102 highlight exists.-
2103-
2104 Valid values for \c highlightRangeMode are:-
2105-
2106 \list-
2107 \li ListView.ApplyRange - the view attempts to maintain the highlight within the range.-
2108 However, the highlight can move outside of the range at the ends of the list or due-
2109 to mouse interaction.-
2110 \li ListView.StrictlyEnforceRange - the highlight never moves outside of the range.-
2111 The current item changes if a keyboard or mouse action would cause the highlight to move-
2112 outside of the range.-
2113 \li ListView.NoHighlightRange - this is the default value.-
2114 \endlist-
2115*/-
2116void QQuickListView::setHighlightFollowsCurrentItem(bool autoHighlight)-
2117{-
2118 Q_D(QQuickListView);-
2119 if (d->autoHighlight != autoHighlight) {
d->autoHighlig... autoHighlightDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
10-12
2120 if (!autoHighlight) {
!autoHighlightDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEnever evaluated
0-12
2121 if (d->highlightPosAnimator)
d->highlightPosAnimatorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
4-8
2122 d->highlightPosAnimator->stop();
executed 4 times by 1 test: d->highlightPosAnimator->stop();
Executed by:
  • tst_qquicklistview
4
2123 if (d->highlightWidthAnimator)
d->highlightWidthAnimatorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
4-8
2124 d->highlightWidthAnimator->stop();
executed 4 times by 1 test: d->highlightWidthAnimator->stop();
Executed by:
  • tst_qquicklistview
4
2125 if (d->highlightHeightAnimator)
d->highlightHeightAnimatorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
4-8
2126 d->highlightHeightAnimator->stop();
executed 4 times by 1 test: d->highlightHeightAnimator->stop();
Executed by:
  • tst_qquicklistview
4
2127 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
12
2128 QQuickItemView::setHighlightFollowsCurrentItem(autoHighlight);-
2129 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
12
2130}
executed 22 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
22
2131-
2132/*!-
2133 \qmlproperty real QtQuick::ListView::spacing-
2134-
2135 This property holds the spacing between items.-
2136-
2137 The default value is 0.-
2138*/-
2139qreal QQuickListView::spacing() const-
2140{-
2141 Q_D(const QQuickListView);-
2142 return d->spacing;
executed 8 times by 1 test: return d->spacing;
Executed by:
  • tst_qquicklistview
8
2143}-
2144-
2145void QQuickListView::setSpacing(qreal spacing)-
2146{-
2147 Q_D(QQuickListView);-
2148 if (spacing != d->spacing) {
spacing != d->spacingDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEnever evaluated
0-22
2149 d->spacing = spacing;-
2150 d->forceLayoutPolish();-
2151 emit spacingChanged();-
2152 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
22
2153}
executed 22 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
22
2154-
2155/*!-
2156 \qmlproperty enumeration QtQuick::ListView::orientation-
2157 This property holds the orientation of the list.-
2158-
2159 Possible values:-
2160-
2161 \list-
2162 \li ListView.Horizontal - Items are laid out horizontally-
2163 \li ListView.Vertical (default) - Items are laid out vertically-
2164 \endlist-
2165-
2166 \table-
2167 \row-
2168 \li Horizontal orientation:-
2169 \image ListViewHorizontal.png-
2170-
2171 \row-
2172 \li Vertical orientation:-
2173 \image listview-highlight.png-
2174 \endtable-
2175-
2176 \sa {Flickable Direction}-
2177*/-
2178QQuickListView::Orientation QQuickListView::orientation() const-
2179{-
2180 Q_D(const QQuickListView);-
2181 return d->orient;
executed 982477 times by 10 tests: return d->orient;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
982477
2182}-
2183-
2184void QQuickListView::setOrientation(QQuickListView::Orientation orientation)-
2185{-
2186 Q_D(QQuickListView);-
2187 if (d->orient != orientation) {
d->orient != orientationDescription
TRUEevaluated 194 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 136 times by 1 test
Evaluated by:
  • tst_qquicklistview
136-194
2188 d->orient = orientation;-
2189 if (d->orient == Vertical) {
d->orient == VerticalDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 170 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
24-170
2190 if (d->flickableDirection == HorizontalFlick) {
d->flickableDi...orizontalFlickDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-24
2191 setFlickableDirection(VerticalFlick);-
2192 if (isComponentComplete())
isComponentComplete()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-24
2193 setContentWidth(-1);
executed 24 times by 1 test: setContentWidth(-1);
Executed by:
  • tst_qquicklistview
24
2194 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
24
2195 setContentX(0);-
2196 } else {
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
24
2197 if (d->flickableDirection == VerticalFlick) {
d->flickableDi... VerticalFlickDescription
TRUEevaluated 168 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-168
2198 setFlickableDirection(HorizontalFlick);-
2199 if (isComponentComplete())
isComponentComplete()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 148 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
20-148
2200 setContentHeight(-1);
executed 20 times by 1 test: setContentHeight(-1);
Executed by:
  • tst_qquicklistview
20
2201 }
executed 168 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
168
2202 setContentY(0);-
2203 }
executed 170 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
170
2204 d->regenerate(true);-
2205 emit orientationChanged();-
2206 }
executed 194 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
194
2207}
executed 330 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
330
2208-
2209/*!-
2210 \qmlproperty enumeration QtQuick::ListView::layoutDirection-
2211 This property holds the layout direction of a horizontally-oriented list.-
2212-
2213 Possible values:-
2214-
2215 \list-
2216 \li Qt.LeftToRight (default) - Items will be laid out from left to right.-
2217 \li Qt.RightToLeft - Items will be laid out from right to let.-
2218 \endlist-
2219-
2220 Setting this property has no effect if the \l orientation is Qt.Vertical.-
2221-
2222 \sa ListView::effectiveLayoutDirection, ListView::verticalLayoutDirection-
2223*/-
2224-
2225-
2226/*!-
2227 \qmlproperty enumeration QtQuick::ListView::effectiveLayoutDirection-
2228 This property holds the effective layout direction of a horizontally-oriented list.-
2229-
2230 When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,-
2231 the visual layout direction of the horizontal list will be mirrored. However, the-
2232 property \l {ListView::layoutDirection}{layoutDirection} will remain unchanged.-
2233-
2234 \sa ListView::layoutDirection, {LayoutMirroring}{LayoutMirroring}-
2235*/-
2236-
2237-
2238/*!-
2239 \qmlproperty enumeration QtQuick::ListView::verticalLayoutDirection-
2240 This property holds the layout direction of a vertically-oriented list.-
2241-
2242 Possible values:-
2243-
2244 \list-
2245 \li ListView.TopToBottom (default) - Items are laid out from the top of the view down to the bottom of the view.-
2246 \li ListView.BottomToTop - Items are laid out from the bottom of the view up to the top of the view.-
2247 \endlist-
2248-
2249 Setting this property has no effect if the \l orientation is Qt.Horizontal.-
2250-
2251 \sa ListView::layoutDirection-
2252*/-
2253-
2254-
2255/*!-
2256 \qmlproperty bool QtQuick::ListView::keyNavigationWraps-
2257 This property holds whether the list wraps key navigation.-
2258-
2259 If this is true, key navigation that would move the current item selection-
2260 past the end of the list instead wraps around and moves the selection to-
2261 the start of the list, and vice-versa.-
2262-
2263 By default, key navigation is not wrapped.-
2264*/-
2265-
2266/*!-
2267 \qmlproperty bool QtQuick::ListView::keyNavigationEnabled-
2268 \since 5.7-
2269-
2270 This property holds whether the key navigation of the list is enabled.-
2271-
2272 If this is \c true, the user can navigate the view with a keyboard.-
2273 It is useful for applications that need to selectively enable or-
2274 disable mouse and keyboard interaction.-
2275-
2276 By default, the value of this property is bound to-
2277 \l {Flickable::}{interactive} to ensure behavior compatibility for-
2278 existing applications. When explicitly set, it will cease to be bound to-
2279 the interactive property.-
2280-
2281 \sa {Flickable::}{interactive}-
2282*/-
2283-
2284-
2285/*!-
2286 \qmlproperty int QtQuick::ListView::cacheBuffer-
2287 This property determines whether delegates are retained outside the-
2288 visible area of the view.-
2289-
2290 If this value is greater than zero, the view may keep as many delegates-
2291 instantiated as it can fit within the buffer specified. For example,-
2292 if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is-
2293 set to 40, then up to 2 delegates above and 2 delegates below the visible-
2294 area may be created/retained. The buffered delegates are created asynchronously,-
2295 allowing creation to occur across multiple frames and reducing the-
2296 likelihood of skipping frames. In order to improve painting performance-
2297 delegates outside the visible area are not painted.-
2298-
2299 The default value of this property is platform dependent, but will usually-
2300 be a value greater than zero. Negative values are ignored.-
2301-
2302 Note that cacheBuffer is not a pixel buffer - it only maintains additional-
2303 instantiated delegates.-
2304-
2305 \note Setting this property is not a replacement for creating efficient delegates.-
2306 It can improve the smoothness of scrolling behavior at the expense of additional-
2307 memory usage. The fewer objects and bindings in a delegate, the faster a-
2308 view can be scrolled. It is important to realize that setting a cacheBuffer-
2309 will only postpone issues caused by slow-loading delegates, it is not a-
2310 solution for this scenario.-
2311-
2312 The cacheBuffer operates outside of any display margins specified by-
2313 displayMarginBeginning or displayMarginEnd.-
2314*/-
2315-
2316/*!-
2317 \qmlproperty int QtQuick::ListView::displayMarginBeginning-
2318 \qmlproperty int QtQuick::ListView::displayMarginEnd-
2319 \since QtQuick 2.3-
2320-
2321 This property allows delegates to be displayed outside of the view geometry.-
2322-
2323 If this value is non-zero, the view will create extra delegates before the-
2324 start of the view, or after the end. The view will create as many delegates-
2325 as it can fit into the pixel size specified.-
2326-
2327 For example, if in a vertical view the delegate is 20 pixels high and-
2328 \c displayMarginBeginning and \c displayMarginEnd are both set to 40,-
2329 then 2 delegates above and 2 delegates below will be created and shown.-
2330-
2331 The default value is 0.-
2332-
2333 This property is meant for allowing certain UI configurations,-
2334 and not as a performance optimization. If you wish to create delegates-
2335 outside of the view geometry for performance reasons, you probably-
2336 want to use the cacheBuffer property instead.-
2337*/-
2338-
2339/*!-
2340 \qmlpropertygroup QtQuick::ListView::section-
2341 \qmlproperty string QtQuick::ListView::section.property-
2342 \qmlproperty enumeration QtQuick::ListView::section.criteria-
2343 \qmlproperty Component QtQuick::ListView::section.delegate-
2344 \qmlproperty enumeration QtQuick::ListView::section.labelPositioning-
2345-
2346 These properties determine the expression to be evaluated and appearance-
2347 of the section labels.-
2348-
2349 \c section.property holds the name of the property that is the basis-
2350 of each section.-
2351-
2352 \c section.criteria holds the criteria for forming each section based on-
2353 \c section.property. This value can be one of:-
2354-
2355 \list-
2356 \li ViewSection.FullString (default) - sections are created based on the-
2357 \c section.property value.-
2358 \li ViewSection.FirstCharacter - sections are created based on the first-
2359 character of the \c section.property value (for example, 'A', 'B', 'C'-
2360 sections, etc. for an address book)-
2361 \endlist-
2362-
2363 A case insensitive comparison is used when determining section-
2364 boundaries.-
2365-
2366 \c section.delegate holds the delegate component for each section. The-
2367 default \l {QQuickItem::z}{stacking order} of section delegate instances-
2368 is \c 2.-
2369-
2370 \c section.labelPositioning determines whether the current and/or-
2371 next section labels stick to the start/end of the view, and whether-
2372 the labels are shown inline. This value can be a combination of:-
2373-
2374 \list-
2375 \li ViewSection.InlineLabels - section labels are shown inline between-
2376 the item delegates separating sections (default).-
2377 \li ViewSection.CurrentLabelAtStart - the current section label sticks to the-
2378 start of the view as it is moved.-
2379 \li ViewSection.NextLabelAtEnd - the next section label (beyond all visible-
2380 sections) sticks to the end of the view as it is moved. \note Enabling-
2381 \c ViewSection.NextLabelAtEnd requires the view to scan ahead for the next-
2382 section, which has performance implications, especially for slower models.-
2383 \endlist-
2384-
2385 Each item in the list has attached properties named \c ListView.section,-
2386 \c ListView.previousSection and \c ListView.nextSection.-
2387-
2388 For example, here is a ListView that displays a list of animals, separated-
2389 into sections. Each item in the ListView is placed in a different section-
2390 depending on the "size" property of the model item. The \c sectionHeading-
2391 delegate component provides the light blue bar that marks the beginning of-
2392 each section.-
2393-
2394-
2395 \snippet views/listview/sections.qml 0-
2396-
2397 \image qml-listview-sections-example.png-
2398-
2399 \note Adding sections to a ListView does not automatically re-order the-
2400 list items by the section criteria.-
2401 If the model is not ordered by section, then it is possible that-
2402 the sections created will not be unique; each boundary between-
2403 differing sections will result in a section header being created-
2404 even if that section exists elsewhere.-
2405-
2406 \sa {Qt Quick Examples - Views}{ListView examples},-
2407 {Stacking Order in ListView}-
2408*/-
2409QQuickViewSection *QQuickListView::sectionCriteria()-
2410{-
2411 Q_D(QQuickListView);-
2412 if (!d->sectionCriteria)
!d->sectionCriteriaDescription
TRUEevaluated 46 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
6-46
2413 d->sectionCriteria = new QQuickViewSection(this);
executed 46 times by 4 tests: d->sectionCriteria = new QQuickViewSection(this);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
46
2414 return d->sectionCriteria;
executed 52 times by 4 tests: return d->sectionCriteria;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
52
2415}-
2416-
2417/*!-
2418 \qmlproperty string QtQuick::ListView::currentSection-
2419 This property holds the section that is currently at the beginning of the view.-
2420*/-
2421QString QQuickListView::currentSection() const-
2422{-
2423 Q_D(const QQuickListView);-
2424 return d->currentSection;
executed 56 times by 1 test: return d->currentSection;
Executed by:
  • tst_qquicklistview
56
2425}-
2426-
2427/*!-
2428 \qmlproperty real QtQuick::ListView::highlightMoveVelocity-
2429 \qmlproperty int QtQuick::ListView::highlightMoveDuration-
2430 \qmlproperty real QtQuick::ListView::highlightResizeVelocity-
2431 \qmlproperty int QtQuick::ListView::highlightResizeDuration-
2432-
2433 These properties control the speed of the move and resize animations for the-
2434 highlight delegate.-
2435-
2436 \l highlightFollowsCurrentItem must be true for these properties-
2437 to have effect.-
2438-
2439 The default value for the velocity properties is 400 pixels/second.-
2440 The default value for the duration properties is -1, i.e. the-
2441 highlight will take as much time as necessary to move at the set speed.-
2442-
2443 These properties have the same characteristics as a SmoothedAnimation.-
2444-
2445 \sa highlightFollowsCurrentItem-
2446*/-
2447qreal QQuickListView::highlightMoveVelocity() const-
2448{-
2449 Q_D(const QQuickListView);-
2450 return d->highlightMoveVelocity;
executed 16 times by 1 test: return d->highlightMoveVelocity;
Executed by:
  • tst_qquicklistview
16
2451}-
2452-
2453void QQuickListView::setHighlightMoveVelocity(qreal speed)-
2454{-
2455 Q_D(QQuickListView);-
2456 if (d->highlightMoveVelocity != speed) {
d->highlightMo...ocity != speedDescription
TRUEevaluated 582 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicklistview
6-582
2457 d->highlightMoveVelocity = speed;-
2458 if (d->highlightPosAnimator)
d->highlightPosAnimatorDescription
TRUEnever evaluated
FALSEevaluated 582 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-582
2459 d->highlightPosAnimator->velocity = d->highlightMoveVelocity;
never executed: d->highlightPosAnimator->velocity = d->highlightMoveVelocity;
0
2460 emit highlightMoveVelocityChanged();-
2461 }
executed 582 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
582
2462}
executed 588 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
588
2463-
2464void QQuickListView::setHighlightMoveDuration(int duration)-
2465{-
2466 Q_D(QQuickListView);-
2467 if (d->highlightMoveDuration != duration) {
d->highlightMo...on != durationDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-6
2468 if (d->highlightPosAnimator)
d->highlightPosAnimatorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-2
2469 d->highlightPosAnimator->userDuration = duration;
executed 2 times by 1 test: d->highlightPosAnimator->userDuration = duration;
Executed by:
  • tst_qquicklistview
2
2470 QQuickItemView::setHighlightMoveDuration(duration);-
2471 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
2472}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
8
2473-
2474qreal QQuickListView::highlightResizeVelocity() const-
2475{-
2476 Q_D(const QQuickListView);-
2477 return d->highlightResizeVelocity;
executed 16 times by 1 test: return d->highlightResizeVelocity;
Executed by:
  • tst_qquicklistview
16
2478}-
2479-
2480void QQuickListView::setHighlightResizeVelocity(qreal speed)-
2481{-
2482 Q_D(QQuickListView);-
2483 if (d->highlightResizeVelocity != speed) {
d->highlightRe...ocity != speedDescription
TRUEevaluated 566 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-566
2484 d->highlightResizeVelocity = speed;-
2485 if (d->highlightWidthAnimator)
d->highlightWidthAnimatorDescription
TRUEnever evaluated
FALSEevaluated 566 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-566
2486 d->highlightWidthAnimator->velocity = d->highlightResizeVelocity;
never executed: d->highlightWidthAnimator->velocity = d->highlightResizeVelocity;
0
2487 if (d->highlightHeightAnimator)
d->highlightHeightAnimatorDescription
TRUEnever evaluated
FALSEevaluated 566 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-566
2488 d->highlightHeightAnimator->velocity = d->highlightResizeVelocity;
never executed: d->highlightHeightAnimator->velocity = d->highlightResizeVelocity;
0
2489 emit highlightResizeVelocityChanged();-
2490 }
executed 566 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
566
2491}
executed 566 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
566
2492-
2493int QQuickListView::highlightResizeDuration() const-
2494{-
2495 Q_D(const QQuickListView);-
2496 return d->highlightResizeDuration;
never executed: return d->highlightResizeDuration;
0
2497}-
2498-
2499void QQuickListView::setHighlightResizeDuration(int duration)-
2500{-
2501 Q_D(QQuickListView);-
2502 if (d->highlightResizeDuration != duration) {
d->highlightRe...on != durationDescription
TRUEnever evaluated
FALSEnever evaluated
0
2503 d->highlightResizeDuration = duration;-
2504 if (d->highlightWidthAnimator)
d->highlightWidthAnimatorDescription
TRUEnever evaluated
FALSEnever evaluated
0
2505 d->highlightWidthAnimator->userDuration = d->highlightResizeDuration;
never executed: d->highlightWidthAnimator->userDuration = d->highlightResizeDuration;
0
2506 if (d->highlightHeightAnimator)
d->highlightHeightAnimatorDescription
TRUEnever evaluated
FALSEnever evaluated
0
2507 d->highlightHeightAnimator->userDuration = d->highlightResizeDuration;
never executed: d->highlightHeightAnimator->userDuration = d->highlightResizeDuration;
0
2508 emit highlightResizeDurationChanged();-
2509 }
never executed: end of block
0
2510}
never executed: end of block
0
2511-
2512/*!-
2513 \qmlproperty enumeration QtQuick::ListView::snapMode-
2514-
2515 This property determines how the view scrolling will settle following a drag or flick.-
2516 The possible values are:-
2517-
2518 \list-
2519 \li ListView.NoSnap (default) - the view stops anywhere within the visible area.-
2520 \li ListView.SnapToItem - the view settles with an item aligned with the start of-
2521 the view.-
2522 \li ListView.SnapOneItem - the view settles no more than one item away from the first-
2523 visible item at the time the mouse button is released. This mode is particularly-
2524 useful for moving one page at a time.-
2525 \endlist-
2526-
2527 \c snapMode does not affect the \l currentIndex. To update the-
2528 \l currentIndex as the list is moved, set \l highlightRangeMode-
2529 to \c ListView.StrictlyEnforceRange.-
2530-
2531 \sa highlightRangeMode-
2532*/-
2533QQuickListView::SnapMode QQuickListView::snapMode() const-
2534{-
2535 Q_D(const QQuickListView);-
2536 return d->snapMode;
executed 16 times by 1 test: return d->snapMode;
Executed by:
  • tst_qquicklistview
16
2537}-
2538-
2539void QQuickListView::setSnapMode(SnapMode mode)-
2540{-
2541 Q_D(QQuickListView);-
2542 if (d->snapMode != mode) {
d->snapMode != modeDescription
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-88
2543 d->snapMode = mode;-
2544 emit snapModeChanged();-
2545 d->fixupPosition();-
2546 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
88
2547}
executed 92 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
92
2548-
2549-
2550/*!-
2551 \qmlproperty Component QtQuick::ListView::footer-
2552 This property holds the component to use as the footer.-
2553-
2554 An instance of the footer component is created for each view. The-
2555 footer is positioned at the end of the view, after any items. The-
2556 default \l {QQuickItem::z}{stacking order} of the footer is \c 1.-
2557-
2558 \sa header, footerItem, {Stacking Order in ListView}-
2559*/-
2560-
2561-
2562/*!-
2563 \qmlproperty Component QtQuick::ListView::header-
2564 This property holds the component to use as the header.-
2565-
2566 An instance of the header component is created for each view. The-
2567 header is positioned at the beginning of the view, before any items.-
2568 The default \l {QQuickItem::z}{stacking order} of the header is \c 1.-
2569-
2570 \sa footer, headerItem, {Stacking Order in ListView}-
2571*/-
2572-
2573/*!-
2574 \qmlproperty Item QtQuick::ListView::headerItem-
2575 This holds the header item created from the \l header component.-
2576-
2577 An instance of the header component is created for each view. The-
2578 header is positioned at the beginning of the view, before any items.-
2579 The default \l {QQuickItem::z}{stacking order} of the header is \c 1.-
2580-
2581 \sa header, footerItem, {Stacking Order in ListView}-
2582*/-
2583-
2584/*!-
2585 \qmlproperty Item QtQuick::ListView::footerItem-
2586 This holds the footer item created from the \l footer component.-
2587-
2588 An instance of the footer component is created for each view. The-
2589 footer is positioned at the end of the view, after any items. The-
2590 default \l {QQuickItem::z}{stacking order} of the footer is \c 1.-
2591-
2592 \sa footer, headerItem, {Stacking Order in ListView}-
2593*/-
2594-
2595/*!-
2596 \qmlproperty enumeration QtQuick::ListView::headerPositioning-
2597 \since Qt 5.4-
2598-
2599 This property determines the positioning of the \l{headerItem}{header item}.-
2600-
2601 The possible values are:-
2602 \list-
2603 \li ListView.InlineHeader (default) - the header is positioned in the beginning-
2604 of the content and moves together with the content like an ordinary item.-
2605 \li ListView.OverlayHeader - the header is positioned in the beginning of the view.-
2606 \li ListView.PullBackHeader - the header is positioned in the beginning of the view.-
2607 The header can be pushed away by moving the content forwards, and pulled back by-
2608 moving the content backwards.-
2609 \endlist-
2610-
2611 \note This property has no effect on the \l {QQuickItem::z}{stacking order}-
2612 of the header. For example, if the header should be shown above the-
2613 \l delegate items when using \c ListView.OverlayHeader, its Z value-
2614 should be set to a value higher than that of the delegates. For more-
2615 information, see \l {Stacking Order in ListView}.-
2616*/-
2617QQuickListView::HeaderPositioning QQuickListView::headerPositioning() const-
2618{-
2619 Q_D(const QQuickListView);-
2620 return d->headerPositioning;
never executed: return d->headerPositioning;
0
2621}-
2622-
2623void QQuickListView::setHeaderPositioning(QQuickListView::HeaderPositioning positioning)-
2624{-
2625 Q_D(QQuickListView);-
2626 if (d->headerPositioning != positioning) {
d->headerPosit...!= positioningDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-86
2627 d->applyPendingChanges();-
2628 d->headerPositioning = positioning;-
2629 if (isComponentComplete()) {
isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
2630 d->updateHeader();-
2631 d->updateViewport();-
2632 d->fixupPosition();-
2633 }
never executed: end of block
0
2634 emit headerPositioningChanged();-
2635 }
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
86
2636}
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
86
2637-
2638/*!-
2639 \qmlproperty enumeration QtQuick::ListView::footerPositioning-
2640 \since Qt 5.4-
2641-
2642 This property determines the positioning of the \l{footerItem}{footer item}.-
2643-
2644 The possible values are:-
2645 \list-
2646 \li ListView.InlineFooter (default) - the footer is positioned in the end-
2647 of the content and moves together with the content like an ordinary item.-
2648 \li ListView.OverlayFooter - the footer is positioned in the end of the view.-
2649 \li ListView.PullBackFooter - the footer is positioned in the end of the view.-
2650 The footer can be pushed away by moving the content backwards, and pulled back by-
2651 moving the content forwards.-
2652 \endlist-
2653-
2654 \note This property has no effect on the \l {QQuickItem::z}{stacking order}-
2655 of the footer. For example, if the footer should be shown above the-
2656 \l delegate items when using \c ListView.OverlayFooter, its Z value-
2657 should be set to a value higher than that of the delegates. For more-
2658 information, see \l {Stacking Order in ListView}.-
2659*/-
2660QQuickListView::FooterPositioning QQuickListView::footerPositioning() const-
2661{-
2662 Q_D(const QQuickListView);-
2663 return d->footerPositioning;
never executed: return d->footerPositioning;
0
2664}-
2665-
2666void QQuickListView::setFooterPositioning(QQuickListView::FooterPositioning positioning)-
2667{-
2668 Q_D(QQuickListView);-
2669 if (d->footerPositioning != positioning) {
d->footerPosit...!= positioningDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-82
2670 d->applyPendingChanges();-
2671 d->footerPositioning = positioning;-
2672 if (isComponentComplete()) {
isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-82
2673 d->updateFooter();-
2674 d->updateViewport();-
2675 d->fixupPosition();-
2676 }
never executed: end of block
0
2677 emit footerPositioningChanged();-
2678 }
executed 82 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
82
2679}
executed 82 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
82
2680-
2681/*!-
2682 \qmlproperty Transition QtQuick::ListView::populate-
2683-
2684 This property holds the transition to apply to the items that are initially created-
2685 for a view.-
2686-
2687 It is applied to all items that are created when:-
2688-
2689 \list-
2690 \li The view is first created-
2691 \li The view's \l model changes-
2692 \li The view's \l model is \l {QAbstractItemModel::reset()}{reset}, if the model is a QAbstractItemModel subclass-
2693 \endlist-
2694-
2695 For example, here is a view that specifies such a transition:-
2696-
2697 \code-
2698 ListView {-
2699 ...-
2700 populate: Transition {-
2701 NumberAnimation { properties: "x,y"; duration: 1000 }-
2702 }-
2703 }-
2704 \endcode-
2705-
2706 When the view is initialized, the view will create all the necessary items for the view,-
2707 then animate them to their correct positions within the view over one second.-
2708-
2709 For more details and examples on how to use view transitions, see the ViewTransition-
2710 documentation.-
2711-
2712 \sa add, ViewTransition-
2713*/-
2714-
2715/*!-
2716 \qmlproperty Transition QtQuick::ListView::add-
2717-
2718 This property holds the transition to apply to items that are added to the view.-
2719-
2720 For example, here is a view that specifies such a transition:-
2721-
2722 \code-
2723 ListView {-
2724 ...-
2725 add: Transition {-
2726 NumberAnimation { properties: "x,y"; from: 100; duration: 1000 }-
2727 }-
2728 }-
2729 \endcode-
2730-
2731 Whenever an item is added to the above view, the item will be animated from the position (100,100)-
2732 to its final x,y position within the view, over one second. The transition only applies to-
2733 the new items that are added to the view; it does not apply to the items below that are-
2734 displaced by the addition of the new items. To animate the displaced items, set the \l displaced-
2735 or \l addDisplaced properties.-
2736-
2737 For more details and examples on how to use view transitions, see the ViewTransition-
2738 documentation.-
2739-
2740 \note This transition is not applied to the items that are created when the view is initially-
2741 populated, or when the view's \l model changes. (In those cases, the \l populate transition is-
2742 applied instead.) Additionally, this transition should \e not animate the height of the new item;-
2743 doing so will cause any items beneath the new item to be laid out at the wrong position. Instead,-
2744 the height can be animated within the \l {add}{onAdd} handler in the delegate.-
2745-
2746 \sa addDisplaced, populate, ViewTransition-
2747*/-
2748-
2749/*!-
2750 \qmlproperty Transition QtQuick::ListView::addDisplaced-
2751-
2752 This property holds the transition to apply to items within the view that are displaced by-
2753 the addition of other items to the view.-
2754-
2755 For example, here is a view that specifies such a transition:-
2756-
2757 \code-
2758 ListView {-
2759 ...-
2760 addDisplaced: Transition {-
2761 NumberAnimation { properties: "x,y"; duration: 1000 }-
2762 }-
2763 }-
2764 \endcode-
2765-
2766 Whenever an item is added to the above view, all items beneath the new item are displaced, causing-
2767 them to move down (or sideways, if horizontally orientated) within the view. As this-
2768 displacement occurs, the items' movement to their new x,y positions within the view will be-
2769 animated by a NumberAnimation over one second, as specified. This transition is not applied to-
2770 the new item that has been added to the view; to animate the added items, set the \l add-
2771 property.-
2772-
2773 If an item is displaced by multiple types of operations at the same time, it is not defined as to-
2774 whether the addDisplaced, moveDisplaced or removeDisplaced transition will be applied. Additionally,-
2775 if it is not necessary to specify different transitions depending on whether an item is displaced-
2776 by an add, move or remove operation, consider setting the \l displaced property instead.-
2777-
2778 For more details and examples on how to use view transitions, see the ViewTransition-
2779 documentation.-
2780-
2781 \note This transition is not applied to the items that are created when the view is initially-
2782 populated, or when the view's \l model changes. In those cases, the \l populate transition is-
2783 applied instead.-
2784-
2785 \sa displaced, add, populate, ViewTransition-
2786*/-
2787-
2788/*!-
2789 \qmlproperty Transition QtQuick::ListView::move-
2790-
2791 This property holds the transition to apply to items in the view that are being moved due-
2792 to a move operation in the view's \l model.-
2793-
2794 For example, here is a view that specifies such a transition:-
2795-
2796 \code-
2797 ListView {-
2798 ...-
2799 move: Transition {-
2800 NumberAnimation { properties: "x,y"; duration: 1000 }-
2801 }-
2802 }-
2803 \endcode-
2804-
2805 Whenever the \l model performs a move operation to move a particular set of indexes, the-
2806 respective items in the view will be animated to their new positions in the view over one-
2807 second. The transition only applies to the items that are the subject of the move operation-
2808 in the model; it does not apply to items below them that are displaced by the move operation.-
2809 To animate the displaced items, set the \l displaced or \l moveDisplaced properties.-
2810-
2811 For more details and examples on how to use view transitions, see the ViewTransition-
2812 documentation.-
2813-
2814 \sa moveDisplaced, ViewTransition-
2815*/-
2816-
2817/*!-
2818 \qmlproperty Transition QtQuick::ListView::moveDisplaced-
2819-
2820 This property holds the transition to apply to items that are displaced by a move operation in-
2821 the view's \l model.-
2822-
2823 For example, here is a view that specifies such a transition:-
2824-
2825 \code-
2826 ListView {-
2827 ...-
2828 moveDisplaced: Transition {-
2829 NumberAnimation { properties: "x,y"; duration: 1000 }-
2830 }-
2831 }-
2832 \endcode-
2833-
2834 Whenever the \l model performs a move operation to move a particular set of indexes, the items-
2835 between the source and destination indexes of the move operation are displaced, causing them-
2836 to move upwards or downwards (or sideways, if horizontally orientated) within the view. As this-
2837 displacement occurs, the items' movement to their new x,y positions within the view will be-
2838 animated by a NumberAnimation over one second, as specified. This transition is not applied to-
2839 the items that are the actual subjects of the move operation; to animate the moved items, set-
2840 the \l move property.-
2841-
2842 If an item is displaced by multiple types of operations at the same time, it is not defined as to-
2843 whether the addDisplaced, moveDisplaced or removeDisplaced transition will be applied. Additionally,-
2844 if it is not necessary to specify different transitions depending on whether an item is displaced-
2845 by an add, move or remove operation, consider setting the \l displaced property instead.-
2846-
2847 For more details and examples on how to use view transitions, see the ViewTransition-
2848 documentation.-
2849-
2850 \sa displaced, move, ViewTransition-
2851*/-
2852-
2853/*!-
2854 \qmlproperty Transition QtQuick::ListView::remove-
2855-
2856 This property holds the transition to apply to items that are removed from the view.-
2857-
2858 For example, here is a view that specifies such a transition:-
2859-
2860 \code-
2861 ListView {-
2862 ...-
2863 remove: Transition {-
2864 ParallelAnimation {-
2865 NumberAnimation { property: "opacity"; to: 0; duration: 1000 }-
2866 NumberAnimation { properties: "x,y"; to: 100; duration: 1000 }-
2867 }-
2868 }-
2869 }-
2870 \endcode-
2871-
2872 Whenever an item is removed from the above view, the item will be animated to the position (100,100)-
2873 over one second, and in parallel will also change its opacity to 0. The transition-
2874 only applies to the items that are removed from the view; it does not apply to the items below-
2875 them that are displaced by the removal of the items. To animate the displaced items, set the-
2876 \l displaced or \l removeDisplaced properties.-
2877-
2878 Note that by the time the transition is applied, the item has already been removed from the-
2879 model; any references to the model data for the removed index will not be valid.-
2880-
2881 Additionally, if the \l delayRemove attached property has been set for a delegate item, the-
2882 remove transition will not be applied until \l delayRemove becomes false again.-
2883-
2884 For more details and examples on how to use view transitions, see the ViewTransition-
2885 documentation.-
2886-
2887 \sa removeDisplaced, ViewTransition-
2888*/-
2889-
2890/*!-
2891 \qmlproperty Transition QtQuick::ListView::removeDisplaced-
2892-
2893 This property holds the transition to apply to items in the view that are displaced by the-
2894 removal of other items in the view.-
2895-
2896 For example, here is a view that specifies such a transition:-
2897-
2898 \code-
2899 ListView {-
2900 ...-
2901 removeDisplaced: Transition {-
2902 NumberAnimation { properties: "x,y"; duration: 1000 }-
2903 }-
2904 }-
2905 \endcode-
2906-
2907 Whenever an item is removed from the above view, all items beneath it are displaced, causing-
2908 them to move upwards (or sideways, if horizontally orientated) within the view. As this-
2909 displacement occurs, the items' movement to their new x,y positions within the view will be-
2910 animated by a NumberAnimation over one second, as specified. This transition is not applied to-
2911 the item that has actually been removed from the view; to animate the removed items, set the-
2912 \l remove property.-
2913-
2914 If an item is displaced by multiple types of operations at the same time, it is not defined as to-
2915 whether the addDisplaced, moveDisplaced or removeDisplaced transition will be applied. Additionally,-
2916 if it is not necessary to specify different transitions depending on whether an item is displaced-
2917 by an add, move or remove operation, consider setting the \l displaced property instead.-
2918-
2919 For more details and examples on how to use view transitions, see the ViewTransition-
2920 documentation.-
2921-
2922 \sa displaced, remove, ViewTransition-
2923*/-
2924-
2925/*!-
2926 \qmlproperty Transition QtQuick::ListView::displaced-
2927 This property holds the generic transition to apply to items that have been displaced by-
2928 any model operation that affects the view.-
2929-
2930 This is a convenience for specifying the generic transition to be applied to any items-
2931 that are displaced by an add, move or remove operation, without having to specify the-
2932 individual addDisplaced, moveDisplaced and removeDisplaced properties. For example, here-
2933 is a view that specifies a displaced transition:-
2934-
2935 \code-
2936 ListView {-
2937 ...-
2938 displaced: Transition {-
2939 NumberAnimation { properties: "x,y"; duration: 1000 }-
2940 }-
2941 }-
2942 \endcode-
2943-
2944 When any item is added, moved or removed within the above view, the items below it are-
2945 displaced, causing them to move down (or sideways, if horizontally orientated) within the-
2946 view. As this displacement occurs, the items' movement to their new x,y positions within-
2947 the view will be animated by a NumberAnimation over one second, as specified.-
2948-
2949 If a view specifies this generic displaced transition as well as a specific addDisplaced,-
2950 moveDisplaced or removeDisplaced transition, the more specific transition will be used-
2951 instead of the generic displaced transition when the relevant operation occurs, providing that-
2952 the more specific transition has not been disabled (by setting \l {Transition::enabled}{enabled}-
2953 to false). If it has indeed been disabled, the generic displaced transition is applied instead.-
2954-
2955 For more details and examples on how to use view transitions, see the ViewTransition-
2956 documentation.-
2957-
2958 \sa addDisplaced, moveDisplaced, removeDisplaced, ViewTransition-
2959*/-
2960-
2961void QQuickListView::viewportMoved(Qt::Orientations orient)-
2962{-
2963 Q_D(QQuickListView);-
2964 QQuickItemView::viewportMoved(orient);-
2965-
2966 if (!d->itemCount) {
!d->itemCountDescription
TRUEevaluated 562 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 9580 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
562-9580
2967 if (d->hasStickyHeader())
d->hasStickyHeader()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 476 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
86-476
2968 d->updateHeader();
executed 86 times by 1 test: d->updateHeader();
Executed by:
  • tst_qquicklistview
86
2969 if (d->hasStickyFooter())
d->hasStickyFooter()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 500 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
62-500
2970 d->updateFooter();
executed 62 times by 1 test: d->updateFooter();
Executed by:
  • tst_qquicklistview
62
2971 return;
executed 562 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquicklistview
562
2972 }-
2973-
2974 // Recursion can occur due to refill changing the content size.-
2975 if (d->inViewportMoved)
d->inViewportMovedDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 9553 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
27-9553
2976 return;
executed 27 times by 1 test: return;
Executed by:
  • tst_qquicklistview
27
2977 d->inViewportMoved = true;-
2978-
2979 if (yflick()) {
yflick()Description
TRUEevaluated 6169 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 3384 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
3384-6169
2980 if (d->isBottomToTop())
d->isBottomToTop()Description
TRUEevaluated 1566 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4603 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1566-4603
2981 d->bufferMode = d->vData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferAfter : QQuickListViewPrivate::BufferBefore;
executed 1566 times by 1 test: d->bufferMode = d->vData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferAfter : QQuickListViewPrivate::BufferBefore;
Executed by:
  • tst_qquicklistview
d->vData.smoothVelocity < 0Description
TRUEevaluated 709 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 857 times by 1 test
Evaluated by:
  • tst_qquicklistview
709-1566
2982 else-
2983 d->bufferMode = d->vData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferBefore : QQuickListViewPrivate::BufferAfter;
executed 4603 times by 5 tests: d->bufferMode = d->vData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferBefore : QQuickListViewPrivate::BufferAfter;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->vData.smoothVelocity < 0Description
TRUEevaluated 1423 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 3180 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
1423-4603
2984 } else {-
2985 if (d->isRightToLeft())
d->isRightToLeft()Description
TRUEevaluated 1533 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1851 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
1533-1851
2986 d->bufferMode = d->hData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferAfter : QQuickListViewPrivate::BufferBefore;
executed 1533 times by 1 test: d->bufferMode = d->hData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferAfter : QQuickListViewPrivate::BufferBefore;
Executed by:
  • tst_qquicklistview
d->hData.smoothVelocity < 0Description
TRUEevaluated 710 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 823 times by 1 test
Evaluated by:
  • tst_qquicklistview
710-1533
2987 else-
2988 d->bufferMode = d->hData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferBefore : QQuickListViewPrivate::BufferAfter;
executed 1851 times by 2 tests: d->bufferMode = d->hData.smoothVelocity < 0 ? QQuickListViewPrivate::BufferBefore : QQuickListViewPrivate::BufferAfter;
Executed by:
  • tst_examples
  • tst_qquicklistview
d->hData.smoothVelocity < 0Description
TRUEevaluated 744 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1107 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
744-1851
2989 }-
2990-
2991 d->refillOrLayout();-
2992-
2993 // Set visibility of items to eliminate cost of items outside the visible area.-
2994 qreal from = d->isContentFlowReversed() ? -d->position()-d->displayMarginBeginning-d->size() : d->position()-d->displayMarginBeginning;
d->isContentFlowReversed()Description
TRUEevaluated 3099 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6454 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
3099-6454
2995 qreal to = d->isContentFlowReversed() ? -d->position()+d->displayMarginEnd : d->position()+d->size()+d->displayMarginEnd;
d->isContentFlowReversed()Description
TRUEevaluated 3099 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6454 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
3099-6454
2996 for (FxViewItem *item : qAsConst(d->visibleItems)) {-
2997 if (item->item)
item->itemDescription
TRUEevaluated 87351 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-87351
2998 QQuickItemPrivate::get(item->item)->setCulled(item->endPosition() < from || item->position() > to);
executed 87351 times by 5 tests: QQuickItemPrivate::get(item->item)->setCulled(item->endPosition() < from || item->position() > to);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
87351
2999 }
executed 87351 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
87351
3000 if (d->currentItem)
d->currentItemDescription
TRUEevaluated 9513 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicklistview
40-9513
3001 QQuickItemPrivate::get(d->currentItem->item)->setCulled(d->currentItem->endPosition() < from || d->currentItem->position() > to);
executed 9513 times by 5 tests: QQuickItemPrivate::get(d->currentItem->item)->setCulled(d->currentItem->endPosition() < from || d->currentItem->position() > to);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
9513
3002-
3003 if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
d->hData.flickingDescription
TRUEevaluated 2759 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6794 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->vData.flickingDescription
TRUEevaluated 3358 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3436 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->hData.movingDescription
TRUEevaluated 306 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3130 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->vData.movingDescription
TRUEevaluated 969 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2161 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
306-6794
3004 d->moveReason = QQuickListViewPrivate::Mouse;
executed 7392 times by 1 test: d->moveReason = QQuickListViewPrivate::Mouse;
Executed by:
  • tst_qquicklistview
7392
3005 if (d->moveReason != QQuickListViewPrivate::SetIndex) {
d->moveReason ...vate::SetIndexDescription
TRUEevaluated 8484 times by 4 tests
Evaluated by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
FALSEevaluated 1069 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1069-8484
3006 if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
d->haveHighlightRangeDescription
TRUEevaluated 2987 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 5497 times by 4 tests
Evaluated by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->highlightRa...lyEnforceRangeDescription
TRUEevaluated 2987 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
d->highlightDescription
TRUEevaluated 2947 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-5497
3007 // reposition highlight-
3008 qreal pos = d->highlight->position();-
3009 qreal viewPos = d->isContentFlowReversed() ? -d->position()-d->size() : d->position();
d->isContentFlowReversed()Description
TRUEevaluated 1217 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1730 times by 1 test
Evaluated by:
  • tst_qquicklistview
1217-1730
3010 if (pos > viewPos + d->highlightRangeEnd - d->highlight->size())
pos > viewPos ...hlight->size()Description
TRUEevaluated 1542 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1405 times by 1 test
Evaluated by:
  • tst_qquicklistview
1405-1542
3011 pos = viewPos + d->highlightRangeEnd - d->highlight->size();
executed 1542 times by 1 test: pos = viewPos + d->highlightRangeEnd - d->highlight->size();
Executed by:
  • tst_qquicklistview
1542
3012 if (pos < viewPos + d->highlightRangeStart)
pos < viewPos ...ightRangeStartDescription
TRUEevaluated 1684 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1263 times by 1 test
Evaluated by:
  • tst_qquicklistview
1263-1684
3013 pos = viewPos + d->highlightRangeStart;
executed 1684 times by 1 test: pos = viewPos + d->highlightRangeStart;
Executed by:
  • tst_qquicklistview
1684
3014 if (pos != d->highlight->position()) {
pos != d->high...ht->position()Description
TRUEevaluated 2885 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicklistview
62-2885
3015 d->highlightPosAnimator->stop();-
3016 static_cast<FxListItemSG*>(d->highlight)->setPosition(pos);-
3017 } else {
executed 2885 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2885
3018 d->updateHighlight();-
3019 }
executed 62 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
62
3020-
3021 // update current index-
3022 if (FxViewItem *snapItem = d->snapItemAt(d->highlight->position())) {
FxViewItem *sn...t->position())Description
TRUEevaluated 2739 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 208 times by 1 test
Evaluated by:
  • tst_qquicklistview
208-2739
3023 if (snapItem->index >= 0 && snapItem->index != d->currentIndex)
snapItem->index >= 0Description
TRUEevaluated 2739 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
snapItem->inde...->currentIndexDescription
TRUEevaluated 234 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2505 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-2739
3024 d->updateCurrent(snapItem->index);
executed 234 times by 1 test: d->updateCurrent(snapItem->index);
Executed by:
  • tst_qquicklistview
234
3025 }
executed 2739 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2739
3026 }
executed 2947 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2947
3027 }
executed 8484 times by 4 tests: end of block
Executed by:
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
8484
3028-
3029 if ((d->hData.flicking || d->vData.flicking) && d->correctFlick && !d->inFlickCorrection) {
d->hData.flickingDescription
TRUEevaluated 2759 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 6794 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->vData.flickingDescription
TRUEevaluated 3358 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3436 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
d->correctFlickDescription
TRUEevaluated 2861 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3256 times by 1 test
Evaluated by:
  • tst_qquicklistview
!d->inFlickCorrectionDescription
TRUEevaluated 2861 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-6794
3030 d->inFlickCorrection = true;-
3031 // Near an end and it seems that the extent has changed?-
3032 // Recalculate the flick so that we don't end up in an odd position.-
3033 if (yflick() && !d->vData.inOvershoot) {
yflick()Description
TRUEevaluated 1576 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1285 times by 1 test
Evaluated by:
  • tst_qquicklistview
!d->vData.inOvershootDescription
TRUEevaluated 1434 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_qquicklistview
142-1576
3034 if (d->vData.velocity > 0) {
d->vData.velocity > 0Description
TRUEevaluated 635 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 799 times by 1 test
Evaluated by:
  • tst_qquicklistview
635-799
3035 const qreal minY = minYExtent();-
3036 if ((minY - d->vData.move.value() < height()/2 || d->vData.flickTarget - d->vData.move.value() < height()/2)
minY - d->vDat...) < height()/2Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 426 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->vData.flick...) < height()/2Description
TRUEevaluated 372 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicklistview
54-426
3037 && minY != d->vData.flickTarget)
minY != d->vData.flickTargetDescription
TRUEevaluated 451 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 130 times by 1 test
Evaluated by:
  • tst_qquicklistview
130-451
3038 d->flickY(-d->vData.smoothVelocity.value());
executed 451 times by 1 test: d->flickY(-d->vData.smoothVelocity.value());
Executed by:
  • tst_qquicklistview
451
3039 } else if (d->vData.velocity < 0) {
executed 635 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
d->vData.velocity < 0Description
TRUEevaluated 799 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-799
3040 const qreal maxY = maxYExtent();-
3041 if ((d->vData.move.value() - maxY < height()/2 || d->vData.move.value() - d->vData.flickTarget < height()/2)
d->vData.move....Y < height()/2Description
TRUEevaluated 280 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 519 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->vData.move....t < height()/2Description
TRUEevaluated 398 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 121 times by 1 test
Evaluated by:
  • tst_qquicklistview
121-519
3042 && maxY != d->vData.flickTarget)
maxY != d->vData.flickTargetDescription
TRUEevaluated 481 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 197 times by 1 test
Evaluated by:
  • tst_qquicklistview
197-481
3043 d->flickY(-d->vData.smoothVelocity.value());
executed 481 times by 1 test: d->flickY(-d->vData.smoothVelocity.value());
Executed by:
  • tst_qquicklistview
481
3044 }
executed 799 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
799
3045 }
executed 1434 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
1434
3046-
3047 if (xflick() && !d->hData.inOvershoot) {
xflick()Description
TRUEevaluated 1285 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1576 times by 1 test
Evaluated by:
  • tst_qquicklistview
!d->hData.inOvershootDescription
TRUEevaluated 1203 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicklistview
82-1576
3048 if (d->hData.velocity > 0) {
d->hData.velocity > 0Description
TRUEevaluated 601 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 602 times by 1 test
Evaluated by:
  • tst_qquicklistview
601-602
3049 const qreal minX = minXExtent();-
3050 if ((minX - d->hData.move.value() < width()/2 || d->hData.flickTarget - d->hData.move.value() < width()/2)
minX - d->hDat...() < width()/2Description
TRUEevaluated 201 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 400 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->hData.flick...() < width()/2Description
TRUEevaluated 372 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicklistview
28-400
3051 && minX != d->hData.flickTarget)
minX != d->hData.flickTargetDescription
TRUEevaluated 453 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquicklistview
120-453
3052 d->flickX(-d->hData.smoothVelocity.value());
executed 453 times by 1 test: d->flickX(-d->hData.smoothVelocity.value());
Executed by:
  • tst_qquicklistview
453
3053 } else if (d->hData.velocity < 0) {
executed 601 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
d->hData.velocity < 0Description
TRUEevaluated 602 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-602
3054 const qreal maxX = maxXExtent();-
3055 if ((d->hData.move.value() - maxX < width()/2 || d->hData.move.value() - d->hData.flickTarget < width()/2)
d->hData.move....xX < width()/2Description
TRUEevaluated 200 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 402 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->hData.move....et < width()/2Description
TRUEevaluated 374 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicklistview
28-402
3056 && maxX != d->hData.flickTarget)
maxX != d->hData.flickTargetDescription
TRUEevaluated 454 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquicklistview
120-454
3057 d->flickX(-d->hData.smoothVelocity.value());
executed 454 times by 1 test: d->flickX(-d->hData.smoothVelocity.value());
Executed by:
  • tst_qquicklistview
454
3058 }
executed 602 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
602
3059 }
executed 1203 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
1203
3060 d->inFlickCorrection = false;-
3061 }
executed 2861 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2861
3062 if (d->hasStickyHeader())
d->hasStickyHeader()Description
TRUEevaluated 186 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 9367 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
186-9367
3063 d->updateHeader();
executed 186 times by 1 test: d->updateHeader();
Executed by:
  • tst_qquicklistview
186
3064 if (d->hasStickyFooter())
d->hasStickyFooter()Description
TRUEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 9331 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
222-9331
3065 d->updateFooter();
executed 222 times by 1 test: d->updateFooter();
Executed by:
  • tst_qquicklistview
222
3066 if (d->sectionCriteria) {
d->sectionCriteriaDescription
TRUEevaluated 472 times by 2 tests
Evaluated by:
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 9081 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
472-9081
3067 d->updateCurrentSection();-
3068 d->updateStickySections();-
3069 }
executed 472 times by 2 tests: end of block
Executed by:
  • tst_qquickgridview
  • tst_qquicklistview
472
3070 d->inViewportMoved = false;-
3071}
executed 9553 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickvisualdatamodel
9553
3072-
3073void QQuickListView::keyPressEvent(QKeyEvent *event)-
3074{-
3075 Q_D(QQuickListView);-
3076 if (d->model && d->model->count() && ((d->interactive && !d->explicitKeyNavigationEnabled)
d->model->count()Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
d->interactiveDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
!d->explicitKe...igationEnabledDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-90
3077 || (d->explicitKeyNavigationEnabled && d->keyNavigationEnabled))) {
d->explicitKey...igationEnabledDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->keyNavigationEnabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-4
3078 if ((d->orient == QQuickListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Left)
d->orient == Q...ew::HorizontalDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
!d->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
event->key() == Qt::Key_LeftDescription
TRUEnever evaluated
FALSEnever evaluated
0-86
3079 || (d->orient == QQuickListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Right)
d->orient == Q...ew::HorizontalDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
event->key() == Qt::Key_RightDescription
TRUEnever evaluated
FALSEnever evaluated
0-86
3080 || (d->orient == QQuickListView::Vertical && !d->isBottomToTop() && event->key() == Qt::Key_Up)
d->orient == Q...View::VerticalDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
!d->isBottomToTop()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
event->key() == Qt::Key_UpDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-86
3081 || (d->orient == QQuickListView::Vertical && d->isBottomToTop() && event->key() == Qt::Key_Down)) {
d->orient == Q...View::VerticalDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
d->isBottomToTop()Description
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
event->key() == Qt::Key_DownDescription
TRUEnever evaluated
FALSEnever evaluated
0-86
3082 if (currentIndex() > 0 || (d->wrap && !event->isAutoRepeat())) {
currentIndex() > 0Description
TRUEnever evaluated
FALSEnever evaluated
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
!event->isAutoRepeat()Description
TRUEnever evaluated
FALSEnever evaluated
0
3083 decrementCurrentIndex();-
3084 event->accept();-
3085 return;
never executed: return;
0
3086 } else if (d->wrap) {
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
0
3087 event->accept();-
3088 return;
never executed: return;
0
3089 }-
3090 } else if ((d->orient == QQuickListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Right)
never executed: end of block
d->orient == Q...ew::HorizontalDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
!d->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
event->key() == Qt::Key_RightDescription
TRUEnever evaluated
FALSEnever evaluated
0-86
3091 || (d->orient == QQuickListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Left)
d->orient == Q...ew::HorizontalDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
event->key() == Qt::Key_LeftDescription
TRUEnever evaluated
FALSEnever evaluated
0-86
3092 || (d->orient == QQuickListView::Vertical && !d->isBottomToTop() && event->key() == Qt::Key_Down)
d->orient == Q...View::VerticalDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
!d->isBottomToTop()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
event->key() == Qt::Key_DownDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-86
3093 || (d->orient == QQuickListView::Vertical && d->isBottomToTop() && event->key() == Qt::Key_Up)) {
d->orient == Q...View::VerticalDescription
TRUEnever evaluated
FALSEnever evaluated
d->isBottomToTop()Description
TRUEnever evaluated
FALSEnever evaluated
event->key() == Qt::Key_UpDescription
TRUEnever evaluated
FALSEnever evaluated
0
3094 if (currentIndex() < d->model->count() - 1 || (d->wrap && !event->isAutoRepeat())) {
currentIndex()...l->count() - 1Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
!event->isAutoRepeat()Description
TRUEnever evaluated
FALSEnever evaluated
0-86
3095 incrementCurrentIndex();-
3096 event->accept();-
3097 return;
executed 86 times by 1 test: return;
Executed by:
  • tst_qquicklistview
86
3098 } else if (d->wrap) {
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
0
3099 event->accept();-
3100 return;
never executed: return;
0
3101 }-
3102 }
never executed: end of block
0
3103 }
never executed: end of block
0
3104 event->ignore();-
3105 QQuickItemView::keyPressEvent(event);-
3106}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
4
3107-
3108void QQuickListView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)-
3109{-
3110 Q_D(QQuickListView);-
3111 if (d->isRightToLeft()) {
d->isRightToLeft()Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4000 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
72-4000
3112 // maintain position relative to the right edge-
3113 qreal dx = newGeometry.width() - oldGeometry.width();-
3114 setContentX(contentX() - dx);-
3115 } else if (d->isBottomToTop()) {
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
d->isBottomToTop()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3972 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
28-3972
3116 // maintain position relative to the bottom edge-
3117 qreal dy = newGeometry.height() - oldGeometry.height();-
3118 setContentY(contentY() - dy);-
3119 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
28
3120 QQuickItemView::geometryChanged(newGeometry, oldGeometry);-
3121}
executed 4072 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
4072
3122-
3123void QQuickListView::initItem(int index, QObject *object)-
3124{-
3125 QQuickItemView::initItem(index, object);-
3126-
3127 // setting the view from the FxViewItem wrapper is too late if the delegate-
3128 // needs access to the view in Component.onCompleted-
3129 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);-
3130 if (item) {
itemDescription
TRUEevaluated 29948 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-29948
3131 QQuickListViewAttached *attached = static_cast<QQuickListViewAttached *>(-
3132 qmlAttachedPropertiesObject<QQuickListView>(item));-
3133 if (attached)
attachedDescription
TRUEevaluated 29948 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-29948
3134 attached->setView(this);
executed 29948 times by 10 tests: attached->setView(this);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
29948
3135 }
executed 29948 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
29948
3136}
executed 29948 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
29948
3137-
3138qreal QQuickListView::maxYExtent() const-
3139{-
3140 Q_D(const QQuickListView);-
3141 if (d->layoutOrientation() == Qt::Horizontal && d->flickableDirection != HorizontalFlick)
d->layoutOrien...Qt::HorizontalDescription
TRUEevaluated 5861 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 54514 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
d->flickableDi...orizontalFlickDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 5813 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
48-54514
3142 return QQuickFlickable::maxYExtent();
executed 48 times by 1 test: return QQuickFlickable::maxYExtent();
Executed by:
  • tst_qquicklistview
48
3143 return QQuickItemView::maxYExtent();
executed 60327 times by 11 tests: return QQuickItemView::maxYExtent();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
60327
3144}-
3145-
3146qreal QQuickListView::maxXExtent() const-
3147{-
3148 Q_D(const QQuickListView);-
3149 if (d->layoutOrientation() == Qt::Vertical && d->flickableDirection != VerticalFlick)
d->layoutOrien...= Qt::VerticalDescription
TRUEevaluated 27304 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 16800 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
d->flickableDi... VerticalFlickDescription
TRUEevaluated 80 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 27224 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
80-27304
3150 return QQuickFlickable::maxXExtent();
executed 80 times by 2 tests: return QQuickFlickable::maxXExtent();
Executed by:
  • tst_examples
  • tst_qquicklistview
80
3151 return QQuickItemView::maxXExtent();
executed 44024 times by 11 tests: return QQuickItemView::maxXExtent();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
44024
3152}-
3153-
3154/*!-
3155 \qmlmethod QtQuick::ListView::incrementCurrentIndex()-
3156-
3157 Increments the current index. The current index will wrap-
3158 if keyNavigationWraps is true and it is currently at the end.-
3159 This method has no effect if the \l count is zero.-
3160-
3161 \b Note: methods should only be called after the Component has completed.-
3162*/-
3163void QQuickListView::incrementCurrentIndex()-
3164{-
3165 Q_D(QQuickListView);-
3166 int count = d->model ? d->model->count() : 0;
d->modelDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-92
3167 if (count && (currentIndex() < count - 1 || d->wrap)) {
countDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
currentIndex() < count - 1Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->wrapDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-92
3168 d->moveReason = QQuickListViewPrivate::SetIndex;-
3169 int index = currentIndex()+1;-
3170 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
3171 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
92
3172}
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
92
3173-
3174/*!-
3175 \qmlmethod QtQuick::ListView::decrementCurrentIndex()-
3176-
3177 Decrements the current index. The current index will wrap-
3178 if keyNavigationWraps is true and it is currently at the beginning.-
3179 This method has no effect if the \l count is zero.-
3180-
3181 \b Note: methods should only be called after the Component has completed.-
3182*/-
3183void QQuickListView::decrementCurrentIndex()-
3184{-
3185 Q_D(QQuickListView);-
3186 int count = d->model ? d->model->count() : 0;
d->modelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-2
3187 if (count && (currentIndex() > 0 || d->wrap)) {
countDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
currentIndex() > 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
d->wrapDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-2
3188 d->moveReason = QQuickListViewPrivate::SetIndex;-
3189 int index = currentIndex()-1;-
3190 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
3191 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
3192}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
2
3193-
3194void QQuickListViewPrivate::updateSectionCriteria()-
3195{-
3196 Q_Q(QQuickListView);-
3197 if (q->isComponentComplete() && model) {
q->isComponentComplete()Description
TRUEevaluated 1994 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 48 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
48-1994
3198 QList<QByteArray> roles;-
3199 if (sectionCriteria && !sectionCriteria->property().isEmpty())
sectionCriteriaDescription
TRUEevaluated 64 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 1924 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
!sectionCriter...ty().isEmpty()Description
TRUEevaluated 64 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-1924
3200 roles << sectionCriteria->property().toUtf8();
executed 64 times by 4 tests: roles << sectionCriteria->property().toUtf8();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
64
3201 model->setWatchedRoles(roles);-
3202 updateSections();-
3203 if (itemCount)
itemCountDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 1972 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
16-1972
3204 forceLayoutPolish();
executed 16 times by 2 tests: forceLayoutPolish();
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
16
3205 }
executed 1988 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
1988
3206}
executed 2042 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
2042
3207-
3208bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView)-
3209{-
3210 int modelIndex = change.index;-
3211 int count = change.count;-
3212-
3213 qreal tempPos = isContentFlowReversed() ? -position()-size() : position();
isContentFlowReversed()Description
TRUEevaluated 108 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 1155 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
108-1155
3214 int index = visibleItems.count() ? mapFromModel(modelIndex) : 0;
visibleItems.count()Description
TRUEevaluated 987 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 276 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
276-987
3215 qreal lastVisiblePos = buffer + displayMarginEnd + tempPos + size();-
3216-
3217 if (index < 0) {
index < 0Description
TRUEevaluated 272 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 991 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
272-991
3218 int i = visibleItems.count() - 1;-
3219 while (i > 0 && visibleItems.at(i)->index == -1)
i > 0Description
TRUEevaluated 254 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
visibleItems.a...)->index == -1Description
TRUEnever evaluated
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-254
3220 --i;
never executed: --i;
0
3221 if (i == 0 && visibleItems.constFirst()->index == -1) {
i == 0Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
visibleItems.c...)->index == -1Description
TRUEnever evaluated
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-254
3222 // there are no visible items except items marked for removal-
3223 index = visibleItems.count();-
3224 } else if (visibleItems.at(i)->index + 1 == modelIndex
never executed: end of block
visibleItems.a... == modelIndexDescription
TRUEevaluated 207 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 65 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-207
3225 && visibleItems.at(i)->endPosition() <= lastVisiblePos) {
visibleItems.a...lastVisiblePosDescription
TRUEevaluated 203 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicklistview
4-203
3226 // Special case of appending an item to the model.-
3227 index = visibleItems.count();-
3228 } else {
executed 203 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
203
3229 if (modelIndex < visibleIndex) {
modelIndex < visibleIndexDescription
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicklistview
24-45
3230 // Insert before visible items-
3231 visibleIndex += count;-
3232 for (FxViewItem *item : qAsConst(visibleItems)) {-
3233 if (item->index != -1 && item->index >= modelIndex)
item->index != -1Description
TRUEevaluated 670 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
item->index >= modelIndexDescription
TRUEevaluated 670 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-670
3234 item->index += count;
executed 670 times by 1 test: item->index += count;
Executed by:
  • tst_qquicklistview
670
3235 }
executed 670 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
670
3236 }
executed 45 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
45
3237 return true;
executed 69 times by 1 test: return true;
Executed by:
  • tst_qquicklistview
69
3238 }-
3239 }-
3240-
3241 // index can be the next item past the end of the visible items list (i.e. appended)-
3242 qreal pos = 0;-
3243 if (visibleItems.count()) {
visibleItems.count()Description
TRUEevaluated 918 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 276 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
276-918
3244 pos = index < visibleItems.count() ? visibleItems.at(index)->position()
index < visibleItems.count()Description
TRUEevaluated 715 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 203 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
203-715
3245 : visibleItems.constLast()->endPosition() + spacing;-
3246 }
executed 918 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
918
3247-
3248 // Update the indexes of the following visible items.-
3249 for (FxViewItem *item : qAsConst(visibleItems)) {-
3250 if (item->index != -1 && item->index >= modelIndex) {
item->index != -1Description
TRUEevaluated 10307 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
item->index >= modelIndexDescription
TRUEevaluated 5520 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4787 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-10307
3251 item->index += count;-
3252 if (change.isMove())
change.isMove()Description
TRUEevaluated 2464 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 3056 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
2464-3056
3253 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::MoveTransition, false);
executed 2464 times by 1 test: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::MoveTransition, false);
Executed by:
  • tst_qquicklistview
2464
3254 else-
3255 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, false);
executed 3056 times by 2 tests: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, false);
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
3056
3256 }-
3257 }
executed 10307 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
10307
3258-
3259 bool visibleAffected = false;-
3260 if (insertResult->visiblePos.isValid() && pos < insertResult->visiblePos) {
insertResult->...ePos.isValid()Description
TRUEevaluated 952 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 242 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
pos < insertResult->visiblePosDescription
TRUEevaluated 49 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 903 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
49-952
3261 // Insert items before the visible item.-
3262 int insertionIdx = index;-
3263 int i = 0;-
3264 qreal from = tempPos - displayMarginBeginning - buffer;-
3265-
3266 if (insertionIdx < visibleIndex) {
insertionIdx < visibleIndexDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicklistview
19-30
3267 if (pos >= from) {
pos >= fromDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
7-12
3268 // items won't be visible, just note the size for repositioning-
3269 insertResult->sizeChangesBeforeVisiblePos += count * (averageSize + spacing);-
3270 }
executed 7 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
7
3271 } else {
executed 19 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
19
3272 for (i = count-1; i >= 0 && pos >= from; --i) {
i >= 0Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicklistview
pos >= fromDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicklistview
10-38
3273 // item is before first visible e.g. in cache buffer-
3274 FxViewItem *item = nullptr;-
3275 if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i))))
change.isMove()Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
(item = curren...elIndex + i)))Description
TRUEnever evaluated
FALSEnever evaluated
0-18
3276 item->index = modelIndex + i;
never executed: item->index = modelIndex + i;
0
3277 if (!item)
!itemDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-18
3278 item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
executed 18 times by 1 test: item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
Executed by:
  • tst_qquicklistview
18
3279 if (!item)
!itemDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-18
3280 return false;
never executed: return false;
0
3281-
3282 visibleAffected = true;-
3283 visibleItems.insert(insertionIdx, item);-
3284 if (insertionIdx == 0)
insertionIdx == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qquicklistview
9
3285 insertResult->changedFirstItem = true;
executed 9 times by 1 test: insertResult->changedFirstItem = true;
Executed by:
  • tst_qquicklistview
9
3286 if (!change.isMove()) {
!change.isMove()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-18
3287 addedItems->append(item);-
3288 if (transitioner)
transitionerDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
0-18
3289 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
never executed: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
0
3290 else-
3291 static_cast<FxListItemSG *>(item)->setPosition(pos, true);
executed 18 times by 1 test: static_cast<FxListItemSG *>(item)->setPosition(pos, true);
Executed by:
  • tst_qquicklistview
18
3292 }-
3293 insertResult->sizeChangesBeforeVisiblePos += item->size() + spacing;-
3294 pos -= item->size() + spacing;-
3295 index++;-
3296 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
18
3297 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
30
3298-
3299 int firstOkIdx = -1;-
3300 for (int i = 0; i <= insertionIdx && i < visibleItems.count() - 1; i++) {
i <= insertionIdxDescription
TRUEevaluated 59 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_qquicklistview
i < visibleItems.count() - 1Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicklistview
20-59
3301 if (visibleItems.at(i)->index + 1 != visibleItems.at(i + 1)->index) {
visibleItems.a...(i + 1)->indexDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_qquicklistview
8-31
3302 firstOkIdx = i + 1;-
3303 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquicklistview
8
3304 }-
3305 }
executed 31 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
31
3306 for (int i = 0; i < firstOkIdx; i++) {
i < firstOkIdxDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 49 times by 1 test
Evaluated by:
  • tst_qquicklistview
12-49
3307 FxViewItem *nvItem = visibleItems.takeFirst();-
3308 addedItems->removeOne(nvItem);-
3309 removeItem(nvItem);-
3310 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
12
3311-
3312 } else {
executed 49 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
49
3313 for (int i = 0; i < count && pos <= lastVisiblePos; ++i) {
i < countDescription
TRUEevaluated 5011 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 950 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
pos <= lastVisiblePosDescription
TRUEevaluated 4816 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 195 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
195-5011
3314 visibleAffected = true;-
3315 FxViewItem *item = nullptr;-
3316 if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i))))
change.isMove()Description
TRUEevaluated 574 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4242 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
(item = curren...elIndex + i)))Description
TRUEevaluated 432 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_qquicklistview
142-4242
3317 item->index = modelIndex + i;
executed 432 times by 1 test: item->index = modelIndex + i;
Executed by:
  • tst_qquicklistview
432
3318 bool newItem = !item;-
3319 if (!item)
!itemDescription
TRUEevaluated 4384 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 432 times by 1 test
Evaluated by:
  • tst_qquicklistview
432-4384
3320 item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
executed 4384 times by 3 tests: item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4384
3321 if (!item)
!itemDescription
TRUEnever evaluated
FALSEevaluated 4816 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-4816
3322 return false;
never executed: return false;
0
3323-
3324 visibleItems.insert(index, item);-
3325 if (index == 0)
index == 0Description
TRUEevaluated 499 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 4317 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
499-4317
3326 insertResult->changedFirstItem = true;
executed 499 times by 3 tests: insertResult->changedFirstItem = true;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
499
3327 if (change.isMove()) {
change.isMove()Description
TRUEevaluated 574 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 4242 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
574-4242
3328 // we know this is a move target, since move displaced items that are-
3329 // shuffled into view due to a move would be added in refill()-
3330 if (newItem && transitioner && transitioner->canTransition(QQuickItemViewTransitioner::MoveTransition, true))
newItemDescription
TRUEevaluated 142 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 432 times by 1 test
Evaluated by:
  • tst_qquicklistview
transitionerDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 110 times by 1 test
Evaluated by:
  • tst_qquicklistview
transitioner->...nsition, true)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-432
3331 movingIntoView->append(MovedItem(item, change.moveKey(item->index)));
executed 32 times by 1 test: movingIntoView->append(MovedItem(item, change.moveKey(item->index)));
Executed by:
  • tst_qquicklistview
32
3332 } else {
executed 574 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
574
3333 addedItems->append(item);-
3334 if (transitioner)
transitionerDescription
TRUEevaluated 228 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 4014 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
228-4014
3335 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
executed 228 times by 2 tests: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
Executed by:
  • tst_examples
  • tst_qquicklistview
228
3336 else-
3337 static_cast<FxListItemSG *>(item)->setPosition(pos, true);
executed 4014 times by 3 tests: static_cast<FxListItemSG *>(item)->setPosition(pos, true);
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4014
3338 }-
3339 insertResult->sizeChangesAfterVisiblePos += item->size() + spacing;-
3340 pos += item->size() + spacing;-
3341 ++index;-
3342 }
executed 4816 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
4816
3343-
3344 if (0 < index && index < visibleItems.count()) {
0 < indexDescription
TRUEevaluated 1145 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
index < visibleItems.count()Description
TRUEevaluated 686 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 459 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
0-1145
3345 FxViewItem *prevItem = visibleItems.at(index - 1);-
3346 FxViewItem *item = visibleItems.at(index);-
3347 if (prevItem->index != item->index - 1) {
prevItem->inde...tem->index - 1Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 663 times by 2 tests
Evaluated by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
23-663
3348 int i = index;-
3349 qreal prevPos = prevItem->position();-
3350 while (i < visibleItems.count()) {
i < visibleItems.count()Description
TRUEevaluated 87 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qquicklistview
23-87
3351 FxListItemSG *nvItem = static_cast<FxListItemSG *>(visibleItems.takeLast());-
3352 insertResult->sizeChangesAfterVisiblePos -= nvItem->size() + spacing;-
3353 addedItems->removeOne(nvItem);-
3354 if (nvItem->transitionScheduledOrRunning())
nvItem->transi...ledOrRunning()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 85 times by 1 test
Evaluated by:
  • tst_qquicklistview
2-85
3355 nvItem->setPosition(prevPos + (nvItem->index - prevItem->index) * averageSize);
executed 2 times by 1 test: nvItem->setPosition(prevPos + (nvItem->index - prevItem->index) * averageSize);
Executed by:
  • tst_qquicklistview
2
3356 removeItem(nvItem);-
3357 }
executed 87 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
87
3358 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
23
3359 }
executed 686 times by 2 tests: end of block
Executed by:
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
686
3360 }
executed 1145 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1145
3361-
3362 updateVisibleIndex();-
3363-
3364 return visibleAffected;
executed 1194 times by 3 tests: return visibleAffected;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
1194
3365}-
3366-
3367void QQuickListViewPrivate::translateAndTransitionItemsAfter(int afterModelIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult)-
3368{-
3369 Q_UNUSED(insertionResult);-
3370-
3371 if (!transitioner)
!transitionerDescription
TRUEnever evaluated
FALSEevaluated 240 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
0-240
3372 return;
never executed: return;
0
3373-
3374 int markerItemIndex = -1;-
3375 for (int i=0; i<visibleItems.count(); i++) {
i<visibleItems.count()Description
TRUEevaluated 4056 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEnever evaluated
0-4056
3376 if (visibleItems.at(i)->index == afterModelIndex) {
visibleItems.a...fterModelIndexDescription
TRUEevaluated 240 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 3816 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
240-3816
3377 markerItemIndex = i;-
3378 break;
executed 240 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qquicklistview
240
3379 }-
3380 }
executed 3816 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
3816
3381 if (markerItemIndex < 0)
markerItemIndex < 0Description
TRUEnever evaluated
FALSEevaluated 240 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
0-240
3382 return;
never executed: return;
0
3383-
3384 const qreal viewEndPos = isContentFlowReversed() ? -position() : position() + size();
isContentFlowReversed()Description
TRUEnever evaluated
FALSEevaluated 240 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
0-240
3385 qreal sizeRemoved = -removalResult.sizeChangesAfterVisiblePos-
3386 - (removalResult.countChangeAfterVisibleItems * (averageSize + spacing));-
3387-
3388 for (int i=markerItemIndex+1; i<visibleItems.count(); i++) {
i<visibleItems.count()Description
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
120-138
3389 FxListItemSG *listItem = static_cast<FxListItemSG *>(visibleItems.at(i));-
3390 if (listItem->position() >= viewEndPos)
listItem->posi... >= viewEndPosDescription
TRUEevaluated 102 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
18-102
3391 break;
executed 102 times by 1 test: break;
Executed by:
  • tst_qquicklistview
102
3392 if (!listItem->transitionScheduledOrRunning()) {
!listItem->tra...ledOrRunning()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicklistview
FALSEnever evaluated
0-18
3393 qreal pos = listItem->position();-
3394 listItem->setPosition(pos - sizeRemoved);-
3395 listItem->transitionNextReposition(transitioner, QQuickItemViewTransitioner::RemoveTransition, false);-
3396 listItem->setPosition(pos);-
3397 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
18
3398 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicklistview
18
3399}
executed 240 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicklistview
240
3400-
3401/*!-
3402 \qmlmethod QtQuick::ListView::positionViewAtIndex(int index, PositionMode mode)-
3403-
3404 Positions the view such that the \a index is at the position specified by-
3405 \a mode:-
3406-
3407 \list-
3408 \li ListView.Beginning - position item at the top (or left for horizontal orientation) of the view.-
3409 \li ListView.Center - position item in the center of the view.-
3410 \li ListView.End - position item at bottom (or right for horizontal orientation) of the view.-
3411 \li ListView.Visible - if any part of the item is visible then take no action, otherwise-
3412 bring the item into view.-
3413 \li ListView.Contain - ensure the entire item is visible. If the item is larger than-
3414 the view the item is positioned at the top (or left for horizontal orientation) of the view.-
3415 \li ListView.SnapPosition - position the item at \l preferredHighlightBegin. This mode-
3416 is only valid if \l highlightRangeMode is StrictlyEnforceRange or snapping is enabled-
3417 via \l snapMode.-
3418 \endlist-
3419-
3420 If positioning the view at \a index would cause empty space to be displayed at-
3421 the beginning or end of the view, the view will be positioned at the boundary.-
3422-
3423 It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view-
3424 at a particular index. This is unreliable since removing items from the start-
3425 of the list does not cause all other items to be repositioned, and because-
3426 the actual start of the view can vary based on the size of the delegates.-
3427 The correct way to bring an item into view is with \c positionViewAtIndex.-
3428-
3429 \b Note: methods should only be called after the Component has completed. To position-
3430 the view at startup, this method should be called by Component.onCompleted. For-
3431 example, to position the view at the end:-
3432-
3433 \code-
3434 Component.onCompleted: positionViewAtIndex(count - 1, ListView.Beginning)-
3435 \endcode-
3436*/-
3437-
3438/*!-
3439 \qmlmethod QtQuick::ListView::positionViewAtBeginning()-
3440 \qmlmethod QtQuick::ListView::positionViewAtEnd()-
3441-
3442 Positions the view at the beginning or end, taking into account any header or footer.-
3443-
3444 It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view-
3445 at a particular index. This is unreliable since removing items from the start-
3446 of the list does not cause all other items to be repositioned, and because-
3447 the actual start of the view can vary based on the size of the delegates.-
3448-
3449 \b Note: methods should only be called after the Component has completed. To position-
3450 the view at startup, this method should be called by Component.onCompleted. For-
3451 example, to position the view at the end on startup:-
3452-
3453 \code-
3454 Component.onCompleted: positionViewAtEnd()-
3455 \endcode-
3456*/-
3457-
3458/*!-
3459 \qmlmethod int QtQuick::ListView::indexAt(real x, real y)-
3460-
3461 Returns the index of the visible item containing the point \a x, \a y in content-
3462 coordinates. If there is no item at the point specified, or the item is-
3463 not visible -1 is returned.-
3464-
3465 If the item is outside the visible area, -1 is returned, regardless of-
3466 whether an item will exist at that point when scrolled into view.-
3467-
3468 \b Note: methods should only be called after the Component has completed.-
3469*/-
3470-
3471/*!-
3472 \qmlmethod Item QtQuick::ListView::itemAt(real x, real y)-
3473-
3474 Returns the visible item containing the point \a x, \a y in content-
3475 coordinates. If there is no item at the point specified, or the item is-
3476 not visible null is returned.-
3477-
3478 If the item is outside the visible area, null is returned, regardless of-
3479 whether an item will exist at that point when scrolled into view.-
3480-
3481 \b Note: methods should only be called after the Component has completed.-
3482*/-
3483-
3484/*!-
3485 \qmlmethod QtQuick::ListView::forceLayout()-
3486-
3487 Responding to changes in the model is usually batched to happen only once-
3488 per frame. This means that inside script blocks it is possible for the-
3489 underlying model to have changed, but the ListView has not caught up yet.-
3490-
3491 This method forces the ListView to immediately respond to any outstanding-
3492 changes in the model.-
3493-
3494 \since 5.1-
3495-
3496 \b Note: methods should only be called after the Component has completed.-
3497*/-
3498-
3499QQuickListViewAttached *QQuickListView::qmlAttachedProperties(QObject *obj)-
3500{-
3501 return new QQuickListViewAttached(obj);
executed 32708 times by 10 tests: return new QQuickListViewAttached(obj);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
32708
3502}-
3503-
3504QT_END_NAMESPACE-
3505-
3506#include "moc_qquicklistview_p.cpp"-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0