OpenCoverage

qquickgridview.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickgridview.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14class FxGridItemSG : public FxViewItem-
15{-
16public:-
17 FxGridItemSG(QQuickItem *i, QQuickGridView *v, bool own) : FxViewItem(i, v, own, static_cast<QQuickItemViewAttached*>(qmlAttachedPropertiesObject<QQuickGridView>(i))), view(v)-
18 {-
19 }
executed 51741 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
51741
20-
21 qreal position() const override {-
22 return
executed 61291 times by 4 tests: return rowPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
rowPos();
executed 61291 times by 4 tests: return rowPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
61291
23 }-
24-
25 qreal endPosition() const override {-
26 return
executed 16817 times by 3 tests: return endRowPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
endRowPos();
executed 16817 times by 3 tests: return endRowPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
16817
27 }-
28-
29 qreal size() const override {-
30 return
executed 13616 times by 3 tests: return view->flow() == QQuickGridView::FlowLeftToRight ? view->cellHeight() : view->cellWidth();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
view->flow() == QQuickGridView::FlowLeftToRight ? view->cellHeight() : view->cellWidth();
executed 13616 times by 3 tests: return view->flow() == QQuickGridView::FlowLeftToRight ? view->cellHeight() : view->cellWidth();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
13616
31 }-
32-
33 qreal sectionSize() const override {-
34 return
executed 12548 times by 3 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
0.0;
executed 12548 times by 3 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
12548
35 }-
36-
37 qreal rowPos() const {-
38 if (view->flow() == QQuickGridView::FlowLeftToRight
view->flow() =...lowLeftToRightDescription
TRUEevaluated 375994 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 338667 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
338667-375994
39 return
executed 375994 times by 4 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -view->cellHeight()-itemY() : itemY());
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
(view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -view->cellHeight()-itemY() : itemY());
executed 375994 times by 4 tests: return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -view->cellHeight()-itemY() : itemY());
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
375994
40 else-
41 return
executed 338667 times by 1 test: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -view->cellWidth()-itemX() : itemX());
Executed by:
  • tst_qquickgridview
(view->effectiveLayoutDirection() == Qt::RightToLeft ? -view->cellWidth()-itemX() : itemX());
executed 338667 times by 1 test: return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -view->cellWidth()-itemX() : itemX());
Executed by:
  • tst_qquickgridview
338667
42 }-
43-
44 qreal colPos() const {-
45 if (view->flow() == QQuickGridView::FlowLeftToRight
view->flow() =...lowLeftToRightDescription
TRUEevaluated 85100 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 67873 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
67873-85100
46 if (view->effectiveLayoutDirection() == Qt::RightToLeft
view->effectiv...t::RightToLeftDescription
TRUEevaluated 14264 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 70836 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
14264-70836
47 qreal colSize = view->cellWidth();-
48 int columns = view->width()/colSize;-
49 return
executed 14264 times by 1 test: return colSize * (columns-1) - itemX();
Executed by:
  • tst_qquickgridview
colSize * (columns-1) - itemX();
executed 14264 times by 1 test: return colSize * (columns-1) - itemX();
Executed by:
  • tst_qquickgridview
14264
50 } else {-
51 return
executed 70836 times by 4 tests: return itemX();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
itemX();
executed 70836 times by 4 tests: return itemX();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
70836
52 }-
53 } else {-
54 if (view->verticalLayoutDirection() == QQuickItemView::BottomToTop
view->vertical...w::BottomToTopDescription
TRUEevaluated 13434 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 54439 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
13434-54439
55 return
executed 13434 times by 1 test: return -view->cellHeight() - itemY();
Executed by:
  • tst_qquickgridview
-view->cellHeight() - itemY();
executed 13434 times by 1 test: return -view->cellHeight() - itemY();
Executed by:
  • tst_qquickgridview
13434
56 } else {-
57 return
executed 54439 times by 1 test: return itemY();
Executed by:
  • tst_qquickgridview
itemY();
executed 54439 times by 1 test: return itemY();
Executed by:
  • tst_qquickgridview
54439
58 }-
59 }-
60 }-
61 qreal endRowPos() const {-
62 if (view->flow() == QQuickGridView::FlowLeftToRight
view->flow() =...lowLeftToRightDescription
TRUEevaluated 11557 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 5260 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
5260-11557
63 if (view->verticalLayoutDirection() == QQuickItemView::BottomToTop
view->vertical...w::BottomToTopDescription
TRUEevaluated 2332 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 9225 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
)
2332-9225
64 return
executed 2332 times by 1 test: return -itemY();
Executed by:
  • tst_qquickgridview
-itemY();
executed 2332 times by 1 test: return -itemY();
Executed by:
  • tst_qquickgridview
2332
65 else-
66 return
executed 9225 times by 3 tests: return itemY() + view->cellHeight();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
itemY() + view->cellHeight();
executed 9225 times by 3 tests: return itemY() + view->cellHeight();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
9225
67 } else {-
68 if (view->effectiveLayoutDirection() == Qt::RightToLeft
view->effectiv...t::RightToLeftDescription
TRUEevaluated 2790 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2470 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
2470-2790
69 return
executed 2790 times by 1 test: return -itemX();
Executed by:
  • tst_qquickgridview
-itemX();
executed 2790 times by 1 test: return -itemX();
Executed by:
  • tst_qquickgridview
2790
70 else-
71 return
executed 2470 times by 1 test: return itemX() + view->cellWidth();
Executed by:
  • tst_qquickgridview
itemX() + view->cellWidth();
executed 2470 times by 1 test: return itemX() + view->cellWidth();
Executed by:
  • tst_qquickgridview
2470
72 }-
73 }-
74 void setPosition(qreal col, qreal row, bool immediate = false) {-
75 moveTo(pointForPosition(col, row), immediate);-
76 }
executed 122852 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
122852
77 bool contains(qreal x, qreal y) const override {-
78 return
executed 62 times by 1 test: return (x >= itemX() && x < itemX() + view->cellWidth() && y >= itemY() && y < itemY() + view->cellHeight());
Executed by:
  • tst_qquickgridview
(x >= itemX() && x < itemX() + view->cellWidth() &&
executed 62 times by 1 test: return (x >= itemX() && x < itemX() + view->cellWidth() && y >= itemY() && y < itemY() + view->cellHeight());
Executed by:
  • tst_qquickgridview
62
79 y >= itemY() && y < itemY() + view->cellHeight());
executed 62 times by 1 test: return (x >= itemX() && x < itemX() + view->cellWidth() && y >= itemY() && y < itemY() + view->cellHeight());
Executed by:
  • tst_qquickgridview
62
80 }-
81-
82 QQuickGridView *view;-
83-
84private:-
85 QPointF pointForPosition(qreal col, qreal row) const {-
86 qreal x;-
87 qreal y;-
88 if (view->flow() == QQuickGridView::FlowLeftToRight
view->flow() =...lowLeftToRightDescription
TRUEevaluated 74295 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 48557 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
48557-74295
89 x = col;-
90 y = row;-
91 if (view->effectiveLayoutDirection() == Qt::RightToLeft
view->effectiv...t::RightToLeftDescription
TRUEevaluated 19984 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 54311 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
19984-54311
92 int columns = view->width()/view->cellWidth();-
93 x = view->cellWidth() * (columns-1) - col;-
94 }
executed 19984 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
19984
95 }
executed 74295 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
else {
74295
96 x = row;-
97 y = col;-
98 if (view->effectiveLayoutDirection() == Qt::RightToLeft
view->effectiv...t::RightToLeftDescription
TRUEevaluated 24538 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 24019 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
24019-24538
99 x = -view->cellWidth() - row;
executed 24538 times by 1 test: x = -view->cellWidth() - row;
Executed by:
  • tst_qquickgridview
24538
100 }
executed 48557 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
48557
101 if (view->verticalLayoutDirection() == QQuickItemView::BottomToTop
view->vertical...w::BottomToTopDescription
TRUEevaluated 40896 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 81956 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
)
40896-81956
102 y = -view->cellHeight() - y;
executed 40896 times by 1 test: y = -view->cellHeight() - y;
Executed by:
  • tst_qquickgridview
40896
103 return
executed 122852 times by 4 tests: return QPointF(x, y);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
QPointF(x, y);
executed 122852 times by 4 tests: return QPointF(x, y);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
122852
104 }-
105};-
106-
107-
108-
109class QQuickGridViewPrivate : public QQuickItemViewPrivate-
110{-
111 inline QQuickGridView* q_func() { return static_cast<QQuickGridView *>(q_ptr); } inline const QQuickGridView* q_func() const { return static_cast<const QQuickGridView *>(q_ptr); } friend class QQuickGridView;-
112-
113public:-
114 Qt::Orientation layoutOrientation() const override;-
115 bool isContentFlowReversed() const override;-
116-
117 qreal positionAt(int index) const override;-
118 qreal endPositionAt(int index) const override;-
119 qreal originPosition() const override;-
120 qreal lastPosition() const override;-
121-
122 qreal rowSize() const;-
123 qreal colSize() const;-
124 qreal colPosAt(int modelIndex) const;-
125 qreal rowPosAt(int modelIndex) const;-
126 qreal snapPosAt(qreal pos) const;-
127 FxViewItem *snapItemAt(qreal pos) const;-
128 int snapIndex() const;-
129 qreal contentXForPosition(qreal pos) const;-
130 qreal contentYForPosition(qreal pos) const;-
131-
132 void resetColumns();-
133-
134 bool addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer) override;-
135 bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) override;-
136-
137 void removeItem(FxViewItem *item);-
138-
139 FxViewItem *newViewItem(int index, QQuickItem *item) override;-
140 void initializeViewItem(FxViewItem *item) override;-
141 void repositionItemAt(FxViewItem *item, int index, qreal sizeBuffer) override;-
142 void repositionPackageItemAt(QQuickItem *item, int index) override;-
143 void resetFirstItemPosition(qreal pos = 0.0) override;-
144 void adjustFirstItem(qreal forwards, qreal backwards, int changeBeforeVisible) override;-
145-
146 void createHighlight() override;-
147 void updateHighlight() override;-
148 void resetHighlightPosition() override;-
149-
150 void setPosition(qreal pos) override;-
151 void layoutVisibleItems(int fromModelIndex = 0) override;-
152 bool applyInsertionChange(const QQmlChangeSet::Change &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView) override;-
153 void translateAndTransitionItemsAfter(int afterModelIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult) override;-
154 bool needsRefillForAddedOrRemovedIndex(int index) const override;-
155-
156 qreal headerSize() const override;-
157 qreal footerSize() const override;-
158 bool showHeaderForIndex(int index) const override;-
159 bool showFooterForIndex(int index) const override;-
160 void updateHeader() override;-
161 void updateFooter() override;-
162-
163 void changedVisibleIndex(int newIndex) override;-
164 void initializeCurrentItem() override;-
165-
166 void updateViewport() override;-
167 void fixupPosition() override;-
168 void fixup(AxisData &data, qreal minExtent, qreal maxExtent) override;-
169 bool flick(QQuickItemViewPrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,-
170 QQuickTimeLineCallback::Callback fixupCallback, qreal velocity) override;-
171-
172 QQuickGridView::Flow flow;-
173 qreal cellWidth;-
174 qreal cellHeight;-
175 int columns;-
176 QQuickGridView::SnapMode snapMode;-
177-
178 QSmoothedAnimation *highlightXAnimator;-
179 QSmoothedAnimation *highlightYAnimator;-
180-
181 QQuickGridViewPrivate()-
182 : flow(QQuickGridView::FlowLeftToRight)-
183 , cellWidth(100), cellHeight(100), columns(1)-
184 , snapMode(QQuickGridView::NoSnap)-
185 , highlightXAnimator(nullptr), highlightYAnimator(nullptr)-
186 {}
executed 1782 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1782
187 ~QQuickGridViewPrivate()-
188 {-
189 delete highlightXAnimator;-
190 delete highlightYAnimator;-
191 }
executed 1782 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1782
192};-
193-
194Qt::Orientation QQuickGridViewPrivate::layoutOrientation() const-
195{-
196 return
executed 384171 times by 4 tests: return flow == QQuickGridView::FlowLeftToRight ? Qt::Vertical : Qt::Horizontal;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
flow == QQuickGridView::FlowLeftToRight ? Qt::Vertical : Qt::Horizontal;
executed 384171 times by 4 tests: return flow == QQuickGridView::FlowLeftToRight ? Qt::Vertical : Qt::Horizontal;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
384171
197}-
198-
199bool QQuickGridViewPrivate::isContentFlowReversed() const-
200{-
201 const QQuickGridView * const q = q_func();-
202-
203 return
executed 204260 times by 4 tests: return (flow == QQuickGridView::FlowLeftToRight && verticalLayoutDirection == QQuickItemView::BottomToTop) || (flow == QQuickGridView::FlowTopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
(flow == QQuickGridView::FlowLeftToRight && verticalLayoutDirection == QQuickItemView::BottomToTop)
executed 204260 times by 4 tests: return (flow == QQuickGridView::FlowLeftToRight && verticalLayoutDirection == QQuickItemView::BottomToTop) || (flow == QQuickGridView::FlowTopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
204260
204 || (flow == QQuickGridView::FlowTopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft);
executed 204260 times by 4 tests: return (flow == QQuickGridView::FlowLeftToRight && verticalLayoutDirection == QQuickItemView::BottomToTop) || (flow == QQuickGridView::FlowTopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
204260
205}-
206-
207void QQuickGridViewPrivate::changedVisibleIndex(int newIndex)-
208{-
209 visibleIndex = newIndex / columns * columns;-
210}
executed 56 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
56
211-
212void QQuickGridViewPrivate::setPosition(qreal pos)-
213{-
214 QQuickGridView * const q = q_func();-
215 q->QQuickFlickable::setContentX(contentXForPosition(pos));-
216 q->QQuickFlickable::setContentY(contentYForPosition(pos));-
217}
executed 4555 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
4555
218-
219qreal QQuickGridViewPrivate::originPosition() const-
220{-
221 qreal pos = 0;-
222 if (!visibleItems.isEmpty()
!visibleItems.isEmpty()Description
TRUEevaluated 22995 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 11274 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
)
11274-22995
223 pos = static_cast<FxGridItemSG*>(visibleItems.first())->rowPos() - visibleIndex / columns * rowSize();
executed 22995 times by 4 tests: pos = static_cast<FxGridItemSG*>(visibleItems.first())->rowPos() - visibleIndex / columns * rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
22995
224 return
executed 34269 times by 4 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
pos;
executed 34269 times by 4 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
34269
225}-
226-
227qreal QQuickGridViewPrivate::lastPosition() const-
228{-
229 qreal pos = 0;-
230 if (model && (model->count()
model->count()Description
TRUEevaluated 23701 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| !visibleItems.isEmpty()
!visibleItems.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickgridview
)) {
2-23701
231 qreal lastRowPos = model->count()
model->count()Description
TRUEevaluated 23701 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
? rowPosAt(model->count() - 1) : 0;
2-23701
232 if (!visibleItems.isEmpty()
!visibleItems.isEmpty()Description
TRUEevaluated 19743 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 3960 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
) {
3960-19743
233-
234 lastRowPos = qMax(lastRowPos, static_cast<FxGridItemSG*>(visibleItems.last())->rowPos());-
235 }
executed 19743 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
19743
236 pos = lastRowPos + rowSize();-
237 }
executed 23703 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
23703
238 return
executed 24955 times by 4 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
pos;
executed 24955 times by 4 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
24955
239}-
240-
241qreal QQuickGridViewPrivate::positionAt(int index) const-
242{-
243 return
executed 12241 times by 4 tests: return rowPosAt(index);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
rowPosAt(index);
executed 12241 times by 4 tests: return rowPosAt(index);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
12241
244}-
245-
246qreal QQuickGridViewPrivate::endPositionAt(int index) const-
247{-
248 return
executed 14266 times by 4 tests: return rowPosAt(index) + rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
rowPosAt(index) + rowSize();
executed 14266 times by 4 tests: return rowPosAt(index) + rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
14266
249}-
250-
251qreal QQuickGridViewPrivate::rowSize() const {-
252 return
executed 602888 times by 4 tests: return flow == QQuickGridView::FlowLeftToRight ? cellHeight : cellWidth;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
flow == QQuickGridView::FlowLeftToRight ? cellHeight : cellWidth;
executed 602888 times by 4 tests: return flow == QQuickGridView::FlowLeftToRight ? cellHeight : cellWidth;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
602888
253}-
254qreal QQuickGridViewPrivate::colSize() const {-
255 return
executed 417056 times by 4 tests: return flow == QQuickGridView::FlowLeftToRight ? cellWidth : cellHeight;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
flow == QQuickGridView::FlowLeftToRight ? cellWidth : cellHeight;
executed 417056 times by 4 tests: return flow == QQuickGridView::FlowLeftToRight ? cellWidth : cellHeight;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
417056
256}-
257-
258qreal QQuickGridViewPrivate::colPosAt(int modelIndex) const-
259{-
260 if (FxViewItem *item = visibleItem(modelIndex)
FxViewItem *it...em(modelIndex)Description
TRUEevaluated 24370 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 2249 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
)
2249-24370
261 return
executed 24370 times by 4 tests: return static_cast<FxGridItemSG*>(item)->colPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
static_cast<FxGridItemSG*>(item)->colPos();
executed 24370 times by 4 tests: return static_cast<FxGridItemSG*>(item)->colPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
24370
262 if (!visibleItems.isEmpty()
!visibleItems.isEmpty()Description
TRUEevaluated 287 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1962 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
) {
287-1962
263 if (modelIndex == visibleIndex
modelIndex == visibleIndexDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 281 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
6-281
264 FxGridItemSG *firstItem = static_cast<FxGridItemSG*>(visibleItems.first());-
265 return
executed 6 times by 1 test: return firstItem->colPos();
Executed by:
  • tst_qquickgridview
firstItem->colPos();
executed 6 times by 1 test: return firstItem->colPos();
Executed by:
  • tst_qquickgridview
6
266 } else if (modelIndex < visibleIndex
modelIndex < visibleIndexDescription
TRUEevaluated 85 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 196 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
85-196
267 int count = (visibleIndex - modelIndex) % columns;-
268 int col = static_cast<FxGridItemSG*>(visibleItems.first())->colPos() / colSize();-
269 col = (columns - count + col) % columns;-
270 return
executed 85 times by 1 test: return col * colSize();
Executed by:
  • tst_qquickgridview
col * colSize();
executed 85 times by 1 test: return col * colSize();
Executed by:
  • tst_qquickgridview
85
271 } else {-
272 FxGridItemSG *lastItem = static_cast<FxGridItemSG*>(visibleItems.last());-
273 int count = modelIndex - lastItem->index;-
274 int col = lastItem->colPos() / colSize();-
275 col = (col + count) % columns;-
276 return
executed 196 times by 1 test: return col * colSize();
Executed by:
  • tst_qquickgridview
col * colSize();
executed 196 times by 1 test: return col * colSize();
Executed by:
  • tst_qquickgridview
196
277 }-
278 }-
279 return
executed 1962 times by 3 tests: return (modelIndex % columns) * colSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
(modelIndex % columns) * colSize();
executed 1962 times by 3 tests: return (modelIndex % columns) * colSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
1962
280}-
281-
282qreal QQuickGridViewPrivate::rowPosAt(int modelIndex) const-
283{-
284 if (FxViewItem *item = visibleItem(modelIndex)
FxViewItem *it...em(modelIndex)Description
TRUEevaluated 59550 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 38790 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
)
38790-59550
285 return
executed 59550 times by 4 tests: return static_cast<FxGridItemSG*>(item)->rowPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
static_cast<FxGridItemSG*>(item)->rowPos();
executed 59550 times by 4 tests: return static_cast<FxGridItemSG*>(item)->rowPos();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
59550
286 if (!visibleItems.isEmpty()
!visibleItems.isEmpty()Description
TRUEevaluated 23558 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 15232 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
15232-23558
287 if (modelIndex == visibleIndex
modelIndex == visibleIndexDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 23544 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
14-23544
288 FxGridItemSG *firstItem = static_cast<FxGridItemSG*>(visibleItems.first());-
289 return
executed 14 times by 1 test: return firstItem->rowPos();
Executed by:
  • tst_qquickgridview
firstItem->rowPos();
executed 14 times by 1 test: return firstItem->rowPos();
Executed by:
  • tst_qquickgridview
14
290 } else if (modelIndex < visibleIndex
modelIndex < visibleIndexDescription
TRUEevaluated 1670 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 21874 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
1670-21874
291 FxGridItemSG *firstItem = static_cast<FxGridItemSG*>(visibleItems.first());-
292 int firstCol = firstItem->colPos() / colSize();-
293 int col = visibleIndex - modelIndex + (columns - firstCol - 1);-
294 int rows = col / columns;-
295 return
executed 1670 times by 1 test: return firstItem->rowPos() - rows * rowSize();
Executed by:
  • tst_qquickgridview
firstItem->rowPos() - rows * rowSize();
executed 1670 times by 1 test: return firstItem->rowPos() - rows * rowSize();
Executed by:
  • tst_qquickgridview
1670
296 } else {-
297 FxGridItemSG *lastItem = static_cast<FxGridItemSG*>(visibleItems.last());-
298 int count = modelIndex - lastItem->index;-
299 int col = lastItem->colPos() + count * colSize();-
300 int rows = col / (columns * colSize());-
301 return
executed 21874 times by 2 tests: return lastItem->rowPos() + rows * rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
lastItem->rowPos() + rows * rowSize();
executed 21874 times by 2 tests: return lastItem->rowPos() + rows * rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
21874
302 }-
303 }-
304 return
executed 15232 times by 4 tests: return (modelIndex / columns) * rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
(modelIndex / columns) * rowSize();
executed 15232 times by 4 tests: return (modelIndex / columns) * rowSize();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
15232
305}-
306-
307-
308qreal QQuickGridViewPrivate::snapPosAt(qreal pos) const-
309{-
310 const QQuickGridView * const q = q_func();-
311 qreal snapPos = 0;-
312 if (!visibleItems.isEmpty()
!visibleItems.isEmpty()Description
TRUEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-138
313 qreal highlightStart = highlightRangeStart;-
314 pos += highlightStart;-
315 pos += rowSize()/2;-
316 snapPos = static_cast<FxGridItemSG*>(visibleItems.first())->rowPos() - visibleIndex / columns * rowSize();-
317 snapPos = pos - std::fmod(pos - snapPos, qreal(rowSize()));-
318 snapPos -= highlightStart;-
319 qreal maxExtent;-
320 qreal minExtent;-
321 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
46-92
322 maxExtent = q->minXExtent()-size();-
323 minExtent = q->maxXExtent()-size();-
324 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
46
325 maxExtent = flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -q->maxYExtent() : -q->maxXExtent();
46
326 minExtent = flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -q->minYExtent() : -q->minXExtent();
46
327 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
92
328 if (snapPos > maxExtent
snapPos > maxExtentDescription
TRUEnever evaluated
FALSEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-138
329 snapPos = maxExtent;
never executed: snapPos = maxExtent;
0
330 if (snapPos < minExtent
snapPos < minExtentDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
6-132
331 snapPos = minExtent;
executed 6 times by 1 test: snapPos = minExtent;
Executed by:
  • tst_qquickgridview
6
332 }
executed 138 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
138
333 return
executed 138 times by 1 test: return snapPos;
Executed by:
  • tst_qquickgridview
snapPos;
executed 138 times by 1 test: return snapPos;
Executed by:
  • tst_qquickgridview
138
334}-
335-
336FxViewItem *QQuickGridViewPrivate::snapItemAt(qreal pos) const-
337{-
338 for (FxViewItem *item : visibleItems) {-
339 if (item->index == -1
item->index == -1Description
TRUEnever evaluated
FALSEevaluated 3988 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-3988
340 continue;
never executed: continue;
0
341 qreal itemTop = item->position();-
342 if (itemTop+rowSize()/2 >= pos
itemTop+rowSize()/2 >= posDescription
TRUEevaluated 572 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 3416 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& itemTop - rowSize()/2 <= pos
itemTop - rowSize()/2 <= posDescription
TRUEevaluated 524 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
48-3416
343 return
executed 524 times by 1 test: return item;
Executed by:
  • tst_qquickgridview
item;
executed 524 times by 1 test: return item;
Executed by:
  • tst_qquickgridview
524
344 }
executed 3464 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
3464
345 return
executed 172 times by 1 test: return nullptr;
Executed by:
  • tst_qquickgridview
nullptr;
executed 172 times by 1 test: return nullptr;
Executed by:
  • tst_qquickgridview
172
346}-
347-
348int QQuickGridViewPrivate::snapIndex() const-
349{-
350 int index = currentIndex;-
351 for (FxViewItem *item : visibleItems) {-
352 if (item->index == -1
item->index == -1Description
TRUEnever evaluated
FALSEevaluated 23356 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-23356
353 continue;
never executed: continue;
0
354 qreal itemTop = item->position();-
355 FxGridItemSG *hItem = static_cast<FxGridItemSG*>(highlight);-
356 if (itemTop >= hItem->rowPos()-rowSize()/2
itemTop >= hIt...()-rowSize()/2Description
TRUEevaluated 2729 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 20627 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& itemTop < hItem->rowPos()+rowSize()/2
itemTop < hIte...()+rowSize()/2Description
TRUEevaluated 2385 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 344 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
344-20627
357 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(item);-
358 index = gridItem->index;-
359 if (gridItem->colPos() >= hItem->colPos()-colSize()/2
gridItem->colP...()-colSize()/2Description
TRUEevaluated 2385 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& gridItem->colPos() < hItem->colPos()+colSize()/2
gridItem->colP...()+colSize()/2Description
TRUEevaluated 2385 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-2385
360 return
executed 2385 times by 1 test: return gridItem->index;
Executed by:
  • tst_qquickgridview
gridItem->index;
executed 2385 times by 1 test: return gridItem->index;
Executed by:
  • tst_qquickgridview
2385
361 }
never executed: end of block
0
362 }
executed 20971 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
20971
363 return
executed 87 times by 1 test: return index;
Executed by:
  • tst_qquickgridview
index;
executed 87 times by 1 test: return index;
Executed by:
  • tst_qquickgridview
87
364}-
365-
366qreal QQuickGridViewPrivate::contentXForPosition(qreal pos) const-
367{-
368 const QQuickGridView * const q = q_func();-
369 if (flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 4757 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1512 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
1512-4757
370-
371 if (q->effectiveLayoutDirection() == Qt::LeftToRight
q->effectiveLa...t::LeftToRightDescription
TRUEevaluated 4164 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 593 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
593-4164
372 return
executed 4164 times by 4 tests: return 0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
0;
executed 4164 times by 4 tests: return 0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
4164
373 } else {-
374 qreal colSize = cellWidth;-
375 int columns = q->width()/colSize;-
376 return
executed 593 times by 1 test: return -q->width() + (cellWidth * columns);
Executed by:
  • tst_qquickgridview
-q->width() + (cellWidth * columns);
executed 593 times by 1 test: return -q->width() + (cellWidth * columns);
Executed by:
  • tst_qquickgridview
593
377 }-
378 } else {-
379-
380 if (q->effectiveLayoutDirection() == Qt::LeftToRight
q->effectiveLa...t::LeftToRightDescription
TRUEevaluated 690 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 822 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
690-822
381 return
executed 690 times by 1 test: return pos;
Executed by:
  • tst_qquickgridview
pos;
executed 690 times by 1 test: return pos;
Executed by:
  • tst_qquickgridview
690
382 else-
383 return
executed 822 times by 1 test: return -pos - q->width();
Executed by:
  • tst_qquickgridview
-pos - q->width();
executed 822 times by 1 test: return -pos - q->width();
Executed by:
  • tst_qquickgridview
822
384 }-
385}-
386-
387qreal QQuickGridViewPrivate::contentYForPosition(qreal pos) const-
388{-
389 const QQuickGridView * const q = q_func();-
390 if (flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 4763 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1512 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
1512-4763
391-
392 if (verticalLayoutDirection == QQuickItemView::TopToBottom
verticalLayout...w::TopToBottomDescription
TRUEevaluated 4190 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 573 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
573-4190
393 return
executed 4190 times by 4 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
pos;
executed 4190 times by 4 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
4190
394 else-
395 return
executed 573 times by 1 test: return -pos - q->height();
Executed by:
  • tst_qquickgridview
-pos - q->height();
executed 573 times by 1 test: return -pos - q->height();
Executed by:
  • tst_qquickgridview
573
396 } else {-
397-
398 if (verticalLayoutDirection == QQuickItemView::TopToBottom
verticalLayout...w::TopToBottomDescription
TRUEevaluated 944 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 568 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
568-944
399 return
executed 944 times by 1 test: return 0;
Executed by:
  • tst_qquickgridview
0;
executed 944 times by 1 test: return 0;
Executed by:
  • tst_qquickgridview
944
400 else-
401 return
executed 568 times by 1 test: return -q->height();
Executed by:
  • tst_qquickgridview
-q->height();
executed 568 times by 1 test: return -q->height();
Executed by:
  • tst_qquickgridview
568
402 }-
403}-
404-
405void QQuickGridViewPrivate::resetColumns()-
406{-
407 QQuickGridView * const q = q_func();-
408 qreal length = flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 14283 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 4360 times by 1 test
Evaluated by:
  • tst_qquickgridview
? q->width() : q->height();
4360-14283
409 columns = qMax(1, qFloor(length / colSize()));-
410}
executed 18643 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
18643
411-
412FxViewItem *QQuickGridViewPrivate::newViewItem(int modelIndex, QQuickItem *item)-
413{-
414 QQuickGridView * const q = q_func();-
415 (void)modelIndex;;-
416 return
executed 49543 times by 4 tests: return new FxGridItemSG(item, q, false);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
new FxGridItemSG(item, q, false);
executed 49543 times by 4 tests: return new FxGridItemSG(item, q, false);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
49543
417}-
418-
419void QQuickGridViewPrivate::initializeViewItem(FxViewItem *item)-
420{-
421 QQuickItemViewPrivate::initializeViewItem(item);-
422-
423-
424 item->trackGeometry(true);-
425}
executed 49543 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
49543
426-
427bool QQuickGridViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer)-
428{-
429 qreal colPos = colPosAt(visibleIndex);-
430 qreal rowPos = rowPosAt(visibleIndex);-
431 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 21513 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1954 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
) {
1954-21513
432 FxGridItemSG *lastItem = static_cast<FxGridItemSG*>(visibleItems.constLast());-
433 rowPos = lastItem->rowPos();-
434 int colNum = qFloor((lastItem->colPos()+colSize()/2) / colSize());-
435 if (++
++colNum >= columnsDescription
TRUEevaluated 13620 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 7893 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
colNum >= columns
++colNum >= columnsDescription
TRUEevaluated 13620 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 7893 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
7893-13620
436 colNum = 0;-
437 rowPos += rowSize();-
438 }
executed 13620 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
13620
439 colPos = colNum * colSize();-
440 }
executed 21513 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
21513
441-
442 int modelIndex = findLastVisibleIndex();-
443 modelIndex = modelIndex < 0
modelIndex < 0Description
TRUEevaluated 1958 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 21509 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
? visibleIndex : modelIndex + 1;
1958-21509
444-
445 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 21513 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1954 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
&& (bufferFrom > rowPos + rowSize()*2
bufferFrom > r... + rowSize()*2Description
TRUEnever evaluated
FALSEevaluated 21513 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
0-21513
446 || bufferTo < rowPosAt(visibleIndex) - rowSize()
bufferTo < row...x) - rowSize()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 21507 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
)) {
6-21507
447-
448-
449 int count = (fillFrom - (rowPos + rowSize())) / (rowSize()) * columns;-
450 releaseVisibleItems();-
451 modelIndex += count;-
452 if (modelIndex >= model->count()
modelIndex >= model->count()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-6
453 modelIndex = model->count() - 1;
never executed: modelIndex = model->count() - 1;
0
454 else if (modelIndex < 0
modelIndex < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
2-4
455 modelIndex = 0;
executed 2 times by 1 test: modelIndex = 0;
Executed by:
  • tst_qquickgridview
2
456 modelIndex = modelIndex / columns * columns;-
457 visibleIndex = modelIndex;-
458 colPos = colPosAt(visibleIndex);-
459 rowPos = rowPosAt(visibleIndex);-
460 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
6
461-
462 int colNum = qFloor((colPos+colSize()/2) / colSize());-
463 FxGridItemSG *item = nullptr;-
464 bool changed = false;-
465-
466 QQmlIncubator::IncubationMode incubationMode = doBuffer
doBufferDescription
TRUEevaluated 6895 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 16572 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested;
6895-16572
467-
468 while (modelIndex < model->count()
modelIndex < model->count()Description
TRUEevaluated 53610 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 11039 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& rowPos <= fillTo + rowSize()*(columns - colNum)/(columns+1)
rowPos <= fill...m)/(columns+1)Description
TRUEevaluated 41802 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 11808 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
11039-53610
469 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 41802 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
; qt_category_enabled = false) QMessageLogger(__FILE__, 517, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: append item" << modelIndex << colPos << rowPos;
never executed: QMessageLogger(__FILE__, 517, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: append item" << modelIndex << colPos << rowPos;
0-41802
470 if (!(item = static_cast<FxGridItemSG*>(createItem(modelIndex, incubationMode)))
!(item = stati...ubationMode)))Description
TRUEevaluated 620 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 41182 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
)
620-41182
471 break;
executed 620 times by 1 test: break;
Executed by:
  • tst_qquickgridview
620
472 if (!transitioner
!transitionerDescription
TRUEevaluated 36648 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 4534 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
|| !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)
!transitioner-...nsition, true)Description
TRUEevaluated 4268 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 266 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
266-36648
473 item->setPosition(colPos, rowPos, true);
executed 40916 times by 3 tests: item->setPosition(colPos, rowPos, true);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
40916
474 QQuickItemPrivate::get(item->item)->setCulled(doBuffer);-
475 visibleItems.append(item);-
476 if (++
++colNum >= columnsDescription
TRUEevaluated 11151 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 30031 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
colNum >= columns
++colNum >= columnsDescription
TRUEevaluated 11151 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 30031 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
) {
11151-30031
477 colNum = 0;-
478 rowPos += rowSize();-
479 }
executed 11151 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
11151
480 colPos = colNum * colSize();-
481 ++modelIndex;-
482 changed = true;-
483 }
executed 41182 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
41182
484-
485 if (doBuffer
doBufferDescription
TRUEevaluated 6895 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 16572 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& requestedIndex != -1
requestedIndex != -1Description
TRUEevaluated 590 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6305 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
)
590-16572
486 return
executed 590 times by 1 test: return changed;
Executed by:
  • tst_qquickgridview
changed;
executed 590 times by 1 test: return changed;
Executed by:
  • tst_qquickgridview
590
487-
488-
489 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 22871 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
6-22871
490 FxGridItemSG *firstItem = static_cast<FxGridItemSG*>(visibleItems.constFirst());-
491 rowPos = firstItem->rowPos();-
492 colPos = firstItem->colPos();-
493 }
executed 22871 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
22871
494 colNum = qFloor((colPos+colSize()/2) / colSize());-
495 if (--
--colNum < 0Description
TRUEevaluated 21102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1775 times by 1 test
Evaluated by:
  • tst_qquickgridview
colNum < 0
--colNum < 0Description
TRUEevaluated 21102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1775 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
1775-21102
496 colNum = columns - 1;-
497 rowPos -= rowSize();-
498 }
executed 21102 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
21102
499-
500-
501 colPos = colNum * colSize();-
502 while (visibleIndex > 0
visibleIndex > 0Description
TRUEevaluated 6698 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 17876 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& rowPos + rowSize() - 1 >= fillFrom - rowSize()*(colNum+1)/(columns+1)
rowPos + rowSi...1)/(columns+1)Description
TRUEevaluated 1919 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4779 times by 1 test
Evaluated by:
  • tst_qquickgridview
){
1919-17876
503 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 1919 times by 1 test
Evaluated by:
  • tst_qquickgridview
; qt_category_enabled = false) QMessageLogger(__FILE__, 551, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: prepend item" << visibleIndex-1 << "top pos" << rowPos << colPos;
never executed: QMessageLogger(__FILE__, 551, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: prepend item" << visibleIndex-1 << "top pos" << rowPos << colPos;
0-1919
504 if (!(item = static_cast<FxGridItemSG*>(createItem(visibleIndex-1, incubationMode)))
!(item = stati...ubationMode)))Description
TRUEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1697 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
222-1697
505 break;
executed 222 times by 1 test: break;
Executed by:
  • tst_qquickgridview
222
506 --visibleIndex;-
507 if (!transitioner
!transitionerDescription
TRUEevaluated 1677 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)
!transitioner-...nsition, true)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-1677
508 item->setPosition(colPos, rowPos, true);
executed 1697 times by 1 test: item->setPosition(colPos, rowPos, true);
Executed by:
  • tst_qquickgridview
1697
509 QQuickItemPrivate::get(item->item)->setCulled(doBuffer);-
510 visibleItems.prepend(item);-
511 if (--
--colNum < 0Description
TRUEevaluated 537 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1160 times by 1 test
Evaluated by:
  • tst_qquickgridview
colNum < 0
--colNum < 0Description
TRUEevaluated 537 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1160 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
537-1160
512 colNum = columns-1;-
513 rowPos -= rowSize();-
514 }
executed 537 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
537
515 colPos = colNum * colSize();-
516 changed = true;-
517 }
executed 1697 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
1697
518-
519 return
executed 22877 times by 4 tests: return changed;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
changed;
executed 22877 times by 4 tests: return changed;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
22877
520}-
521-
522void QQuickGridViewPrivate::removeItem(FxViewItem *item)-
523{-
524 if (item->transitionScheduledOrRunning()
item->transiti...ledOrRunning()Description
TRUEevaluated 178 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 5872 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
178-5872
525 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 178 times by 1 test
Evaluated by:
  • tst_qquickgridview
; qt_category_enabled = false) QMessageLogger(__FILE__, 573, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "\tnot releasing animating item:" << item->index << item->item->objectName();
never executed: QMessageLogger(__FILE__, 573, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "\tnot releasing animating item:" << item->index << item->item->objectName();
0-178
526 item->releaseAfterTransition = true;-
527 releasePendingTransition.append(item);-
528 }
executed 178 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
178
529 releaseItem(item);-
530 }
executed 5872 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
5872
531}-
532-
533bool QQuickGridViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)-
534{-
535 FxGridItemSG *item = nullptr;-
536 bool changed = false;-
537-
538 while (visibleItems.count() > 1
visibleItems.count() > 1Description
TRUEevaluated 20325 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
114-20325
539 && (
(item = static...constFirst()))Description
TRUEevaluated 20325 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
item = static_cast<FxGridItemSG*>(visibleItems.constFirst()))
(item = static...constFirst()))Description
TRUEevaluated 20325 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-20325
540 && item->rowPos()+rowSize()-1 < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)
item->rowPos()...1)/(columns+1)Description
TRUEevaluated 3867 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 16458 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
3867-16458
541 if (item->attached->delayRemove()
item->attached->delayRemove()Description
TRUEnever evaluated
FALSEevaluated 3867 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-3867
542 break;
never executed: break;
0
543 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 3867 times by 1 test
Evaluated by:
  • tst_qquickgridview
; qt_category_enabled = false) QMessageLogger(__FILE__, 591, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
never executed: QMessageLogger(__FILE__, 591, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
0-3867
544 if (item->index != -1
item->index != -1Description
TRUEevaluated 3867 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-3867
545 visibleIndex++;
executed 3867 times by 1 test: visibleIndex++;
Executed by:
  • tst_qquickgridview
3867
546 visibleItems.removeFirst();-
547 removeItem(item);-
548 changed = true;-
549 }
executed 3867 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
3867
550 while (visibleItems.count() > 1
visibleItems.count() > 1Description
TRUEevaluated 18640 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
114-18640
551 && (
(item = static....constLast()))Description
TRUEevaluated 18640 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
item = static_cast<FxGridItemSG*>(visibleItems.constLast()))
(item = static....constLast()))Description
TRUEevaluated 18640 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-18640
552 && item->rowPos() > bufferTo + rowSize()*(columns - item->colPos()/colSize())/(columns+1)
item->rowPos()...))/(columns+1)Description
TRUEevaluated 2182 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 16458 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
2182-16458
553 if (item->attached->delayRemove()
item->attached->delayRemove()Description
TRUEnever evaluated
FALSEevaluated 2182 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-2182
554 break;
never executed: break;
0
555 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 2182 times by 1 test
Evaluated by:
  • tst_qquickgridview
; qt_category_enabled = false) QMessageLogger(__FILE__, 603, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
never executed: QMessageLogger(__FILE__, 603, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
0-2182
556 visibleItems.removeLast();-
557 removeItem(item);-
558 changed = true;-
559 }
executed 2182 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
2182
560-
561 return
executed 16572 times by 4 tests: return changed;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
changed;
executed 16572 times by 4 tests: return changed;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
16572
562}-
563-
564void QQuickGridViewPrivate::updateViewport()-
565{-
566 resetColumns();-
567 QQuickItemViewPrivate::updateViewport();-
568}
executed 14899 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
14899
569-
570void QQuickGridViewPrivate::layoutVisibleItems(int fromModelIndex)-
571{-
572 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 4174 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
62-4174
573 const qreal from = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 1389 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2785 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
? -position()-displayMarginBeginning-size() : position()-displayMarginBeginning;
1389-2785
574 const qreal to = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 1389 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2785 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
? -position()+displayMarginEnd : position()+size()+displayMarginEnd;
1389-2785
575-
576 FxGridItemSG *firstItem = static_cast<FxGridItemSG*>(visibleItems.constFirst());-
577 qreal rowPos = firstItem->rowPos();-
578 qreal colPos = firstItem->colPos();-
579 int col = visibleIndex % columns;-
580 if (colPos != col * colSize()
colPos != col * colSize()Description
TRUEevaluated 212 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 3962 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
212-3962
581 colPos = col * colSize();-
582 firstItem->setPosition(colPos, rowPos);-
583 }
executed 212 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
212
584 firstItem->setVisible(firstItem->rowPos() + rowSize() >= from && firstItem->rowPos() <= to);-
585 for (int i = 1; i < visibleItems.count()
i < visibleItems.count()Description
TRUEevaluated 72706 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 4174 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
; ++i) {
4174-72706
586 FxGridItemSG *item = static_cast<FxGridItemSG*>(visibleItems.at(i));-
587 if (++
++col >= columnsDescription
TRUEevaluated 19077 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 53629 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
col >= columns
++col >= columnsDescription
TRUEevaluated 19077 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 53629 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
) {
19077-53629
588 col = 0;-
589 rowPos += rowSize();-
590 }
executed 19077 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
19077
591 colPos = col * colSize();-
592 if (item->index >= fromModelIndex
item->index >= fromModelIndexDescription
TRUEevaluated 68848 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 3858 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
3858-68848
593 item->setPosition(colPos, rowPos);-
594 item->setVisible(item->rowPos() + rowSize() >= from && item->rowPos() <= to);-
595 }
executed 68848 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
68848
596 }
executed 72706 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
72706
597 }
executed 4174 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
4174
598}
executed 4236 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
4236
599-
600void QQuickGridViewPrivate::repositionItemAt(FxViewItem *item, int index, qreal sizeBuffer)-
601{-
602 int count = sizeBuffer / rowSize();-
603 static_cast<FxGridItemSG *>(item)->setPosition(colPosAt(index + count), rowPosAt(index + count));-
604}
executed 126 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
126
605-
606void QQuickGridViewPrivate::repositionPackageItemAt(QQuickItem *item, int index)-
607{-
608 QQuickGridView * const q = q_func();-
609 qreal pos = position();-
610 if (flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-28
611 if (item->y() + item->height() > pos
item->y() + it...height() > posDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& item->y() < pos + q->height()
item->y() < pos + q->height()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-28
612 qreal y = (
(verticalLayou...::TopToBottom)Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
verticalLayoutDirection == QQuickItemView::TopToBottom)
(verticalLayou...::TopToBottom)Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
0-28
613 ? rowPosAt(index)-
614 : -rowPosAt(index) - item->height();-
615 item->setPosition(QPointF(colPosAt(index), y));-
616 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
28
617 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
28
618 if (item->x() + item->width() > pos
item->x() + it...>width() > posDescription
TRUEnever evaluated
FALSEnever evaluated
&& item->x() < pos + q->width()
item->x() < pos + q->width()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
619 qreal y = (
(verticalLayou...::TopToBottom)Description
TRUEnever evaluated
FALSEnever evaluated
verticalLayoutDirection == QQuickItemView::TopToBottom)
(verticalLayou...::TopToBottom)Description
TRUEnever evaluated
FALSEnever evaluated
0
620 ? colPosAt(index)-
621 : -colPosAt(index) - item->height();-
622 if (flow == QQuickGridView::FlowTopToBottom
flow == QQuick...lowTopToBottomDescription
TRUEnever evaluated
FALSEnever evaluated
&& q->effectiveLayoutDirection() == Qt::RightToLeft
q->effectiveLa...t::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
623 item->setPosition(QPointF(-rowPosAt(index)-item->width(), y));
never executed: item->setPosition(QPointF(-rowPosAt(index)-item->width(), y));
0
624 else-
625 item->setPosition(QPointF(rowPosAt(index), y));
never executed: item->setPosition(QPointF(rowPosAt(index), y));
0
626 }-
627 }
never executed: end of block
0
628}-
629-
630void QQuickGridViewPrivate::resetFirstItemPosition(qreal pos)-
631{-
632 FxGridItemSG *item = static_cast<FxGridItemSG*>(visibleItems.constFirst());-
633 item->setPosition(0, pos);-
634}
executed 621 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
621
635-
636void QQuickGridViewPrivate::adjustFirstItem(qreal forwards, qreal backwards, int changeBeforeVisible)-
637{-
638 if (!visibleItems.count()
!visibleItems.count()Description
TRUEnever evaluated
FALSEevaluated 1936 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-1936
639 return;
never executed: return;
0
640-
641 int moveCount = (forwards - backwards) / rowSize();-
642 if (moveCount == 0
moveCount == 0Description
TRUEevaluated 1699 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 237 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& changeBeforeVisible != 0
changeBeforeVisible != 0Description
TRUEevaluated 170 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1529 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
170-1699
643 moveCount += (changeBeforeVisible % columns) - (columns - 1);
executed 170 times by 1 test: moveCount += (changeBeforeVisible % columns) - (columns - 1);
Executed by:
  • tst_qquickgridview
170
644-
645 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(visibleItems.constFirst());-
646 gridItem->setPosition(gridItem->colPos(), gridItem->rowPos() + ((moveCount / columns) * rowSize()));-
647}
executed 1936 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
1936
648-
649void QQuickGridViewPrivate::createHighlight()-
650{-
651 QQuickGridView * const q = q_func();-
652 bool changed = false;-
653 if (highlight
highlightDescription
TRUEevaluated 1986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 3934 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
1986-3934
654 if (trackedItem == highlight
trackedItem == highlightDescription
TRUEevaluated 1986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-1986
655 trackedItem = nullptr;
executed 1986 times by 4 tests: trackedItem = nullptr;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1986
656 delete highlight;-
657 highlight = nullptr;-
658-
659 delete highlightXAnimator;-
660 delete highlightYAnimator;-
661 highlightXAnimator = nullptr;-
662 highlightYAnimator = nullptr;-
663-
664 changed = true;-
665 }
executed 1986 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1986
666-
667 if (currentItem
currentItemDescription
TRUEevaluated 1986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 3934 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
1986-3934
668 QQuickItem *item = createHighlightItem();-
669 if (item
itemDescription
TRUEevaluated 1986 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-1986
670 FxGridItemSG *newHighlight = new FxGridItemSG(item, q, true);-
671 newHighlight->trackGeometry(true);-
672 if (autoHighlight
autoHighlightDescription
TRUEevaluated 1976 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
)
10-1976
673 resetHighlightPosition();
executed 1976 times by 4 tests: resetHighlightPosition();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1976
674 highlightXAnimator = new QSmoothedAnimation;-
675 highlightXAnimator->target = QQmlProperty(item, QLatin1String("x"));-
676 highlightXAnimator->userDuration = highlightMoveDuration;-
677 highlightYAnimator = new QSmoothedAnimation;-
678 highlightYAnimator->target = QQmlProperty(item, QLatin1String("y"));-
679 highlightYAnimator->userDuration = highlightMoveDuration;-
680-
681 highlight = newHighlight;-
682 changed = true;-
683 }
executed 1986 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1986
684 }
executed 1986 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1986
685 if (changed
changedDescription
TRUEevaluated 3970 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1950 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
)
1950-3970
686 q->highlightItemChanged();
executed 3970 times by 4 tests: q->highlightItemChanged();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
3970
687}
executed 5920 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
5920
688-
689void QQuickGridViewPrivate::updateHighlight()-
690{-
691 applyPendingChanges();-
692-
693 if ((!currentItem
!currentItemDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 9102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& highlight
highlightDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
) || (currentItem
currentItemDescription
TRUEevaluated 9102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& !highlight
!highlightDescription
TRUEevaluated 1984 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 7118 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
))
12-9102
694 createHighlight();
executed 2038 times by 4 tests: createHighlight();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
2038
695 bool strictHighlight = haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 618 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 8550 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& highlightRange == QQuickGridView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 614 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
;
4-8550
696 if (currentItem
currentItemDescription
TRUEevaluated 9102 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& autoHighlight
autoHighlightDescription
TRUEevaluated 9072 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
&& highlight
highlightDescription
TRUEevaluated 9072 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
&& (!strictHighlight
!strictHighlightDescription
TRUEevaluated 8458 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 614 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| !pressed
!pressedDescription
TRUEevaluated 520 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_qquickgridview
)) {
0-9102
697-
698 highlightXAnimator->to = currentItem->itemX();-
699 highlightYAnimator->to = currentItem->itemY();-
700 highlight->item->setSize(currentItem->item->size());-
701-
702 highlightXAnimator->restart();-
703 highlightYAnimator->restart();-
704 }
executed 8978 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
8978
705 updateTrackedItem();-
706}
executed 9168 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
9168
707-
708void QQuickGridViewPrivate::resetHighlightPosition()-
709{-
710 if (highlight
highlightDescription
TRUEevaluated 1854 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEevaluated 1976 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& currentItem
currentItemDescription
TRUEevaluated 1854 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
FALSEnever evaluated
) {
0-1976
711 FxGridItemSG *cItem = static_cast<FxGridItemSG*>(currentItem);-
712 static_cast<FxGridItemSG*>(highlight)->setPosition(cItem->colPos(), cItem->rowPos());-
713 }
executed 1854 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
1854
714}
executed 3830 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
3830
715-
716qreal QQuickGridViewPrivate::headerSize() const-
717{-
718 if (!header
!headerDescription
TRUEevaluated 41523 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 2688 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
2688-41523
719 return
executed 41523 times by 4 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
0.0;
executed 41523 times by 4 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
41523
720 return
executed 2688 times by 1 test: return flow == QQuickGridView::FlowLeftToRight ? header->item->height() : header->item->width();
Executed by:
  • tst_qquickgridview
flow == QQuickGridView::FlowLeftToRight ? header->item->height() : header->item->width();
executed 2688 times by 1 test: return flow == QQuickGridView::FlowLeftToRight ? header->item->height() : header->item->width();
Executed by:
  • tst_qquickgridview
2688
721}-
722-
723qreal QQuickGridViewPrivate::footerSize() const-
724{-
725 if (!footer
!footerDescription
TRUEevaluated 33518 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1335 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
1335-33518
726 return
executed 33518 times by 4 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
0.0;
executed 33518 times by 4 tests: return 0.0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
33518
727 return
executed 1335 times by 1 test: return flow == QQuickGridView::FlowLeftToRight? footer->item->height() : footer->item->width();
Executed by:
  • tst_qquickgridview
flow == QQuickGridView::FlowLeftToRight? footer->item->height() : footer->item->width();
executed 1335 times by 1 test: return flow == QQuickGridView::FlowLeftToRight? footer->item->height() : footer->item->width();
Executed by:
  • tst_qquickgridview
1335
728}-
729-
730bool QQuickGridViewPrivate::showHeaderForIndex(int index) const-
731{-
732 return
executed 6031 times by 3 tests: return index / columns == 0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
index / columns == 0;
executed 6031 times by 3 tests: return index / columns == 0;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
6031
733}-
734-
735bool QQuickGridViewPrivate::showFooterForIndex(int index) const-
736{-
737 return
executed 1028 times by 1 test: return index / columns == (model->count()-1) / columns;
Executed by:
  • tst_qquickgridview
index / columns == (model->count()-1) / columns;
executed 1028 times by 1 test: return index / columns == (model->count()-1) / columns;
Executed by:
  • tst_qquickgridview
1028
738}-
739-
740void QQuickGridViewPrivate::updateFooter()-
741{-
742 QQuickGridView * const q = q_func();-
743 bool created = false;-
744 if (!footer
!footerDescription
TRUEevaluated 10626 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 483 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
483-10626
745 QQuickItem *item = createComponentItem(footerComponent, 1.0);-
746 if (!item
!itemDescription
TRUEevaluated 10540 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
86-10540
747 return;
executed 10540 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
10540
748 footer = new FxGridItemSG(item, q, true);-
749 footer->trackGeometry(true);-
750 created = true;-
751 }
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
86
752-
753 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(footer);-
754 qreal colOffset = 0;-
755 qreal rowOffset = 0;-
756 if (q->effectiveLayoutDirection() == Qt::RightToLeft
q->effectiveLa...t::RightToLeftDescription
TRUEevaluated 192 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 377 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
192-377
757 if (flow == QQuickGridView::FlowTopToBottom
flow == QQuick...lowTopToBottomDescription
TRUEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
94-98
758 rowOffset += gridItem->item->width() - cellWidth;
executed 98 times by 1 test: rowOffset += gridItem->item->width() - cellWidth;
Executed by:
  • tst_qquickgridview
98
759 else-
760 colOffset += gridItem->item->width() - cellWidth;
executed 94 times by 1 test: colOffset += gridItem->item->width() - cellWidth;
Executed by:
  • tst_qquickgridview
94
761 }-
762 if (verticalLayoutDirection == QQuickItemView::BottomToTop
verticalLayout...w::BottomToTopDescription
TRUEevaluated 172 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 397 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
172-397
763 if (flow == QQuickGridView::FlowTopToBottom
flow == QQuick...lowTopToBottomDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
86
764 colOffset += gridItem->item->height() - cellHeight;
executed 86 times by 1 test: colOffset += gridItem->item->height() - cellHeight;
Executed by:
  • tst_qquickgridview
86
765 else-
766 rowOffset += gridItem->item->height() - cellHeight;
executed 86 times by 1 test: rowOffset += gridItem->item->height() - cellHeight;
Executed by:
  • tst_qquickgridview
86
767 }-
768 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 379 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 190 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
190-379
769 qreal endPos = lastPosition();-
770 if (findLastVisibleIndex() == model->count()-1
findLastVisibl...del->count()-1Description
TRUEevaluated 321 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
58-321
771 gridItem->setPosition(colOffset, endPos + rowOffset);-
772 }
executed 321 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
321
773 qreal visiblePos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEnever evaluated
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -position() : position() + size();
0-58
774 if (endPos <= visiblePos
endPos <= visiblePosDescription
TRUEnever evaluated
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| gridItem->endPosition() <= endPos + rowOffset
gridItem->endP...os + rowOffsetDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-58
775 gridItem->setPosition(colOffset, endPos + rowOffset);
executed 8 times by 1 test: gridItem->setPosition(colOffset, endPos + rowOffset);
Executed by:
  • tst_qquickgridview
8
776 }
executed 58 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
58
777 } else {-
778 gridItem->setPosition(colOffset, rowOffset);-
779 }
executed 190 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
190
780-
781 if (created
createdDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 483 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
86-483
782 q->footerItemChanged();
executed 86 times by 1 test: q->footerItemChanged();
Executed by:
  • tst_qquickgridview
86
783}
executed 569 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
569
784-
785void QQuickGridViewPrivate::updateHeader()-
786{-
787 QQuickGridView * const q = q_func();-
788 bool created = false;-
789 if (!header
!headerDescription
TRUEevaluated 10557 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 524 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
524-10557
790 QQuickItem *item = createComponentItem(headerComponent, 1.0);-
791 if (!item
!itemDescription
TRUEevaluated 10431 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 126 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
126-10431
792 return;
executed 10431 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
10431
793 header = new FxGridItemSG(item, q, true);-
794 header->trackGeometry(true);-
795 created = true;-
796 }
executed 126 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
126
797-
798 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(header);-
799 qreal colOffset = 0;-
800 qreal rowOffset = -headerSize();-
801 if (q->effectiveLayoutDirection() == Qt::RightToLeft
q->effectiveLa...t::RightToLeftDescription
TRUEevaluated 169 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 481 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
169-481
802 if (flow == QQuickGridView::FlowTopToBottom
flow == QQuick...lowTopToBottomDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 87 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
82-87
803 rowOffset += gridItem->item->width() - cellWidth;
executed 82 times by 1 test: rowOffset += gridItem->item->width() - cellWidth;
Executed by:
  • tst_qquickgridview
82
804 else-
805 colOffset += gridItem->item->width() - cellWidth;
executed 87 times by 1 test: colOffset += gridItem->item->width() - cellWidth;
Executed by:
  • tst_qquickgridview
87
806 }-
807 if (verticalLayoutDirection == QQuickItemView::BottomToTop
verticalLayout...w::BottomToTopDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 510 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
140-510
808 if (flow == QQuickGridView::FlowTopToBottom
flow == QQuick...lowTopToBottomDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
66-74
809 colOffset += gridItem->item->height() - cellHeight;
executed 74 times by 1 test: colOffset += gridItem->item->height() - cellHeight;
Executed by:
  • tst_qquickgridview
74
810 else-
811 rowOffset += gridItem->item->height() - cellHeight;
executed 66 times by 1 test: rowOffset += gridItem->item->height() - cellHeight;
Executed by:
  • tst_qquickgridview
66
812 }-
813 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 342 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 308 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
308-342
814 qreal startPos = originPosition();-
815 if (visibleIndex == 0
visibleIndex == 0Description
TRUEevaluated 295 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
47-295
816 gridItem->setPosition(colOffset, startPos + rowOffset);-
817 }
executed 295 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
295
818 qreal tempPos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -position()-size() : position();
0-47
819 qreal headerPos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qquickgridview
? gridItem->rowPos() + cellWidth - headerSize() : gridItem->rowPos();
0-47
820 if (tempPos <= startPos
tempPos <= startPosDescription
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| headerPos > startPos + rowOffset
headerPos > st...os + rowOffsetDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 41 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-47
821 gridItem->setPosition(colOffset, startPos + rowOffset);
executed 6 times by 1 test: gridItem->setPosition(colOffset, startPos + rowOffset);
Executed by:
  • tst_qquickgridview
6
822 }
executed 47 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
47
823 } else {-
824 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 228 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
80-228
825 gridItem->setPosition(colOffset, rowOffset);
executed 80 times by 1 test: gridItem->setPosition(colOffset, rowOffset);
Executed by:
  • tst_qquickgridview
80
826 else-
827 gridItem->setPosition(colOffset, -headerSize());
executed 228 times by 1 test: gridItem->setPosition(colOffset, -headerSize());
Executed by:
  • tst_qquickgridview
228
828 }-
829-
830 if (created
createdDescription
TRUEevaluated 126 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 524 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
126-524
831 q->headerItemChanged();
executed 126 times by 1 test: q->headerItemChanged();
Executed by:
  • tst_qquickgridview
126
832}
executed 650 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
650
833-
834void QQuickGridViewPrivate::initializeCurrentItem()-
835{-
836 if (currentItem
currentItemDescription
TRUEevaluated 3088 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
&& currentIndex >= 0
currentIndex >= 0Description
TRUEevaluated 3088 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-3088
837 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(currentItem);-
838 FxViewItem *actualItem = visibleItem(currentIndex);-
839-
840-
841 if ((!actualItem
!actualItemDescription
TRUEevaluated 131 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2957 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
|| !actualItem->transitionScheduledOrRunning()
!actualItem->t...ledOrRunning()Description
TRUEevaluated 2861 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickgridview
))
96-2957
842 gridItem->setPosition(colPosAt(currentIndex), rowPosAt(currentIndex));
executed 2992 times by 4 tests: gridItem->setPosition(colPosAt(currentIndex), rowPosAt(currentIndex));
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
2992
843 }
executed 3088 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
3088
844}
executed 3088 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
3088
845-
846void QQuickGridViewPrivate::fixupPosition()-
847{-
848 if (flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 3845 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 2114 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
2114-3845
849 fixupY();
executed 3845 times by 4 tests: fixupY();
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
3845
850 else-
851 fixupX();
executed 2114 times by 1 test: fixupX();
Executed by:
  • tst_qquickgridview
2114
852}-
853-
854void QQuickGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)-
855{-
856 if ((flow == QQuickGridView::FlowTopToBottom
flow == QQuick...lowTopToBottomDescription
TRUEevaluated 3544 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6293 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& &data == &vData
&data == &vDataDescription
TRUEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 3322 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
222-6293
857 || (flow == QQuickGridView::FlowLeftToRight
flow == QQuick...lowLeftToRightDescription
TRUEevaluated 6293 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 3322 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& &data == &hData
&data == &hDataDescription
TRUEevaluated 176 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 6117 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
))
176-6293
858 return;
executed 398 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
398
859-
860 fixupMode = moveReason == Mouse
moveReason == MouseDescription
TRUEevaluated 196 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 9243 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
? fixupMode : Immediate;
196-9243
861-
862 qreal viewPos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 3055 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6384 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
? -position()-size() : position();
3055-6384
863-
864 bool strictHighlightRange = haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 301 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 9138 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& highlightRange == QQuickGridView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 297 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
;
4-9138
865 if (snapMode != QQuickGridView::NoSnap
snapMode != QQ...idView::NoSnapDescription
TRUEevaluated 348 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 9091 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
) {
348-9091
866 qreal tempPosition = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 171 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 177 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -position()-size() : position();
171-177
867 if (snapMode == QQuickGridView::SnapOneRow
snapMode == QQ...ew::SnapOneRowDescription
TRUEevaluated 176 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& moveReason == Mouse
moveReason == MouseDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
88-176
868-
869 qreal dist = data.move.value() - data.pressPos;-
870 qreal bias = 0;-
871 if (data.velocity > 0
data.velocity > 0Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& dist > 30
dist > 30Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& dist < rowSize()/2
dist < rowSize()/2Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-46
872 bias = rowSize()/2;
executed 10 times by 1 test: bias = rowSize()/2;
Executed by:
  • tst_qquickgridview
10
873 else if (data.velocity < 0
data.velocity < 0Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& dist < -30
dist < -30Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& dist > -rowSize()/2
dist > -rowSize()/2Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
2-46
874 bias = -rowSize()/2;
executed 14 times by 1 test: bias = -rowSize()/2;
Executed by:
  • tst_qquickgridview
14
875 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
22-66
876 bias = -bias;
executed 22 times by 1 test: bias = -bias;
Executed by:
  • tst_qquickgridview
22
877 tempPosition -= bias;-
878 }
executed 88 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
88
879 FxViewItem *topItem = snapItemAt(tempPosition+highlightRangeStart);-
880 if (strictHighlightRange
strictHighlightRangeDescription
TRUEevaluated 237 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 111 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& currentItem
currentItemDescription
TRUEevaluated 169 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& (!topItem
!topItemDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 157 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| (topItem->index != currentIndex
topItem->index != currentIndexDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 145 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& fixupMode == Immediate
fixupMode == ImmediateDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
))) {
0-237
881-
882 updateHighlight();-
883 topItem = currentItem;-
884 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
12
885 FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd);-
886 if (strictHighlightRange
strictHighlightRangeDescription
TRUEevaluated 237 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 111 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& currentItem
currentItemDescription
TRUEevaluated 169 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& (!bottomItem
!bottomItemDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 155 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| (bottomItem->index != currentIndex
bottomItem->in...= currentIndexDescription
TRUEevaluated 143 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& fixupMode == Immediate
fixupMode == ImmediateDescription
TRUEevaluated 67 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickgridview
))) {
12-237
887-
888 updateHighlight();-
889 bottomItem = currentItem;-
890 }
executed 81 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
81
891 qreal pos;-
892 bool isInBounds = -
-position() > maxExtentDescription
TRUEevaluated 263 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 85 times by 1 test
Evaluated by:
  • tst_qquickgridview
position() > maxExtent
-position() > maxExtentDescription
TRUEevaluated 263 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 85 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& -
-position() <= minExtentDescription
TRUEevaluated 238 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_qquickgridview
position() <= minExtent
-position() <= minExtentDescription
TRUEevaluated 238 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_qquickgridview
;
25-263
893 if (topItem
topItemDescription
TRUEevaluated 278 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& (isInBounds
isInBoundsDescription
TRUEevaluated 168 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 110 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| strictHighlightRange
strictHighlightRangeDescription
TRUEevaluated 79 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_qquickgridview
)) {
31-278
894 qreal headerPos = header
headerDescription
TRUEnever evaluated
FALSEevaluated 247 times by 1 test
Evaluated by:
  • tst_qquickgridview
? static_cast<FxGridItemSG*>(header)->rowPos() : 0;
0-247
895 if (topItem->index == 0
topItem->index == 0Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& header
headerDescription
TRUEnever evaluated
FALSEevaluated 95 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& tempPosition+highlightRangeStart < headerPos+headerSize()/2
tempPosition+h...headerSize()/2Description
TRUEnever evaluated
FALSEnever evaluated
&& !strictHighlightRange
!strictHighlightRangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-152
896 pos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEnever evaluated
FALSEnever evaluated
? - headerPos + highlightRangeStart - size() : headerPos - highlightRangeStart;
0
897 }
never executed: end of block
else {
0
898 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 103 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
103-144
899 pos = qMax(qMin(-topItem->position() + highlightRangeStart - size(), -maxExtent), -minExtent);
executed 103 times by 1 test: pos = qMax(qMin(-topItem->position() + highlightRangeStart - size(), -maxExtent), -minExtent);
Executed by:
  • tst_qquickgridview
103
900 else-
901 pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
executed 144 times by 1 test: pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
Executed by:
  • tst_qquickgridview
144
902 }-
903 } else if (bottomItem
bottomItemDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& isInBounds
isInBoundsDescription
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
0-76
904 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
905 pos = qMax(qMin(-bottomItem->position() + highlightRangeEnd - size(), -maxExtent), -minExtent);
never executed: pos = qMax(qMin(-bottomItem->position() + highlightRangeEnd - size(), -maxExtent), -minExtent);
0
906 else-
907 pos = qMax(qMin(bottomItem->position() - highlightRangeEnd, -maxExtent), -minExtent);
never executed: pos = qMax(qMin(bottomItem->position() - highlightRangeEnd, -maxExtent), -minExtent);
0
908 } else {-
909 QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);-
910 return;
executed 101 times by 1 test: return;
Executed by:
  • tst_qquickgridview
101
911 }-
912-
913 qreal dist = qAbs(data.move + pos);-
914 if (dist > 0
dist > 0Description
TRUEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 109 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
109-138
915 timeline.reset(data.move);-
916 if (fixupMode != Immediate
fixupMode != ImmediateDescription
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
26-112
917 timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);-
918 data.fixingUp = true;-
919 }
executed 112 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
112
920 timeline.set(data.move, -pos);-
921 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
26
922 vTime = timeline.time();-
923 }
executed 138 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
138
924 }
executed 247 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else if (haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 9031 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
&& highlightRange == QQuickGridView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-9031
925 if (currentItem
currentItemDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
16-44
926 updateHighlight();-
927 qreal pos = static_cast<FxGridItemSG*>(currentItem)->rowPos();-
928 if (viewPos < pos + rowSize() - highlightRangeEnd
viewPos < pos ...hlightRangeEndDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
12-32
929 viewPos = pos + rowSize() - highlightRangeEnd;
executed 32 times by 1 test: viewPos = pos + rowSize() - highlightRangeEnd;
Executed by:
  • tst_qquickgridview
32
930 if (viewPos > pos - highlightRangeStart
viewPos > pos ...ightRangeStartDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-44
931 viewPos = pos - highlightRangeStart;
executed 44 times by 1 test: viewPos = pos - highlightRangeStart;
Executed by:
  • tst_qquickgridview
44
932 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
2-42
933 viewPos = -viewPos-size();
executed 2 times by 1 test: viewPos = -viewPos-size();
Executed by:
  • tst_qquickgridview
2
934 timeline.reset(data.move);-
935 if (viewPos != position()
viewPos != position()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
14-30
936 if (fixupMode != Immediate
fixupMode != ImmediateDescription
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
0-14
937 timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);-
938 data.fixingUp = true;-
939 }
never executed: end of block
else {
0
940 timeline.set(data.move, -viewPos);-
941 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
14
942 }-
943 vTime = timeline.time();-
944 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
44
945 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
60
946 QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);-
947 }
executed 9031 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
9031
948 data.inOvershoot = false;-
949 fixupMode = Normal;-
950}
executed 9338 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
9338
951-
952bool QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,-
953 QQuickTimeLineCallback::Callback fixupCallback, qreal velocity)-
954{-
955 data.fixingUp = false;-
956 moveReason = Mouse;-
957 if ((!haveHighlightRange
!haveHighlightRangeDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| highlightRange != QQuickGridView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-90
958 && snapMode == QQuickGridView::NoSnap
snapMode == QQ...idView::NoSnapDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
12-78
959 return
executed 12 times by 1 test: return QQuickItemViewPrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
Executed by:
  • tst_qquickgridview
QQuickItemViewPrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
executed 12 times by 1 test: return QQuickItemViewPrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
Executed by:
  • tst_qquickgridview
12
960 }-
961 qreal maxDistance = 0;-
962 qreal dataValue = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -data.move.value()+size() : data.move.value();
56-112
963-
964 if (velocity > 0
velocity > 0Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
82-86
965 if (data.move.value() < minExtent
data.move.value() < minExtentDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
8-74
966 if (snapMode == QQuickGridView::SnapOneRow
snapMode == QQ...ew::SnapOneRowDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
30-44
967-
968 qreal dist = data.move.value() - data.pressPos;-
969 qreal bias = dist < rowSize()/2
dist < rowSize()/2Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
? rowSize()/2 : 0;
0-30
970 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
10-20
971 bias = -bias;
executed 10 times by 1 test: bias = -bias;
Executed by:
  • tst_qquickgridview
10
972 data.flickTarget = -snapPosAt(-dataValue - bias);-
973 maxDistance = qAbs(data.flickTarget - data.move.value());-
974 velocity = maxVelocity;-
975 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
30
976 maxDistance = qAbs(minExtent - data.move.value());-
977 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
44
978 }-
979 if (snapMode == QQuickGridView::NoSnap
snapMode == QQ...idView::NoSnapDescription
TRUEnever evaluated
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& highlightRange != QQuickGridView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-82
980 data.flickTarget = minExtent;
never executed: data.flickTarget = minExtent;
0
981 }
executed 82 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
82
982 if (data.move.value() > maxExtent
data.move.value() > maxExtentDescription
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
10-76
983 if (snapMode == QQuickGridView::SnapOneRow
snapMode == QQ...ew::SnapOneRowDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
30-46
984-
985 qreal dist = data.move.value() - data.pressPos;-
986 qreal bias = -
-dist < rowSize()/2Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
dist < rowSize()/2
-dist < rowSize()/2Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickgridview
? rowSize()/2 : 0;
0-30
987 if (isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
10-20
988 bias = -bias;
executed 10 times by 1 test: bias = -bias;
Executed by:
  • tst_qquickgridview
10
989 data.flickTarget = -snapPosAt(-dataValue + bias);-
990 maxDistance = qAbs(data.flickTarget - data.move.value());-
991 velocity = -maxVelocity;-
992 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
30
993 maxDistance = qAbs(maxExtent - data.move.value());-
994 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
46
995 }-
996 if (snapMode == QQuickGridView::NoSnap
snapMode == QQ...idView::NoSnapDescription
TRUEnever evaluated
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& highlightRange != QQuickGridView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-86
997 data.flickTarget = maxExtent;
never executed: data.flickTarget = maxExtent;
0
998 }
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
86
999 bool overShoot = boundsBehavior & QQuickFlickable::OvershootBounds;-
1000 if (maxDistance > 0
maxDistance > 0Description
TRUEevaluated 150 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| overShoot
overShootDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-150
1001-
1002 qreal v = velocity;-
1003 if (maxVelocity != -1
maxVelocity != -1Description
TRUEevaluated 168 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& maxVelocity < qAbs(v)
maxVelocity < qAbs(v)Description
TRUEnever evaluated
FALSEevaluated 168 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
0-168
1004 if (v < 0
v < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1005 v = -maxVelocity;
never executed: v = -maxVelocity;
0
1006 else-
1007 v = maxVelocity;
never executed: v = maxVelocity;
0
1008 }-
1009 qreal accel = deceleration;-
1010 qreal v2 = v * v;-
1011 qreal overshootDist = 0.0;-
1012 if ((maxDistance > 0.0
maxDistance > 0.0Description
TRUEevaluated 150 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& v2 / (2.0f * maxDistance) < accel
v2 / (2.0f * m...tance) < accelDescription
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickgridview
) || snapMode == QQuickGridView::SnapOneRow
snapMode == QQ...ew::SnapOneRowDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
18-150
1013-
1014 qreal dist = v2 / (accel * 2.0) + rowSize()/4;-
1015 dist = qMin(dist, maxDistance);-
1016 if (v > 0
v > 0Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
70-74
1017 dist = -dist;
executed 70 times by 1 test: dist = -dist;
Executed by:
  • tst_qquickgridview
70
1018 if (snapMode != QQuickGridView::SnapOneRow
snapMode != QQ...ew::SnapOneRowDescription
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
66-78
1019 qreal distTemp = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -dist : dist;
26-52
1020 data.flickTarget = -snapPosAt(-dataValue + distTemp);-
1021 }
executed 78 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
78
1022 data.flickTarget = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -data.flickTarget+size() : data.flickTarget;
48-96
1023 if (overShoot
overShootDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-144
1024 if (data.flickTarget >= minExtent
data.flickTarget >= minExtentDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 134 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
10-134
1025 overshootDist = overShootDistance(vSize);-
1026 data.flickTarget += overshootDist;-
1027 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else if (data.flickTarget <= maxExtent
data.flickTarget <= maxExtentDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
10-124
1028 overshootDist = overShootDistance(vSize);-
1029 data.flickTarget -= overshootDist;-
1030 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
10
1031 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
144
1032 qreal adjDist = -data.flickTarget + data.move.value();-
1033 if (qAbs(adjDist) > qAbs(dist)
qAbs(adjDist) > qAbs(dist)Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
22-122
1034-
1035 qreal adjv2 = accel * 2.0f * qAbs(adjDist);-
1036 if (adjv2 > v2
adjv2 > v2Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
10-12
1037 v2 = adjv2;-
1038 v = qSqrt(v2);-
1039 if (dist > 0
dist > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
4-6
1040 v = -v;
executed 4 times by 1 test: v = -v;
Executed by:
  • tst_qquickgridview
4
1041 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
10
1042 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
22
1043 dist = adjDist;-
1044 accel = v2 / (2.0f * qAbs(dist));-
1045 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
144
1046 data.flickTarget = velocity > 0
velocity > 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickgridview
? minExtent : maxExtent;
12
1047 overshootDist = overShoot
overShootDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
? overShootDistance(vSize) : 0;
0-24
1048 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
24
1049 timeline.reset(data.move);-
1050 timeline.accel(data.move, v, accel, maxDistance + overshootDist);-
1051 timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this));-
1052 return
executed 168 times by 1 test: return true;
Executed by:
  • tst_qquickgridview
true;
executed 168 times by 1 test: return true;
Executed by:
  • tst_qquickgridview
168
1053 } else {-
1054 timeline.reset(data.move);-
1055 fixup(data, minExtent, maxExtent);-
1056 return
never executed: return false;
false;
never executed: return false;
0
1057 }-
1058}-
1059QQuickGridView::QQuickGridView(QQuickItem *parent)-
1060 : QQuickItemView(*(new QQuickGridViewPrivate), parent)-
1061{-
1062}
executed 1782 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1782
1063-
1064QQuickGridView::~QQuickGridView()-
1065{-
1066}-
1067-
1068void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight)-
1069{-
1070 QQuickGridViewPrivate * const d = d_func();-
1071 if (d->autoHighlight != autoHighlight
d->autoHighlig... autoHighlightDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEnever evaluated
) {
0-8
1072 if (!autoHighlight
!autoHighlightDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEnever evaluated
&& d->highlightXAnimator
d->highlightXAnimatorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
0-8
1073 d->highlightXAnimator->stop();-
1074 d->highlightYAnimator->stop();-
1075 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
2
1076 QQuickItemView::setHighlightFollowsCurrentItem(autoHighlight);-
1077 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
8
1078}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
8
1079void QQuickGridView::setHighlightMoveDuration(int duration)-
1080{-
1081 QQuickGridViewPrivate * const d = d_func();-
1082 if (d->highlightMoveDuration != duration
d->highlightMo...on != durationDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-6
1083 if (d->highlightYAnimator
d->highlightYAnimatorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
2-4
1084 d->highlightXAnimator->userDuration = duration;-
1085 d->highlightYAnimator->userDuration = duration;-
1086 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
2
1087 QQuickItemView::setHighlightMoveDuration(duration);-
1088 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
6
1089}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
6
1090QQuickGridView::Flow QQuickGridView::flow() const-
1091{-
1092 const QQuickGridViewPrivate * const d = d_func();-
1093 return
executed 1044191 times by 4 tests: return d->flow;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
d->flow;
executed 1044191 times by 4 tests: return d->flow;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
1044191
1094}-
1095-
1096void QQuickGridView::setFlow(Flow flow)-
1097{-
1098 QQuickGridViewPrivate * const d = d_func();-
1099 if (d->flow != flow
d->flow != flowDescription
TRUEevaluated 666 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 638 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
638-666
1100 d->flow = flow;-
1101 if (d->flow == FlowLeftToRight
d->flow == FlowLeftToRightDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 650 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
16-650
1102 setContentWidth(-1);-
1103 setFlickableDirection(VerticalFlick);-
1104 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
16
1105 setContentHeight(-1);-
1106 setFlickableDirection(HorizontalFlick);-
1107 }
executed 650 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
650
1108 setContentX(0);-
1109 setContentY(0);-
1110 d->regenerate(true);-
1111 flowChanged();-
1112 }
executed 666 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
666
1113}
executed 1304 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
1304
1114qreal QQuickGridView::cellWidth() const-
1115{-
1116 const QQuickGridViewPrivate * const d = d_func();-
1117 return
executed 313945 times by 2 tests: return d->cellWidth;
Executed by:
  • tst_examples
  • tst_qquickgridview
d->cellWidth;
executed 313945 times by 2 tests: return d->cellWidth;
Executed by:
  • tst_examples
  • tst_qquickgridview
313945
1118}-
1119-
1120void QQuickGridView::setCellWidth(qreal cellWidth)-
1121{-
1122 QQuickGridViewPrivate * const d = d_func();-
1123 if (cellWidth != d->cellWidth
cellWidth != d->cellWidthDescription
TRUEevaluated 1740 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
&& cellWidth > 0
cellWidth > 0Description
TRUEevaluated 1740 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEnever evaluated
) {
0-1740
1124 d->cellWidth = qMax(qreal(1), cellWidth);-
1125 d->updateViewport();-
1126 cellWidthChanged();-
1127 d->forceLayoutPolish();-
1128 }
executed 1740 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
1740
1129}
executed 1750 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
1750
1130-
1131qreal QQuickGridView::cellHeight() const-
1132{-
1133 const QQuickGridViewPrivate * const d = d_func();-
1134 return
executed 182823 times by 3 tests: return d->cellHeight;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
d->cellHeight;
executed 182823 times by 3 tests: return d->cellHeight;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
182823
1135}-
1136-
1137void QQuickGridView::setCellHeight(qreal cellHeight)-
1138{-
1139 QQuickGridViewPrivate * const d = d_func();-
1140 if (cellHeight != d->cellHeight
cellHeight != d->cellHeightDescription
TRUEevaluated 1686 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 56 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
&& cellHeight > 0
cellHeight > 0Description
TRUEevaluated 1686 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEnever evaluated
) {
0-1686
1141 d->cellHeight = qMax(qreal(1), cellHeight);-
1142 d->updateViewport();-
1143 cellHeightChanged();-
1144 d->forceLayoutPolish();-
1145 }
executed 1686 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
1686
1146}
executed 1742 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
1742
1147QQuickGridView::SnapMode QQuickGridView::snapMode() const-
1148{-
1149 const QQuickGridViewPrivate * const d = d_func();-
1150 return
executed 2 times by 1 test: return d->snapMode;
Executed by:
  • tst_qquickgridview
d->snapMode;
executed 2 times by 1 test: return d->snapMode;
Executed by:
  • tst_qquickgridview
2
1151}-
1152-
1153void QQuickGridView::setSnapMode(SnapMode mode)-
1154{-
1155 QQuickGridViewPrivate * const d = d_func();-
1156 if (d->snapMode != mode
d->snapMode != modeDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-32
1157 d->snapMode = mode;-
1158 snapModeChanged();-
1159 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
32
1160}
executed 32 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
32
1161void QQuickGridView::viewportMoved(Qt::Orientations orient)-
1162{-
1163 QQuickGridViewPrivate * const d = d_func();-
1164 QQuickItemView::viewportMoved(orient);-
1165 if (!d->itemCount
!d->itemCountDescription
TRUEevaluated 1054 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6739 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
1054-6739
1166 return;
executed 1054 times by 1 test: return;
Executed by:
  • tst_qquickgridview
1054
1167 if (d->inViewportMoved
d->inViewportMovedDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 6720 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
19-6720
1168 return;
executed 19 times by 1 test: return;
Executed by:
  • tst_qquickgridview
19
1169 d->inViewportMoved = true;-
1170-
1171 if (yflick()
yflick()Description
TRUEevaluated 3105 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 3615 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
3105-3615
1172 if (d->isContentFlowReversed()
d->isContentFlowReversed()Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2915 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
190-2915
1173 d->bufferMode = d->vData.smoothVelocity < 0
d->vData.smoothVelocity < 0Description
TRUEnever evaluated
FALSEevaluated 190 times by 1 test
Evaluated by:
  • tst_qquickgridview
? QQuickItemViewPrivate::BufferAfter : QQuickItemViewPrivate::BufferBefore;
executed 190 times by 1 test: d->bufferMode = d->vData.smoothVelocity < 0 ? QQuickItemViewPrivate::BufferAfter : QQuickItemViewPrivate::BufferBefore;
Executed by:
  • tst_qquickgridview
0-190
1174 else-
1175 d->bufferMode = d->vData.smoothVelocity < 0
d->vData.smoothVelocity < 0Description
TRUEevaluated 1222 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1693 times by 1 test
Evaluated by:
  • tst_qquickgridview
? QQuickItemViewPrivate::BufferBefore : QQuickItemViewPrivate::BufferAfter;
executed 2915 times by 1 test: d->bufferMode = d->vData.smoothVelocity < 0 ? QQuickItemViewPrivate::BufferBefore : QQuickItemViewPrivate::BufferAfter;
Executed by:
  • tst_qquickgridview
1222-2915
1176 } else {-
1177 if (d->isContentFlowReversed()
d->isContentFlowReversed()Description
TRUEevaluated 1844 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1771 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
1771-1844
1178 d->bufferMode = d->hData.smoothVelocity < 0
d->hData.smoothVelocity < 0Description
TRUEevaluated 737 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1107 times by 1 test
Evaluated by:
  • tst_qquickgridview
? QQuickItemViewPrivate::BufferAfter : QQuickItemViewPrivate::BufferBefore;
executed 1844 times by 1 test: d->bufferMode = d->hData.smoothVelocity < 0 ? QQuickItemViewPrivate::BufferAfter : QQuickItemViewPrivate::BufferBefore;
Executed by:
  • tst_qquickgridview
737-1844
1179 else-
1180 d->bufferMode = d->hData.smoothVelocity < 0
d->hData.smoothVelocity < 0Description
TRUEevaluated 766 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1005 times by 1 test
Evaluated by:
  • tst_qquickgridview
? QQuickItemViewPrivate::BufferBefore : QQuickItemViewPrivate::BufferAfter;
executed 1771 times by 1 test: d->bufferMode = d->hData.smoothVelocity < 0 ? QQuickItemViewPrivate::BufferBefore : QQuickItemViewPrivate::BufferAfter;
Executed by:
  • tst_qquickgridview
766-1771
1181 }-
1182-
1183 d->refillOrLayout();-
1184-
1185-
1186 qreal from = d->isContentFlowReversed()
d->isContentFlowReversed()Description
TRUEevaluated 2034 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4686 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -d->position()-d->displayMarginBeginning-d->size() : d->position()-d->displayMarginBeginning;
2034-4686
1187 qreal to = d->isContentFlowReversed()
d->isContentFlowReversed()Description
TRUEevaluated 2034 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4686 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -d->position()+d->displayMarginEnd : d->position()+d->size()+d->displayMarginEnd;
2034-4686
1188 for (FxViewItem *item : qAsConst(d->visibleItems)) {-
1189 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(item);-
1190 QQuickItemPrivate::get(gridItem->item)->setCulled(gridItem->rowPos() + d->rowSize() < from || gridItem->rowPos() > to);-
1191 }
executed 142751 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
142751
1192 if (d->currentItem
d->currentItemDescription
TRUEevaluated 6720 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-6720
1193 FxGridItemSG *item = static_cast<FxGridItemSG*>(d->currentItem);-
1194 QQuickItemPrivate::get(item->item)->setCulled(item->rowPos() + d->rowSize() < from || item->rowPos() > to);-
1195 }
executed 6720 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
6720
1196-
1197 if (d->hData.flicking
d->hData.flickingDescription
TRUEevaluated 2558 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4162 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| d->vData.flicking
d->vData.flickingDescription
TRUEevaluated 1425 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2737 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| d->hData.moving
d->hData.movingDescription
TRUEevaluated 440 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2297 times by 1 test
Evaluated by:
  • tst_qquickgridview
|| d->vData.moving
d->vData.movingDescription
TRUEevaluated 657 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1640 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
440-4162
1198 d->moveReason = QQuickGridViewPrivate::Mouse;
executed 5080 times by 1 test: d->moveReason = QQuickGridViewPrivate::Mouse;
Executed by:
  • tst_qquickgridview
5080
1199 if (d->moveReason != QQuickGridViewPrivate::SetIndex
d->moveReason ...vate::SetIndexDescription
TRUEevaluated 6243 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 477 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
477-6243
1200 if (d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 2472 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 3771 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& d->highlightRange == StrictlyEnforceRange
d->highlightRa...lyEnforceRangeDescription
TRUEevaluated 2472 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& d->highlight
d->highlightDescription
TRUEevaluated 2472 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-3771
1201-
1202 qreal pos = d->highlight->position();-
1203 qreal viewPos = d->isContentFlowReversed()
d->isContentFlowReversed()Description
TRUEevaluated 736 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1736 times by 1 test
Evaluated by:
  • tst_qquickgridview
? -d->position()-d->size() : d->position();
736-1736
1204 if (pos > viewPos + d->highlightRangeEnd - d->highlight->size()
pos > viewPos ...hlight->size()Description
TRUEevaluated 1277 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1195 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
1195-1277
1205 pos = viewPos + d->highlightRangeEnd - d->highlight->size();
executed 1277 times by 1 test: pos = viewPos + d->highlightRangeEnd - d->highlight->size();
Executed by:
  • tst_qquickgridview
1277
1206 if (pos < viewPos + d->highlightRangeStart
pos < viewPos ...ightRangeStartDescription
TRUEevaluated 1295 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1177 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
1177-1295
1207 pos = viewPos + d->highlightRangeStart;
executed 1295 times by 1 test: pos = viewPos + d->highlightRangeStart;
Executed by:
  • tst_qquickgridview
1295
1208-
1209 if (pos != d->highlight->position()
pos != d->high...ht->position()Description
TRUEevaluated 2446 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
26-2446
1210 d->highlightXAnimator->stop();-
1211 d->highlightYAnimator->stop();-
1212 static_cast<FxGridItemSG*>(d->highlight)->setPosition(static_cast<FxGridItemSG*>(d->highlight)->colPos(), pos);-
1213 }
executed 2446 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
2446
1214 d->updateHighlight();-
1215 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
26
1216-
1217-
1218 int idx = d->snapIndex();-
1219 if (idx >= 0
idx >= 0Description
TRUEevaluated 2472 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& idx != d->currentIndex
idx != d->currentIndexDescription
TRUEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2250 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
0-2472
1220 d->updateCurrent(idx);-
1221 if (d->currentItem
d->currentItemDescription
TRUEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& static_cast<
static_cast<Fx...ght)->colPos()Description
TRUEnever evaluated
FALSEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquickgridview
FxGridItemSG*>(d->currentItem)->colPos() != static_cast<FxGridItemSG*>(d->highlight)->colPos()
static_cast<Fx...ght)->colPos()Description
TRUEnever evaluated
FALSEevaluated 222 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& d->autoHighlight
d->autoHighlightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-222
1222 if (d->flow == FlowLeftToRight
d->flow == FlowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1223 d->highlightXAnimator->to = d->currentItem->itemX();
never executed: d->highlightXAnimator->to = d->currentItem->itemX();
0
1224 else-
1225 d->highlightYAnimator->to = d->currentItem->itemY();
never executed: d->highlightYAnimator->to = d->currentItem->itemY();
0
1226 }-
1227 }
executed 222 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
222
1228 }
executed 2472 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
2472
1229 }
executed 6243 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
6243
1230-
1231 d->inViewportMoved = false;-
1232}
executed 6720 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
6720
1233-
1234void QQuickGridView::keyPressEvent(QKeyEvent *event)-
1235{-
1236 QQuickGridViewPrivate * const d = d_func();-
1237 if (d->model && d->model->count()
d->model->count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& ((d->interactive
d->interactiveDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& !d->explicitKeyNavigationEnabled
!d->explicitKe...igationEnabledDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-6
1238 || (d->explicitKeyNavigationEnabled
d->explicitKey...igationEnabledDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& d->keyNavigationEnabled
d->keyNavigationEnabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
))) {
2-4
1239 d->moveReason = QQuickGridViewPrivate::SetIndex;-
1240 int oldCurrent = currentIndex();-
1241 switch (event->key()) {-
1242 case
never executed: case Qt::Key_Up:
Qt::Key_Up:
never executed: case Qt::Key_Up:
0
1243 moveCurrentIndexUp();-
1244 break;
never executed: break;
0
1245 case
never executed: case Qt::Key_Down:
Qt::Key_Down:
never executed: case Qt::Key_Down:
0
1246 moveCurrentIndexDown();-
1247 break;
never executed: break;
0
1248 case
never executed: case Qt::Key_Left:
Qt::Key_Left:
never executed: case Qt::Key_Left:
0
1249 moveCurrentIndexLeft();-
1250 break;
never executed: break;
0
1251 case
executed 2 times by 1 test: case Qt::Key_Right:
Executed by:
  • tst_qquickgridview
Qt::Key_Right:
executed 2 times by 1 test: case Qt::Key_Right:
Executed by:
  • tst_qquickgridview
2
1252 moveCurrentIndexRight();-
1253 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquickgridview
2
1254 default
never executed: default:
:
never executed: default:
0
1255 break;
never executed: break;
0
1256 }-
1257 if (oldCurrent != currentIndex()
oldCurrent != currentIndex()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-2
1258 event->accept();-
1259 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickgridview
2
1260 }-
1261 }
never executed: end of block
0
1262 event->ignore();-
1263 QQuickItemView::keyPressEvent(event);-
1264}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
4
1265-
1266void QQuickGridView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)-
1267{-
1268 QQuickGridViewPrivate * const d = d_func();-
1269 d->resetColumns();-
1270-
1271 if (newGeometry.width() != oldGeometry.width()
newGeometry.wi...ometry.width()Description
TRUEevaluated 1802 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1942 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
1802-1942
1272 && newGeometry.height() != oldGeometry.height()
newGeometry.he...metry.height()Description
TRUEevaluated 88 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEevaluated 1714 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
88-1714
1273 d->setPosition(d->position());-
1274 }
executed 88 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
else if (newGeometry.width() != oldGeometry.width()
newGeometry.wi...ometry.width()Description
TRUEevaluated 1714 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 1942 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
88-1942
1275 QQuickFlickable::setContentX(d->contentXForPosition(d->position()));-
1276 }
executed 1714 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
else if (newGeometry.height() != oldGeometry.height()
newGeometry.he...metry.height()Description
TRUEevaluated 1720 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 222 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
222-1720
1277 QQuickFlickable::setContentY(d->contentYForPosition(d->position()));-
1278 }
executed 1720 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
1720
1279-
1280 QQuickItemView::geometryChanged(newGeometry, oldGeometry);-
1281}
executed 3744 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
3744
1282-
1283void QQuickGridView::initItem(int index, QObject *obj)-
1284{-
1285 QQuickItemView::initItem(index, obj);-
1286-
1287-
1288-
1289 QQuickItem *item = qmlobject_cast<QQuickItem*>(obj);-
1290 if (item
itemDescription
TRUEevaluated 46119 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-46119
1291 QQuickGridViewAttached *attached = static_cast<QQuickGridViewAttached *>(-
1292 qmlAttachedPropertiesObject<QQuickGridView>(item));-
1293 if (attached
attachedDescription
TRUEevaluated 46119 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-46119
1294 attached->setView(this);
executed 46119 times by 4 tests: attached->setView(this);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
46119
1295 }
executed 46119 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
46119
1296}
executed 46119 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
46119
1297void QQuickGridView::moveCurrentIndexUp()-
1298{-
1299 QQuickGridViewPrivate * const d = d_func();-
1300 const int count = d->model
d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
? d->model->count() : 0;
0
1301 if (!count
!countDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1302 return;
never executed: return;
0
1303 if (d->verticalLayoutDirection == QQuickItemView::TopToBottom
d->verticalLay...w::TopToBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1304 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1305 if (currentIndex() >= d->columns
currentIndex() >= d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1306 int index = currentIndex() - d->columns;-
1307 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1308 }
never executed: end of block
0
1309 }
never executed: end of block
else {
0
1310 if (currentIndex() > 0
currentIndex() > 0Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1311 int index = currentIndex() - 1;-
1312 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1313 }
never executed: end of block
0
1314 }
never executed: end of block
0
1315 } else {-
1316 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1317 if (currentIndex() < count - d->columns
currentIndex()...t - d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1318 int index = currentIndex()+d->columns;-
1319 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1320 }
never executed: end of block
0
1321 }
never executed: end of block
else {
0
1322 if (currentIndex() < count - 1
currentIndex() < count - 1Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1323 int index = currentIndex() + 1;-
1324 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1325 }
never executed: end of block
0
1326 }
never executed: end of block
0
1327 }-
1328}-
1329void QQuickGridView::moveCurrentIndexDown()-
1330{-
1331 QQuickGridViewPrivate * const d = d_func();-
1332 const int count = d->model
d->modelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
? d->model->count() : 0;
0-2
1333 if (!count
!countDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-2
1334 return;
never executed: return;
0
1335-
1336 if (d->verticalLayoutDirection == QQuickItemView::TopToBottom
d->verticalLay...w::TopToBottomDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-2
1337 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-2
1338 if (currentIndex() < count - d->columns
currentIndex()...t - d->columnsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-2
1339 int index = currentIndex()+d->columns;-
1340 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1341 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
2
1342 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
2
1343 if (currentIndex() < count - 1
currentIndex() < count - 1Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1344 int index = currentIndex() + 1;-
1345 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1346 }
never executed: end of block
0
1347 }
never executed: end of block
0
1348 } else {-
1349 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1350 if (currentIndex() >= d->columns
currentIndex() >= d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1351 int index = currentIndex() - d->columns;-
1352 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1353 }
never executed: end of block
0
1354 }
never executed: end of block
else {
0
1355 if (currentIndex() > 0
currentIndex() > 0Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1356 int index = currentIndex() - 1;-
1357 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1358 }
never executed: end of block
0
1359 }
never executed: end of block
0
1360 }-
1361}-
1362void QQuickGridView::moveCurrentIndexLeft()-
1363{-
1364 QQuickGridViewPrivate * const d = d_func();-
1365 const int count = d->model
d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
? d->model->count() : 0;
0
1366 if (!count
!countDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1367 return;
never executed: return;
0
1368 if (effectiveLayoutDirection() == Qt::LeftToRight
effectiveLayou...t::LeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1369 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1370 if (currentIndex() > 0
currentIndex() > 0Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1371 int index = currentIndex() - 1;-
1372 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1373 }
never executed: end of block
0
1374 }
never executed: end of block
else {
0
1375 if (currentIndex() >= d->columns
currentIndex() >= d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1376 int index = currentIndex() - d->columns;-
1377 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1378 }
never executed: end of block
0
1379 }
never executed: end of block
0
1380 } else {-
1381 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1382 if (currentIndex() < count - 1
currentIndex() < count - 1Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1383 int index = currentIndex() + 1;-
1384 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1385 }
never executed: end of block
0
1386 }
never executed: end of block
else {
0
1387 if (currentIndex() < count - d->columns
currentIndex()...t - d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1388 int index = currentIndex() + d->columns;-
1389 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1390 }
never executed: end of block
0
1391 }
never executed: end of block
0
1392 }-
1393}-
1394void QQuickGridView::moveCurrentIndexRight()-
1395{-
1396 QQuickGridViewPrivate * const d = d_func();-
1397 const int count = d->model
d->modelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
? d->model->count() : 0;
0-2
1398 if (!count
!countDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-2
1399 return;
never executed: return;
0
1400 if (effectiveLayoutDirection() == Qt::LeftToRight
effectiveLayou...t::LeftToRightDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-2
1401 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-2
1402 if (currentIndex() < count - 1
currentIndex() < count - 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-2
1403 int index = currentIndex() + 1;-
1404 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1405 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
2
1406 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
2
1407 if (currentIndex() < count - d->columns
currentIndex()...t - d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1408 int index = currentIndex()+d->columns;-
1409 setCurrentIndex((index >= 0 && index < count) ? index : 0);-
1410 }
never executed: end of block
0
1411 }
never executed: end of block
0
1412 } else {-
1413 if (d->flow == QQuickGridView::FlowLeftToRight
d->flow == QQu...lowLeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1414 if (currentIndex() > 0
currentIndex() > 0Description
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1415 int index = currentIndex() - 1;-
1416 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1417 }
never executed: end of block
0
1418 }
never executed: end of block
else {
0
1419 if (currentIndex() >= d->columns
currentIndex() >= d->columnsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->wrap
d->wrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1420 int index = currentIndex() - d->columns;-
1421 setCurrentIndex((index >= 0 && index < count) ? index : count-1);-
1422 }
never executed: end of block
0
1423 }
never executed: end of block
0
1424 }-
1425}-
1426-
1427bool QQuickGridViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView)-
1428{-
1429 QQuickGridView * const q = q_func();-
1430-
1431 int modelIndex = change.index;-
1432 int count = change.count;-
1433-
1434 int index = visibleItems.count()
visibleItems.count()Description
TRUEevaluated 1158 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 102 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
? mapFromModel(modelIndex) : 0;
102-1158
1435-
1436 if (index < 0
index < 0Description
TRUEevaluated 228 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 1032 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
) {
228-1032
1437 int i = visibleItems.count() - 1;-
1438 while (i > 0
i > 0Description
TRUEevaluated 220 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& visibleItems.at(i)->index == -1
visibleItems.a...)->index == -1Description
TRUEnever evaluated
FALSEevaluated 220 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-220
1439 --
never executed: --i;
i;
never executed: --i;
0
1440 if (visibleItems.at(i)->index + 1 == modelIndex
visibleItems.a... == modelIndexDescription
TRUEevaluated 61 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 167 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
61-167
1441-
1442 index = visibleItems.count();-
1443 }
executed 61 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
61
1444 if (modelIndex <= visibleIndex
modelIndex <= visibleIndexDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
83-84
1445-
1446 visibleIndex += count;-
1447 for (FxViewItem *item : qAsConst(visibleItems)) {-
1448 if (item->index != -1
item->index != -1Description
TRUEevaluated 1786 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& item->index >= modelIndex
item->index >= modelIndexDescription
TRUEevaluated 1786 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-1786
1449 item->index += count;
executed 1786 times by 1 test: item->index += count;
Executed by:
  • tst_qquickgridview
1786
1450 }
executed 1786 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
1786
1451 }
executed 84 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
84
1452 return
executed 167 times by 1 test: return true;
Executed by:
  • tst_qquickgridview
true;
executed 167 times by 1 test: return true;
Executed by:
  • tst_qquickgridview
167
1453 }-
1454 }-
1455-
1456 qreal tempPos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 773 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
? -position()-size()+q->width()+1 : position();
320-773
1457 qreal colPos = 0;-
1458 qreal rowPos = 0;-
1459 int colNum = 0;-
1460 if (visibleItems.count()
visibleItems.count()Description
TRUEevaluated 991 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 102 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
) {
102-991
1461 if (index < visibleItems.count()
index < visibleItems.count()Description
TRUEevaluated 930 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 61 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
61-930
1462 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(visibleItems.at(index));-
1463 colPos = gridItem->colPos();-
1464 rowPos = gridItem->rowPos();-
1465 colNum = qFloor((colPos+colSize()/2) / colSize());-
1466 }
executed 930 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
930
1467-
1468 FxGridItemSG *gridItem = static_cast<FxGridItemSG*>(visibleItems.at(index-1));-
1469 rowPos = gridItem->rowPos();-
1470 colNum = qFloor((gridItem->colPos()+colSize()/2) / colSize());-
1471 if (++
++colNum >= columnsDescription
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • tst_qquickgridview
colNum >= columns
++colNum >= columnsDescription
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
0-61
1472 colNum = 0;-
1473 rowPos += rowSize();-
1474 }
never executed: end of block
0
1475 colPos = colNum * colSize();-
1476 }
executed 61 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
61
1477 }-
1478-
1479-
1480 for (FxViewItem *item : qAsConst(visibleItems)) {-
1481 if (item->index != -1
item->index != -1Description
TRUEevaluated 17794 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
&& item->index >= modelIndex
item->index >= modelIndexDescription
TRUEevaluated 10702 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 7092 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
0-17794
1482 item->index += count;-
1483 if (change.isMove()
change.isMove()Description
TRUEevaluated 5262 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 5440 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
5262-5440
1484 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::MoveTransition, false);
executed 5262 times by 1 test: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::MoveTransition, false);
Executed by:
  • tst_qquickgridview
5262
1485 else-
1486 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, false);
executed 5440 times by 1 test: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, false);
Executed by:
  • tst_qquickgridview
5440
1487 }-
1488 }
executed 17794 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
17794
1489-
1490 int prevVisibleCount = visibleItems.count();-
1491 if (insertResult->visiblePos.isValid()
insertResult->...ePos.isValid()Description
TRUEevaluated 995 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 98 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
&& rowPos < insertResult->visiblePos
rowPos < inser...lt->visiblePosDescription
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 899 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
96-995
1492-
1493 int insertionIdx = index;-
1494 int i = count - 1;-
1495 int from = tempPos - buffer - displayMarginBeginning;-
1496-
1497 if (rowPos > from
rowPos > fromDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& insertionIdx < visibleIndex
insertionIdx < visibleIndexDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
2-83
1498-
1499 insertResult->countChangeBeforeVisible += count;-
1500 insertResult->sizeChangesBeforeVisiblePos += ((count + columns - 1) / columns) * rowSize();-
1501 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
2
1502 while (i >= 0
i >= 0Description
TRUEevaluated 371 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
94-371
1503-
1504 FxViewItem *item = nullptr;-
1505 if (change.isMove()
change.isMove()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 369 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& (
(item = curren...elIndex + i)))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
item = currentChanges.removedItems.take(change.moveKey(modelIndex + i)))
(item = curren...elIndex + i)))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-369
1506 item->index = modelIndex + i;
never executed: item->index = modelIndex + i;
0
1507 if (!item
!itemDescription
TRUEevaluated 371 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-371
1508 item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
executed 371 times by 1 test: item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
Executed by:
  • tst_qquickgridview
371
1509 if (!item
!itemDescription
TRUEnever evaluated
FALSEevaluated 371 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-371
1510 return
never executed: return false;
false;
never executed: return false;
0
1511-
1512 QQuickItemPrivate::get(item->item)->setCulled(false);-
1513 visibleItems.insert(insertionIdx, item);-
1514 if (insertionIdx == 0
insertionIdx == 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 356 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
15-356
1515 insertResult->changedFirstItem = true;
executed 15 times by 1 test: insertResult->changedFirstItem = true;
Executed by:
  • tst_qquickgridview
15
1516 if (!change.isMove()
!change.isMove()Description
TRUEevaluated 369 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
2-369
1517 addedItems->append(item);-
1518 if (transitioner
transitionerDescription
TRUEnever evaluated
FALSEevaluated 369 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
0-369
1519 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
never executed: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
0
1520 else-
1521 item->moveTo(QPointF(colPos, rowPos), true);
executed 369 times by 1 test: item->moveTo(QPointF(colPos, rowPos), true);
Executed by:
  • tst_qquickgridview
369
1522 }-
1523 insertResult->sizeChangesBeforeVisiblePos += rowSize();-
1524-
1525 if (--
--colNum < 0Description
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 295 times by 1 test
Evaluated by:
  • tst_qquickgridview
colNum < 0
--colNum < 0Description
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 295 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
76-295
1526 colNum = columns - 1;-
1527 rowPos -= rowSize();-
1528 }
executed 76 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
76
1529 colPos = colNum * colSize();-
1530 index++;-
1531 i--;-
1532 }
executed 371 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
371
1533 }
executed 94 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
94
1534-
1535-
1536-
1537-
1538 int firstOkIdx = -1;-
1539 for (int i = 0; i <= insertionIdx
i <= insertionIdxDescription
TRUEevaluated 351 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 95 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& i < visibleItems.count() - 1
i < visibleItems.count() - 1Description
TRUEevaluated 351 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
; i++) {
0-351
1540 if (visibleItems.at(i)->index + 1 != visibleItems.at(i + 1)->index
visibleItems.a...(i + 1)->indexDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 350 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
1-350
1541 firstOkIdx = i + 1;-
1542 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qquickgridview
1
1543 }-
1544 }
executed 350 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
350
1545-
1546 for (int i = 0; i < firstOkIdx
i < firstOkIdxDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickgridview
; i++) {
1-96
1547 FxViewItem *nvItem = visibleItems.takeFirst();-
1548 addedItems->removeOne(nvItem);-
1549 removeItem(nvItem);-
1550 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qquickgridview
1
1551-
1552 }
executed 96 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
96
1553 int i = 0;-
1554 int to = buffer+displayMarginEnd+tempPos+size()-1;-
1555 while (i < count
i < countDescription
TRUEevaluated 4253 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 953 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
&& rowPos <= to + rowSize()*(columns - colNum)/qreal(columns+1)
rowPos <= to +...eal(columns+1)Description
TRUEevaluated 4209 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickgridview
) {
44-4253
1556 FxViewItem *item = nullptr;-
1557 if (change.isMove()
change.isMove()Description
TRUEevaluated 1358 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2851 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
&& (
(item = curren...elIndex + i)))Description
TRUEevaluated 992 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 366 times by 1 test
Evaluated by:
  • tst_qquickgridview
item = currentChanges.removedItems.take(change.moveKey(modelIndex + i)))
(item = curren...elIndex + i)))Description
TRUEevaluated 992 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 366 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
366-2851
1558 item->index = modelIndex + i;
executed 992 times by 1 test: item->index = modelIndex + i;
Executed by:
  • tst_qquickgridview
992
1559 bool newItem = !item;-
1560 if (!item
!itemDescription
TRUEevaluated 3217 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 992 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
992-3217
1561 item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
executed 3217 times by 3 tests: item = createItem(modelIndex + i, QQmlIncubator::Synchronous);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
3217
1562 if (!item
!itemDescription
TRUEnever evaluated
FALSEevaluated 4209 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
)
0-4209
1563 return
never executed: return false;
false;
never executed: return false;
0
1564-
1565 QQuickItemPrivate::get(item->item)->setCulled(false);-
1566 visibleItems.insert(index, item);-
1567 if (index == 0
index == 0Description
TRUEevaluated 261 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 3948 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
)
261-3948
1568 insertResult->changedFirstItem = true;
executed 261 times by 3 tests: insertResult->changedFirstItem = true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
261
1569 if (change.isMove()
change.isMove()Description
TRUEevaluated 1358 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2851 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
) {
1358-2851
1570-
1571-
1572 if (newItem
newItemDescription
TRUEevaluated 366 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 992 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& transitioner
transitionerDescription
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 308 times by 1 test
Evaluated by:
  • tst_qquickgridview
&& transitioner->canTransition(QQuickItemViewTransitioner::MoveTransition, true)
transitioner->...nsition, true)Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
)
0-992
1573 movingIntoView->append(MovedItem(item, change.moveKey(item->index)));
executed 58 times by 1 test: movingIntoView->append(MovedItem(item, change.moveKey(item->index)));
Executed by:
  • tst_qquickgridview
58
1574 }
executed 1358 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
else {
1358
1575 addedItems->append(item);-
1576 if (transitioner
transitionerDescription
TRUEevaluated 188 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 2663 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
)
188-2663
1577 item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
executed 188 times by 1 test: item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true);
Executed by:
  • tst_qquickgridview
188
1578 else-
1579 item->moveTo(QPointF(colPos, rowPos), true);
executed 2663 times by 3 tests: item->moveTo(QPointF(colPos, rowPos), true);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
2663
1580 }-
1581 insertResult->sizeChangesAfterVisiblePos += rowSize();-
1582-
1583 if (++
++colNum >= columnsDescription
TRUEevaluated 1170 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 3039 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
colNum >= columns
++colNum >= columnsDescription
TRUEevaluated 1170 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
FALSEevaluated 3039 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
1170-3039
1584 colNum = 0;-
1585 rowPos += rowSize();-
1586 }
executed 1170 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
1170
1587 colPos = colNum * colSize();-
1588 ++index;-
1589 ++i;-
1590 }
executed 4209 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
4209
1591 }
executed 997 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
997
1592-
1593 updateVisibleIndex();-
1594-
1595 return
executed 1093 times by 3 tests: return visibleItems.count() > prevVisibleCount;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
visibleItems.count() > prevVisibleCount;
executed 1093 times by 3 tests: return visibleItems.count() > prevVisibleCount;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickvisualdatamodel
1093
1596}-
1597-
1598void QQuickGridViewPrivate::translateAndTransitionItemsAfter(int afterModelIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult)-
1599{-
1600 if (!transitioner
!transitionerDescription
TRUEnever evaluated
FALSEevaluated 268 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
)
0-268
1601 return;
never executed: return;
0
1602-
1603 int markerItemIndex = -1;-
1604 for (int i=0; i<visibleItems.count()
i<visibleItems.count()Description
TRUEevaluated 4792 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEnever evaluated
; i++) {
0-4792
1605 if (visibleItems.at(i)->index == afterModelIndex
visibleItems.a...fterModelIndexDescription
TRUEevaluated 268 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
FALSEevaluated 4524 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
) {
268-4524
1606 markerItemIndex = i;-
1607 break;
executed 268 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qquickgridview
268
1608 }-
1609 }
executed 4524 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
4524
1610 if (markerItemIndex < 0
markerItemIndex < 0Description
TRUEnever evaluated
FALSEevaluated 268 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
)
0-268
1611 return;
never executed: return;
0
1612-
1613 const qreal viewEndPos = isContentFlowReversed()
isContentFlowReversed()Description
TRUEnever evaluated
FALSEevaluated 268 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
? -position() : position() + size();
0-268
1614 int countItemsRemoved = -(removalResult.sizeChangesAfterVisiblePos / rowSize());-
1615-
1616-
1617 int changeBeforeVisible = insertionResult.countChangeBeforeVisible - removalResult.countChangeBeforeVisible;-
1618 if (changeBeforeVisible != 0
changeBeforeVisible != 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 248 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
)
20-248
1619 countItemsRemoved += (changeBeforeVisible % columns) - (columns - 1);
executed 20 times by 1 test: countItemsRemoved += (changeBeforeVisible % columns) - (columns - 1);
Executed by:
  • tst_qquickgridview
20
1620-
1621 countItemsRemoved -= removalResult.countChangeAfterVisibleItems;-
1622-
1623 for (int i=markerItemIndex+1; i<visibleItems.count()
i<visibleItems.count()Description
TRUEevaluated 298 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
; i++) {
8-298
1624 FxGridItemSG *gridItem = static_cast<FxGridItemSG *>(visibleItems.at(i));-
1625 if (gridItem->position() >= viewEndPos
gridItem->posi... >= viewEndPosDescription
TRUEevaluated 260 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickgridview
)
38-260
1626 break;
executed 260 times by 1 test: break;
Executed by:
  • tst_qquickgridview
260
1627 if (!gridItem->transitionScheduledOrRunning()
!gridItem->tra...ledOrRunning()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickgridview
FALSEnever evaluated
) {
0-38
1628 qreal origRowPos = gridItem->colPos();-
1629 qreal origColPos = gridItem->rowPos();-
1630 int indexDiff = gridItem->index - countItemsRemoved;-
1631 gridItem->setPosition((indexDiff % columns) * colSize(), (indexDiff / columns) * rowSize());-
1632 gridItem->transitionNextReposition(transitioner, QQuickItemViewTransitioner::RemoveTransition, false);-
1633 gridItem->setPosition(origRowPos, origColPos);-
1634 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
38
1635 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qquickgridview
38
1636}
executed 268 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
268
1637-
1638bool QQuickGridViewPrivate::needsRefillForAddedOrRemovedIndex(int modelIndex) const-
1639{-
1640-
1641-
1642 return
executed 119 times by 1 test: return modelIndex < visibleIndex;
Executed by:
  • tst_qquickgridview
modelIndex < visibleIndex;
executed 119 times by 1 test: return modelIndex < visibleIndex;
Executed by:
  • tst_qquickgridview
119
1643}-
1644QQuickGridViewAttached *QQuickGridView::qmlAttachedProperties(QObject *obj)-
1645{-
1646 return
executed 48281 times by 4 tests: return new QQuickGridViewAttached(obj);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
new QQuickGridViewAttached(obj);
executed 48281 times by 4 tests: return new QQuickGridViewAttached(obj);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickvisualdatamodel
48281
1647}-
1648-
1649-
1650-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0