OpenCoverage

qquickpathview.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickpathview.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8extern const QLoggingCategory &lcItemViewDelegateLifecycle();-
9-
10const qreal MinimumFlickVelocity = 75.0;-
11-
12static QQmlOpenMetaObjectType *qPathViewAttachedType = nullptr;-
13-
14QQuickPathViewAttached::QQuickPathViewAttached(QObject *parent)-
15: QObject(parent), m_percent(-1), m_view(nullptr), m_onPath(false), m_isCurrent(false)-
16{-
17 if (qPathViewAttachedType
qPathViewAttachedTypeDescription
TRUEevaluated 1888 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 1450 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
1450-1888
18 m_metaobject = new QQmlOpenMetaObject(this, qPathViewAttachedType);-
19 m_metaobject->setCached(true);-
20 }
executed 1888 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else {
1888
21 m_metaobject = new QQmlOpenMetaObject(this);-
22 }
executed 1450 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
1450
23}-
24-
25QQuickPathViewAttached::~QQuickPathViewAttached()-
26{-
27}-
28-
29QVariant QQuickPathViewAttached::value(const QByteArray &name) const-
30{-
31 return
never executed: return m_metaobject->value(name);
m_metaobject->value(name);
never executed: return m_metaobject->value(name);
0
32}-
33void QQuickPathViewAttached::setValue(const QByteArray &name, const QVariant &val)-
34{-
35 m_metaobject->setValue(name, val);-
36}
executed 5154 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
5154
37-
38QQuickPathViewPrivate::QQuickPathViewPrivate()-
39 : path(nullptr), currentIndex(0), currentItemOffset(0.0), startPc(0)-
40 , offset(0.0), offsetAdj(0.0), mappedRange(1.0), mappedCache(0.0)-
41 , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true)-
42 , autoHighlight(true), highlightUp(false), layoutScheduled(false)-
43 , moving(false), flicking(false), dragging(false), inRequest(false), delegateValidated(false)-
44 , inRefill(false)-
45 , dragMargin(0), deceleration(100), maximumFlickVelocity(2500)-
46 , moveOffset(this, &QQuickPathViewPrivate::setAdjustedOffset), flickDuration(0)-
47 , pathItems(-1), requestedIndex(-1), cacheSize(0), requestedZ(0)-
48 , moveReason(Other), movementDirection(QQuickPathView::Shortest), moveDirection(QQuickPathView::Shortest)-
49 , attType(nullptr), highlightComponent(nullptr), highlightItem(nullptr)-
50 , moveHighlight(this, &QQuickPathViewPrivate::setHighlightPosition)-
51 , highlightPosition(0)-
52 , highlightRangeStart(0), highlightRangeEnd(0)-
53 , highlightRangeMode(QQuickPathView::StrictlyEnforceRange)-
54 , highlightMoveDuration(300), modelCount(0), snapMode(QQuickPathView::NoSnap)-
55{-
56}
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
57-
58void QQuickPathViewPrivate::init()-
59{-
60 QQuickPathView * const q = q_func();-
61 offset = 0;-
62 q->setAcceptedMouseButtons(Qt::LeftButton);-
63 q->setFlag(QQuickItem::ItemIsFocusScope);-
64 q->setFiltersChildMouseEvents(true);-
65 { QQuickTimeLine *sender = (&tl); QQuickPathView *receiver = (q); const char *signal = (qFlagLocation("2""updated()" "\0" __FILE__ ":" "120")); const char *method = (qFlagLocation("1""ticked()" "\0" __FILE__ ":" "120")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 276 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-276
66 __FILE__-
67 ,-
68 120-
69 )); signalIdx = QQuickTimeLine::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 276 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-276
70 __FILE__-
71 ,-
72 120-
73 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
74 __FILE__-
75 ,-
76 120-
77 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
78-
79 timer.invalidate();-
80 { QQuickTimeLine *sender = (&tl); QQuickPathView *receiver = (q); const char *signal = (qFlagLocation("2""completed()" "\0" __FILE__ ":" "123")); const char *method = (qFlagLocation("1""movementEnding()" "\0" __FILE__ ":" "123")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 276 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-276
81 __FILE__-
82 ,-
83 123-
84 )); signalIdx = QQuickTimeLine::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 276 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-276
85 __FILE__-
86 ,-
87 123-
88 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
89 __FILE__-
90 ,-
91 123-
92 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
93-
94}
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
95-
96QQuickItem *QQuickPathViewPrivate::getItem(int modelIndex, qreal z, bool async)-
97{-
98 QQuickPathView * const q = q_func();-
99 requestedIndex = modelIndex;-
100 requestedZ = z;-
101 inRequest = true;-
102 QObject *object = model->object(modelIndex, async ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);-
103 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);-
104 if (!item
!itemDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4393 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
30-4393
105 if (object
objectDescription
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-30
106 model->release(object);-
107 if (!delegateValidated
!delegateValidatedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
108 delegateValidated = true;-
109 QObject* delegate = q->delegate();-
110 qmlWarning(delegate ? delegate : q) << QQuickPathView::tr("Delegate must be of Item type");-
111 }
never executed: end of block
0
112 }
never executed: end of block
0
113 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
30
114 item->setParentItem(q);-
115 requestedIndex = -1;-
116 QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);-
117 itemPrivate->addItemChangeListener(this, QQuickItemPrivate::Geometry);-
118 }
executed 4393 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
4393
119 inRequest = false;-
120 return
executed 4423 times by 3 tests: return item;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
item;
executed 4423 times by 3 tests: return item;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
4423
121}-
122-
123void QQuickPathView::createdItem(int index, QObject *object)-
124{-
125 QQuickPathViewPrivate * const d = d_func();-
126 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);-
127 if (d->requestedIndex != index
d->requestedIndex != indexDescription
TRUEevaluated 86 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 3264 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
86-3264
128 qPathViewAttachedType = d->attachedType();-
129 QQuickPathViewAttached *att = static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item));-
130 qPathViewAttachedType = nullptr;-
131 if (att
attDescription
TRUEevaluated 86 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-86
132 att->m_view = this;-
133 att->setOnPath(false);-
134 }
executed 86 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
86
135 item->setParentItem(this);-
136 d->updateItem(item, 1.0);-
137 }
executed 86 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else {
86
138 d->requestedIndex = -1;-
139 if (!d->inRequest
!d->inRequestDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 3234 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
30-3234
140 refill();
executed 30 times by 1 test: refill();
Executed by:
  • tst_qquickpathview
30
141 }
executed 3264 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3264
142}-
143-
144void QQuickPathView::initItem(int index, QObject *object)-
145{-
146 QQuickPathViewPrivate * const d = d_func();-
147 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);-
148 if (item
itemDescription
TRUEevaluated 3350 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
&& d->requestedIndex == index
d->requestedIndex == indexDescription
TRUEevaluated 3264 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 86 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
0-3350
149 QQuickItemPrivate::get(item)->setCulled(true);-
150 item->setParentItem(this);-
151 qPathViewAttachedType = d->attachedType();-
152 QQuickPathViewAttached *att = static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item));-
153 qPathViewAttachedType = nullptr;-
154 if (att
attDescription
TRUEevaluated 3264 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-3264
155 att->m_view = this;-
156 qreal percent = d->positionOfIndex(index);-
157 if (percent < 1.0
percent < 1.0Description
TRUEevaluated 3218 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->path
d->pathDescription
TRUEevaluated 3216 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-3218
158 const auto attributes = d->path->attributes();-
159 for (const QString &attr : attributes)-
160 att->setValue(attr.toUtf8(), d->path->attributeAt(attr, percent));
executed 1710 times by 2 tests: att->setValue(attr.toUtf8(), d->path->attributeAt(attr, percent));
Executed by:
  • tst_examples
  • tst_qquickpathview
1710
161 item->setZ(d->requestedZ);-
162 }
executed 3216 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3216
163 att->setOnPath(percent < 1.0);-
164 }
executed 3264 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3264
165 }
executed 3264 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3264
166}
executed 3350 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3350
167-
168void QQuickPathViewPrivate::releaseItem(QQuickItem *item)-
169{-
170 if (!item
!itemDescription
TRUEnever evaluated
FALSEevaluated 4381 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !model
!modelDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4333 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-4381
171 return;
executed 48 times by 1 test: return;
Executed by:
  • tst_qquickpathview
48
172 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 4333 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
; qt_category_enabled = false) QMessageLogger(__FILE__, 202, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "release" << item;
never executed: QMessageLogger(__FILE__, 202, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "release" << item;
0-4333
173 QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);-
174 itemPrivate->removeItemChangeListener(this, QQuickItemPrivate::Geometry);-
175 QQmlInstanceModel::ReleaseFlags flags = model->release(item);-
176 if (!flags
!flagsDescription
TRUEevaluated 1979 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2354 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
1979-2354
177-
178 if (QQuickPathViewAttached *att = attached(item)
QQuickPathView...attached(item)Description
TRUEevaluated 1979 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-1979
179 att->setOnPath(false);
executed 1979 times by 3 tests: att->setOnPath(false);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1979
180 }
executed 1979 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else if (flags & QQmlInstanceModel::Destroyed
flags & QQmlIn...del::DestroyedDescription
TRUEevaluated 1483 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 871 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
871-1979
181-
182 item->setParentItem(nullptr);-
183 }
executed 1483 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
1483
184}
executed 4333 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
4333
185-
186QQuickPathViewAttached *QQuickPathViewPrivate::attached(QQuickItem *item)-
187{-
188 return
executed 53457 times by 3 tests: return static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item, false));
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item, false));
executed 53457 times by 3 tests: return static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item, false));
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
53457
189}-
190-
191QQmlOpenMetaObjectType *QQuickPathViewPrivate::attachedType()-
192{-
193 QQuickPathView * const q = q_func();-
194 if (!attType
!attTypeDescription
TRUEevaluated 280 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3070 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
280-3070
195-
196 attType = new QQmlOpenMetaObjectType(&QQuickPathViewAttached::staticMetaObject, qmlEngine(q));-
197 if (path
pathDescription
TRUEevaluated 278 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-278
198 const auto attributes = path->attributes();-
199 for (const QString &attr : attributes)-
200 attType->createProperty(attr.toUtf8());
executed 174 times by 2 tests: attType->createProperty(attr.toUtf8());
Executed by:
  • tst_examples
  • tst_qquickpathview
174
201 }
executed 278 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
278
202 }
executed 280 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
280
203-
204 return
executed 3350 times by 3 tests: return attType;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
attType;
executed 3350 times by 3 tests: return attType;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3350
205}-
206-
207void QQuickPathViewPrivate::clear()-
208{-
209 if (currentItem
currentItemDescription
TRUEevaluated 392 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 452 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
392-452
210 releaseItem(currentItem);-
211 currentItem = nullptr;-
212 }
executed 392 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
392
213-
214 for (QQuickItem *p : qAsConst(items))-
215 releaseItem(p);
executed 1832 times by 3 tests: releaseItem(p);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1832
216-
217 for (QQuickItem *p : qAsConst(itemCache))-
218 releaseItem(p);
executed 787 times by 1 test: releaseItem(p);
Executed by:
  • tst_qquickpathview
787
219-
220 if (requestedIndex >= 0
requestedIndex >= 0Description
TRUEnever evaluated
FALSEevaluated 844 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
0-844
221 if (model
modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
222 model->cancel(requestedIndex);
never executed: model->cancel(requestedIndex);
0
223 requestedIndex = -1;-
224 }
never executed: end of block
0
225-
226 items.clear();-
227 itemCache.clear();-
228 tl.clear();-
229}
executed 844 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
844
230-
231void QQuickPathViewPrivate::updateMappedRange()-
232{-
233 if (model && pathItems != -1
pathItems != -1Description
TRUEevaluated 308 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 410 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
&& pathItems < modelCount
pathItems < modelCountDescription
TRUEevaluated 194 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
114-410
234 mappedRange = qreal(modelCount)/pathItems;-
235 mappedCache = qreal(cacheSize)/pathItems/2;-
236 }
executed 194 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else {
194
237 mappedRange = 1.0;-
238 mappedCache = 0.0;-
239 }
executed 528 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
528
240}-
241-
242qreal QQuickPathViewPrivate::positionOfIndex(qreal index) const-
243{-
244 qreal pos = -1.0;-
245-
246 if (model && index >= 0
index >= 0Description
TRUEevaluated 51273 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
&& index < modelCount
index < modelCountDescription
TRUEevaluated 51273 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-51273
247 qreal start = 0.0;-
248 if (haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 51151 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& (highlightRangeMode != QQuickPathView::NoHighlightRange
highlightRange...HighlightRangeDescription
TRUEevaluated 47747 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3404 times by 1 test
Evaluated by:
  • tst_qquickpathview
122-51151
249 || snapMode != QQuickPathView::NoSnap
snapMode != QQ...thView::NoSnapDescription
TRUEevaluated 762 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2642 times by 1 test
Evaluated by:
  • tst_qquickpathview
))
762-2642
250 start = highlightRangeStart;
executed 48509 times by 3 tests: start = highlightRangeStart;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
48509
251 qreal globalPos = index + offset;-
252 globalPos = std::fmod(globalPos, qreal(modelCount)) / modelCount;-
253 if (pathItems != -1
pathItems != -1Description
TRUEevaluated 33188 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 18085 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
&& pathItems < modelCount
pathItems < modelCountDescription
TRUEevaluated 32984 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 204 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
204-33188
254 globalPos += start / mappedRange;-
255 globalPos = std::fmod(globalPos, qreal(1.0));-
256 pos = globalPos * mappedRange;-
257 }
executed 32984 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else {
32984
258 pos = std::fmod(globalPos + start, qreal(1.0));-
259 }
executed 18289 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
18289
260 }-
261-
262 return
executed 51273 times by 3 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
pos;
executed 51273 times by 3 tests: return pos;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
51273
263}-
264-
265-
266-
267bool QQuickPathViewPrivate::isInBound(qreal position, qreal lower, qreal upper) const-
268{-
269 if (lower == upper
lower == upperDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 5522 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
80-5522
270 return
executed 80 times by 1 test: return true;
Executed by:
  • tst_qquickpathview
true;
executed 80 times by 1 test: return true;
Executed by:
  • tst_qquickpathview
80
271 if (lower > upper
lower > upperDescription
TRUEevaluated 1932 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3590 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
1932-3590
272 if (position > upper
position > upperDescription
TRUEevaluated 1313 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 619 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& position > lower
position > lowerDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 1295 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
18-1313
273 position -= mappedRange;
executed 18 times by 1 test: position -= mappedRange;
Executed by:
  • tst_qquickpathview
18
274 lower -= mappedRange;-
275 }
executed 1932 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1932
276 return
executed 5522 times by 3 tests: return position >= lower && position < upper;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
position >= lower && position < upper;
executed 5522 times by 3 tests: return position >= lower && position < upper;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
5522
277}-
278-
279void QQuickPathViewPrivate::createHighlight()-
280{-
281 QQuickPathView * const q = q_func();-
282 if (!q->isComponentComplete()
!q->isComponentComplete()Description
TRUEevaluated 116 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 282 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
116-282
283 return;
executed 116 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
116
284-
285 bool changed = false;-
286 if (highlightItem
highlightItemDescription
TRUEnever evaluated
FALSEevaluated 282 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
0-282
287 highlightItem->setParentItem(nullptr);-
288 highlightItem->deleteLater();-
289 highlightItem = nullptr;-
290 changed = true;-
291 }
never executed: end of block
0
292-
293 QQuickItem *item = nullptr;-
294 if (highlightComponent
highlightComponentDescription
TRUEevaluated 116 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 166 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
116-166
295 QQmlContext *creationContext = highlightComponent->creationContext();-
296 QQmlContext *highlightContext = new QQmlContext(-
297 creationContext ? creationContext : qmlContext(q));-
298 QObject *nobj = highlightComponent->create(highlightContext);-
299 if (nobj
nobjDescription
TRUEevaluated 116 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-116
300 QQml_setParent_noEvent(highlightContext, nobj);-
301 item = qobject_cast<QQuickItem *>(nobj);-
302 if (!item
!itemDescription
TRUEnever evaluated
FALSEevaluated 116 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
0-116
303 delete nobj;
never executed: delete nobj;
0
304 }
executed 116 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else {
116
305 delete highlightContext;-
306 }
never executed: end of block
0
307 } else {-
308 item = new QQuickItem;-
309 }
executed 166 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
166
310 if (item
itemDescription
TRUEevaluated 282 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-282
311 QQml_setParent_noEvent(item, q);-
312 item->setParentItem(q);-
313 highlightItem = item;-
314 changed = true;-
315 }
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
316 if (changed
changedDescription
TRUEevaluated 282 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-282
317 q->highlightItemChanged();
executed 282 times by 3 tests: q->highlightItemChanged();
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
318}
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
319-
320void QQuickPathViewPrivate::updateHighlight()-
321{-
322 QQuickPathView * const q = q_func();-
323 if (!q->isComponentComplete()
!q->isComponentComplete()Description
TRUEevaluated 116 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 426 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !isValid()
!isValid()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 410 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
16-426
324 return;
executed 132 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
132
325 if (highlightItem
highlightItemDescription
TRUEevaluated 410 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-410
326 if (haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 410 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
&& highlightRangeMode == QQuickPathView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 334 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-410
327 updateItem(highlightItem, highlightRangeStart);-
328 }
executed 334 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else {
334
329 qreal target = currentIndex;-
330-
331 offsetAdj = 0.0;-
332 tl.reset(moveHighlight);-
333 moveHighlight.setValue(highlightPosition);-
334-
335 const int duration = highlightMoveDuration;-
336-
337 if (target - highlightPosition > modelCount/2
target - highl...> modelCount/2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-74
338 highlightUp = false;-
339 qreal distance = modelCount - target + highlightPosition;-
340 tl.move(moveHighlight, 0.0, QEasingCurve(QEasingCurve::InQuad), int(duration * highlightPosition / distance));-
341 tl.set(moveHighlight, modelCount-0.01);-
342 tl.move(moveHighlight, target, QEasingCurve(QEasingCurve::OutQuad), int(duration * (modelCount-target) / distance));-
343 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (target - highlightPosition <= -modelCount/2
target - highl... -modelCount/2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-72
344 highlightUp = true;-
345 qreal distance = modelCount - highlightPosition + target;-
346 tl.move(moveHighlight, modelCount-0.01, QEasingCurve(QEasingCurve::InQuad), int(duration * (modelCount-highlightPosition) / distance));-
347 tl.set(moveHighlight, 0.0);-
348 tl.move(moveHighlight, target, QEasingCurve(QEasingCurve::OutQuad), int(duration * target / distance));-
349 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
2
350 highlightUp = highlightPosition - target < 0;-
351 tl.move(moveHighlight, target, QEasingCurve(QEasingCurve::InOutQuad), duration);-
352 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
72
353 }-
354 }-
355}
executed 410 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
410
356-
357void QQuickPathViewPrivate::setHighlightPosition(qreal pos)-
358{-
359 if (pos != highlightPosition
pos != highlightPositionDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-76
360 qreal start = 0.0;-
361 qreal end = 1.0;-
362 if (haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& highlightRangeMode != QQuickPathView::NoHighlightRange
highlightRange...HighlightRangeDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-2
363 start = highlightRangeStart;-
364 end = highlightRangeEnd;-
365 }
never executed: end of block
0
366-
367 qreal range = qreal(modelCount);-
368-
369 qreal relativeHighlight = std::fmod(pos + offset, range) / range;-
370-
371 if (!highlightUp
!highlightUpDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& relativeHighlight > end / mappedRange
relativeHighli... / mappedRangeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-2
372 qreal diff = 1.0 - relativeHighlight;-
373 setOffset(offset + diff * range);-
374 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (highlightUp
highlightUpDescription
TRUEnever evaluated
FALSEnever evaluated
&& relativeHighlight >= (end - start) / mappedRange
relativeHighli... / mappedRangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-2
375 qreal diff = relativeHighlight - (end - start) / mappedRange;-
376 setOffset(offset - diff * range - 0.00001);-
377 }
never executed: end of block
0
378-
379 highlightPosition = pos;-
380 qreal pathPos = positionOfIndex(pos);-
381 updateItem(highlightItem, pathPos);-
382 if (QQuickPathViewAttached *att = attached(highlightItem)
QQuickPathView...highlightItem)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-2
383 att->setOnPath(pathPos < 1.0);
never executed: att->setOnPath(pathPos < 1.0);
0
384 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
385}
executed 78 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
78
386-
387void QQuickPathView::pathUpdated()-
388{-
389 QQuickPathViewPrivate * const d = d_func();-
390 for (QQuickItem *item : qAsConst(d->items)) {-
391 if (QQuickPathViewAttached *att = d->attached(item)
QQuickPathView...attached(item)Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-100
392 att->m_percent = -1;
executed 100 times by 1 test: att->m_percent = -1;
Executed by:
  • tst_qquickpathview
100
393 }
executed 100 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
100
394 refill();-
395}
executed 312 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
312
396-
397void QQuickPathViewPrivate::updateItem(QQuickItem *item, qreal percent)-
398{-
399 if (!path
!pathDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 45324 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
2-45324
400 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
401 if (QQuickPathViewAttached *att = attached(item)
QQuickPathView...attached(item)Description
TRUEevaluated 41074 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 4250 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
4250-41074
402 if (qFuzzyCompare(att->m_percent, percent)
qFuzzyCompare(...cent, percent)Description
TRUEevaluated 309 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 40765 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
309-40765
403 return;
executed 309 times by 1 test: return;
Executed by:
  • tst_qquickpathview
309
404 att->m_percent = percent;-
405 const auto attributes = path->attributes();-
406 for (const QString &attr : attributes)-
407 att->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
executed 3444 times by 2 tests: att->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
Executed by:
  • tst_examples
  • tst_qquickpathview
3444
408 att->setOnPath(percent < 1.0);-
409 }
executed 40765 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
40765
410 QQuickItemPrivate::get(item)->setCulled(percent >= 1.0);-
411 QPointF pf = path->pointAt(qMin(percent, qreal(1.0)));-
412 item->setX(pf.x() - item->width()/2);-
413 item->setY(pf.y() - item->height()/2);-
414}
executed 45015 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
45015
415-
416void QQuickPathViewPrivate::regenerate()-
417{-
418 QQuickPathView * const q = q_func();-
419 if (!q->isComponentComplete()
!q->isComponentComplete()Description
TRUEevaluated 542 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 430 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
430-542
420 return;
executed 542 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
542
421-
422 clear();-
423-
424 if (!isValid()
!isValid()Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 410 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
20-410
425 return;
executed 20 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
20
426-
427 updateMappedRange();-
428 q->refill();-
429}
executed 410 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
410
430-
431void QQuickPathViewPrivate::setDragging(bool d)-
432{-
433 QQuickPathView * const q = q_func();-
434 if (dragging == d
dragging == dDescription
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
44-68
435 return;
executed 68 times by 1 test: return;
Executed by:
  • tst_qquickpathview
68
436-
437 dragging = d;-
438 if (dragging
draggingDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
22
439 q->dragStarted();
executed 22 times by 1 test: q->dragStarted();
Executed by:
  • tst_qquickpathview
22
440 else-
441 q->dragEnded();
executed 22 times by 1 test: q->dragEnded();
Executed by:
  • tst_qquickpathview
22
442-
443 q->draggingChanged();-
444}
executed 44 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
44
445QQuickPathView::QQuickPathView(QQuickItem *parent)-
446 : QQuickItem(*(new QQuickPathViewPrivate), parent)-
447{-
448 QQuickPathViewPrivate * const d = d_func();-
449 d->init();-
450}
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
451-
452QQuickPathView::~QQuickPathView()-
453{-
454 QQuickPathViewPrivate * const d = d_func();-
455 d->clear();-
456 if (d->attType
d->attTypeDescription
TRUEevaluated 276 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
6-276
457 d->attType->release();
executed 276 times by 3 tests: d->attType->release();
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
276
458 if (d->ownModel
d->ownModelDescription
TRUEevaluated 260 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
22-260
459 delete d->model;
executed 260 times by 3 tests: delete d->model;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
260
460}
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
461QVariant QQuickPathView::model() const-
462{-
463 const QQuickPathViewPrivate * const d = d_func();-
464 return
executed 22 times by 1 test: return d->modelVariant;
Executed by:
  • tst_qquickpathview
d->modelVariant;
executed 22 times by 1 test: return d->modelVariant;
Executed by:
  • tst_qquickpathview
22
465}-
466-
467void QQuickPathView::setModel(const QVariant &m)-
468{-
469 QQuickPathViewPrivate * const d = d_func();-
470 QVariant model = m;-
471 if (model.userType() == qMetaTypeId<QJSValue>()
model.userType...Id<QJSValue>()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 282 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
6-282
472 model = model.value<QJSValue>().toVariant();
executed 6 times by 1 test: model = model.value<QJSValue>().toVariant();
Executed by:
  • tst_qquickpathview
6
473-
474 if (d->modelVariant == model
d->modelVariant == modelDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 284 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
4-284
475 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickpathview
4
476-
477 if (d->model
d->modelDescription
TRUEevaluated 126 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 158 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
126-158
478 { QQmlInstanceModel *sender = (d->model); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "628")); const char *method = (qFlagLocation("1""modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "628")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-120
479 __FILE__-
480 ,-
481 628-
482 )); signalIdx = QQmlInstanceModel::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-120
483 __FILE__-
484 ,-
485 628-
486 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
487 __FILE__-
488 ,-
489 628-
490 )); QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); }-
491 ;-
492 { QQmlInstanceModel *sender = (d->model); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""createdItem(int,QObject*)" "\0" __FILE__ ":" "630")); const char *method = (qFlagLocation("1""createdItem(int,QObject*)" "\0" __FILE__ ":" "630")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-120
493 __FILE__-
494 ,-
495 630-
496 )); signalIdx = QQmlInstanceModel::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-120
497 __FILE__-
498 ,-
499 630-
500 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
501 __FILE__-
502 ,-
503 630-
504 )); QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); }-
505 ;-
506 { QQmlInstanceModel *sender = (d->model); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""initItem(int,QObject*)" "\0" __FILE__ ":" "632")); const char *method = (qFlagLocation("1""initItem(int,QObject*)" "\0" __FILE__ ":" "632")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-120
507 __FILE__-
508 ,-
509 632-
510 )); signalIdx = QQmlInstanceModel::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-120
511 __FILE__-
512 ,-
513 632-
514 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
515 __FILE__-
516 ,-
517 632-
518 )); QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); }-
519 ;-
520 d->clear();-
521 }
executed 126 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
126
522-
523 d->modelVariant = model;-
524 QObject *object = qvariant_cast<QObject*>(model);-
525 QQmlInstanceModel *vim = nullptr;-
526 if (object
objectDescription
TRUEevaluated 248 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& (
(vim = qobject...el *>(object))Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 228 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
vim = qobject_cast<QQmlInstanceModel *>(object))
(vim = qobject...el *>(object))Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 228 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
20-248
527 if (d->ownModel
d->ownModelDescription
TRUEnever evaluated
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
0-20
528 delete d->model;-
529 d->ownModel = false;-
530 }
never executed: end of block
0
531 d->model = vim;-
532 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else {
20
533 if (!d->ownModel
!d->ownModelDescription
TRUEevaluated 138 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
126-138
534 d->model = new QQmlDelegateModel(qmlContext(this));-
535 d->ownModel = true;-
536 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
2-136
537 static_cast<
executed 2 times by 1 test: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
Executed by:
  • tst_qquickpathview
QQmlDelegateModel *>(d->model.data())->componentComplete();
executed 2 times by 1 test: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
Executed by:
  • tst_qquickpathview
2
538 }
executed 138 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
138
539 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 264 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-264
540 dataModel->setModel(model);
executed 264 times by 3 tests: dataModel->setModel(model);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
264
541 }
executed 264 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
264
542 int oldModelCount = d->modelCount;-
543 d->modelCount = 0;-
544 if (d->model
d->modelDescription
TRUEevaluated 284 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-284
545 { QQmlInstanceModel *sender = (d->model); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "659")); const char *method = (qFlagLocation("1""modelUpdated(QQmlChangeSet,bool)" "\0" __FILE__ ":" "659")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 278 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-278
546 __FILE__-
547 ,-
548 659-
549 )); signalIdx = QQmlInstanceModel::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 278 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-278
550 __FILE__-
551 ,-
552 659-
553 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
554 __FILE__-
555 ,-
556 659-
557 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
558 ;-
559 { QQmlInstanceModel *sender = (d->model); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""createdItem(int,QObject*)" "\0" __FILE__ ":" "661")); const char *method = (qFlagLocation("1""createdItem(int,QObject*)" "\0" __FILE__ ":" "661")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 278 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-278
560 __FILE__-
561 ,-
562 661-
563 )); signalIdx = QQmlInstanceModel::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 278 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-278
564 __FILE__-
565 ,-
566 661-
567 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
568 __FILE__-
569 ,-
570 661-
571 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
572 ;-
573 { QQmlInstanceModel *sender = (d->model); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""initItem(int,QObject*)" "\0" __FILE__ ":" "663")); const char *method = (qFlagLocation("1""initItem(int,QObject*)" "\0" __FILE__ ":" "663")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 278 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-278
574 __FILE__-
575 ,-
576 663-
577 )); signalIdx = QQmlInstanceModel::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 278 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-278
578 __FILE__-
579 ,-
580 663-
581 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
582 __FILE__-
583 ,-
584 663-
585 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
586 ;-
587 d->modelCount = d->model->count();-
588 }
executed 284 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
284
589 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 278 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
6-278
590 if (d->currentIndex != 0
d->currentIndex != 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-4
591 d->currentIndex = 0;-
592 currentIndexChanged();-
593 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
594 if (d->offset != 0.0
d->offset != 0.0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-4
595 d->offset = 0;-
596 offsetChanged();-
597 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
598 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
6
599 d->regenerate();-
600 if (d->modelCount != oldModelCount
d->modelCount != oldModelCountDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 270 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
14-270
601 countChanged();
executed 14 times by 1 test: countChanged();
Executed by:
  • tst_qquickpathview
14
602 modelChanged();-
603}
executed 284 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
284
604-
605-
606-
607-
608-
609int QQuickPathView::count() const-
610{-
611 const QQuickPathViewPrivate * const d = d_func();-
612 return
executed 358 times by 1 test: return d->model ? d->modelCount : 0;
Executed by:
  • tst_qquickpathview
d->model ? d->modelCount : 0;
executed 358 times by 1 test: return d->model ? d->modelCount : 0;
Executed by:
  • tst_qquickpathview
358
613}-
614-
615-
616-
617-
618-
619-
620QQuickPath *QQuickPathView::path() const-
621{-
622 const QQuickPathViewPrivate * const d = d_func();-
623 return
executed 58 times by 1 test: return d->path;
Executed by:
  • tst_qquickpathview
d->path;
executed 58 times by 1 test: return d->path;
Executed by:
  • tst_qquickpathview
58
624}-
625-
626void QQuickPathView::setPath(QQuickPath *path)-
627{-
628 QQuickPathViewPrivate * const d = d_func();-
629 if (d->path == path
d->path == pathDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 280 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
2-280
630 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
631 if (d->path
d->pathDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 276 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
4-276
632 { QQuickPath *sender = (d->path); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""changed()" "\0" __FILE__ ":" "710")); const char *method = (qFlagLocation("1""pathUpdated()" "\0" __FILE__ ":" "710")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
2
633 __FILE__-
634 ,-
635 710-
636 )); signalIdx = QQuickPath::staticMetaObject.indexOfSignal(signal+1); }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
2
637 __FILE__-
638 ,-
639 710-
640 )); if (code == 1
code == 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 2 times by 1 test: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_qquickpathview
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-2
641 __FILE__-
642 ,-
643 710-
644 )); QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
645 ;-
646 d->path = path;-
647-
648 if (path
pathDescription
TRUEevaluated 278 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-278
649 { QQuickPath *sender = (d->path); QQuickPathView *receiver = (this); const char *signal = (qFlagLocation("2""changed()" "\0" __FILE__ ":" "715")); const char *method = (qFlagLocation("1""pathUpdated()" "\0" __FILE__ ":" "715")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 272 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
6-272
650 __FILE__-
651 ,-
652 715-
653 )); signalIdx = QQuickPath::staticMetaObject.indexOfSignal(signal+1); }
executed 6 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 272 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
6-272
654 __FILE__-
655 ,-
656 715-
657 )); if (code == 1
code == 1Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
executed 6 times by 3 tests: methodIdx = QQuickPathView::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickPathView::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-6
658 __FILE__-
659 ,-
660 715-
661 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
662 ;-
663 }
executed 278 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
278
664-
665 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 274 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
6-274
666 d->clear();-
667 if (d->isValid()
d->isValid()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-4
668 if (d->attType
d->attTypeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-4
669 d->attType->release();-
670 d->attType = nullptr;-
671 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
672 d->regenerate();-
673 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
674 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
6
675-
676 pathChanged();-
677}
executed 280 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
280
678-
679-
680-
681-
682-
683int QQuickPathView::currentIndex() const-
684{-
685 const QQuickPathViewPrivate * const d = d_func();-
686 return
executed 845 times by 2 tests: return d->currentIndex;
Executed by:
  • tst_examples
  • tst_qquickpathview
d->currentIndex;
executed 845 times by 2 tests: return d->currentIndex;
Executed by:
  • tst_examples
  • tst_qquickpathview
845
687}-
688-
689void QQuickPathView::setCurrentIndex(int idx)-
690{-
691 QQuickPathViewPrivate * const d = d_func();-
692 if (!isComponentComplete()
!isComponentComplete()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
6-146
693 if (idx != d->currentIndex
idx != d->currentIndexDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-6
694 d->currentIndex = idx;-
695 currentIndexChanged();-
696 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
6
697 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qquickpathview
6
698 }-
699-
700 idx = d->modelCount
d->modelCountDescription
TRUEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
0-146
701 ? ((idx % d->modelCount) + d->modelCount) % d->modelCount-
702 : 0;-
703 if (d->model && (idx != d->currentIndex
idx != d->currentIndexDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !d->currentItem
!d->currentItemDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
)) {
0-144
704 if (d->currentItem
d->currentItemDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-144
705 if (QQuickPathViewAttached *att = d->attached(d->currentItem)
QQuickPathView...->currentItem)Description
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-144
706 att->setIsCurrentItem(false);
executed 144 times by 1 test: att->setIsCurrentItem(false);
Executed by:
  • tst_qquickpathview
144
707 d->releaseItem(d->currentItem);-
708 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
144
709 int oldCurrentIdx = d->currentIndex;-
710 QQuickItem *oldCurrentItem = d->currentItem;-
711 d->currentItem = nullptr;-
712 d->moveReason = QQuickPathViewPrivate::SetIndex;-
713 d->currentIndex = idx;-
714 if (d->modelCount
d->modelCountDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-144
715 d->createCurrentItem();-
716 if (d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& d->highlightRangeMode == QQuickPathView::StrictlyEnforceRange
d->highlightRa...lyEnforceRangeDescription
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-144
717 d->snapToIndex(d->currentIndex, QQuickPathViewPrivate::SetIndex);
executed 76 times by 1 test: d->snapToIndex(d->currentIndex, QQuickPathViewPrivate::SetIndex);
Executed by:
  • tst_qquickpathview
76
718 d->currentItemOffset = d->positionOfIndex(d->currentIndex);-
719 d->updateHighlight();-
720 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
144
721 if (oldCurrentIdx != d->currentIndex
oldCurrentIdx ...->currentIndexDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-144
722 currentIndexChanged();
executed 144 times by 1 test: currentIndexChanged();
Executed by:
  • tst_qquickpathview
144
723 if (oldCurrentItem != d->currentItem
oldCurrentItem...d->currentItemDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-144
724 currentItemChanged();
executed 144 times by 1 test: currentItemChanged();
Executed by:
  • tst_qquickpathview
144
725 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
144
726}
executed 146 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
146
727-
728-
729-
730-
731-
732QQuickItem *QQuickPathView::currentItem() const-
733{-
734 const QQuickPathViewPrivate * const d = d_func();-
735 return
executed 44 times by 1 test: return d->currentItem;
Executed by:
  • tst_qquickpathview
d->currentItem;
executed 44 times by 1 test: return d->currentItem;
Executed by:
  • tst_qquickpathview
44
736}-
737void QQuickPathView::incrementCurrentIndex()-
738{-
739 QQuickPathViewPrivate * const d = d_func();-
740 d->moveDirection = QQuickPathView::Positive;-
741 setCurrentIndex(currentIndex()+1);-
742}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
743void QQuickPathView::decrementCurrentIndex()-
744{-
745 QQuickPathViewPrivate * const d = d_func();-
746 d->moveDirection = QQuickPathView::Negative;-
747 setCurrentIndex(currentIndex()-1);-
748}
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
12
749-
750-
751-
752-
753-
754-
755-
756qreal QQuickPathView::offset() const-
757{-
758 const QQuickPathViewPrivate * const d = d_func();-
759 return
executed 1706 times by 1 test: return d->offset;
Executed by:
  • tst_qquickpathview
d->offset;
executed 1706 times by 1 test: return d->offset;
Executed by:
  • tst_qquickpathview
1706
760}-
761-
762void QQuickPathView::setOffset(qreal offset)-
763{-
764 QQuickPathViewPrivate * const d = d_func();-
765 d->moveReason = QQuickPathViewPrivate::Other;-
766 d->setOffset(offset);-
767 d->updateCurrent();-
768}
executed 328 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
328
769-
770void QQuickPathViewPrivate::setOffset(qreal o)-
771{-
772 QQuickPathView * const q = q_func();-
773 if (offset != o
offset != oDescription
TRUEevaluated 3491 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
124-3491
774 if (isValid()
isValid()Description
TRUEevaluated 3417 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& q->isComponentComplete()
q->isComponentComplete()Description
TRUEevaluated 3417 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-3417
775 qreal oldOffset = offset;-
776 offset = std::fmod(o, qreal(modelCount));-
777 if (offset < 0
offset < 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 3401 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
16-3401
778 offset += qreal(modelCount);
executed 16 times by 1 test: offset += qreal(modelCount);
Executed by:
  • tst_qquickpathview
16
779 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 3417 times by 1 test
Evaluated by:
  • tst_qquickpathview
; qt_category_enabled = false) QMessageLogger(__FILE__, 848, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << o << "was" << oldOffset << "now" << offset;
never executed: QMessageLogger(__FILE__, 848, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << o << "was" << oldOffset << "now" << offset;
0-3417
780 q->refill();-
781 }
executed 3417 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
3417
782 offset = o;-
783 }
executed 74 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
74
784 q->offsetChanged();-
785 }
executed 3491 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3491
786}
executed 3615 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3615
787-
788void QQuickPathViewPrivate::setAdjustedOffset(qreal o)-
789{-
790 setOffset(o+offsetAdj);-
791}
executed 3285 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3285
792QQmlComponent *QQuickPathView::highlight() const-
793{-
794 const QQuickPathViewPrivate * const d = d_func();-
795 return
never executed: return d->highlightComponent;
d->highlightComponent;
never executed: return d->highlightComponent;
0
796}-
797-
798void QQuickPathView::setHighlight(QQmlComponent *highlight)-
799{-
800 QQuickPathViewPrivate * const d = d_func();-
801 if (highlight != d->highlightComponent
highlight != d...lightComponentDescription
TRUEevaluated 116 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-116
802 d->highlightComponent = highlight;-
803 d->createHighlight();-
804 d->updateHighlight();-
805 highlightChanged();-
806 }
executed 116 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
116
807}
executed 116 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
116
808QQuickItem *QQuickPathView::highlightItem() const-
809{-
810 const QQuickPathViewPrivate * const d = d_func();-
811 return
executed 10 times by 1 test: return d->highlightItem;
Executed by:
  • tst_qquickpathview
d->highlightItem;
executed 10 times by 1 test: return d->highlightItem;
Executed by:
  • tst_qquickpathview
10
812}-
813qreal QQuickPathView::preferredHighlightBegin() const-
814{-
815 const QQuickPathViewPrivate * const d = d_func();-
816 return
executed 12 times by 1 test: return d->highlightRangeStart;
Executed by:
  • tst_qquickpathview
d->highlightRangeStart;
executed 12 times by 1 test: return d->highlightRangeStart;
Executed by:
  • tst_qquickpathview
12
817}-
818-
819void QQuickPathView::setPreferredHighlightBegin(qreal start)-
820{-
821 QQuickPathViewPrivate * const d = d_func();-
822 if (d->highlightRangeStart == start
d->highlightRa...Start == startDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
|| start < 0
start < 0Description
TRUEnever evaluated
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
|| start > 1.0
start > 1.0Description
TRUEnever evaluated
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
0-120
823 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickpathview
4
824 d->highlightRangeStart = start;-
825 d->haveHighlightRange = d->highlightRangeStart <= d->highlightRangeEnd;-
826 refill();-
827 preferredHighlightBeginChanged();-
828}
executed 120 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
120
829-
830qreal QQuickPathView::preferredHighlightEnd() const-
831{-
832 const QQuickPathViewPrivate * const d = d_func();-
833 return
executed 2 times by 1 test: return d->highlightRangeEnd;
Executed by:
  • tst_qquickpathview
d->highlightRangeEnd;
executed 2 times by 1 test: return d->highlightRangeEnd;
Executed by:
  • tst_qquickpathview
2
834}-
835-
836void QQuickPathView::setPreferredHighlightEnd(qreal end)-
837{-
838 QQuickPathViewPrivate * const d = d_func();-
839 if (d->highlightRangeEnd == end
d->highlightRangeEnd == endDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
|| end < 0
end < 0Description
TRUEnever evaluated
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
|| end > 1.0
end > 1.0Description
TRUEnever evaluated
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
0-120
840 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickpathview
4
841 d->highlightRangeEnd = end;-
842 d->haveHighlightRange = d->highlightRangeStart <= d->highlightRangeEnd;-
843 refill();-
844 preferredHighlightEndChanged();-
845}
executed 120 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
120
846-
847QQuickPathView::HighlightRangeMode QQuickPathView::highlightRangeMode() const-
848{-
849 const QQuickPathViewPrivate * const d = d_func();-
850 return
never executed: return d->highlightRangeMode;
d->highlightRangeMode;
never executed: return d->highlightRangeMode;
0
851}-
852-
853void QQuickPathView::setHighlightRangeMode(HighlightRangeMode mode)-
854{-
855 QQuickPathViewPrivate * const d = d_func();-
856 if (d->highlightRangeMode == mode
d->highlightRangeMode == modeDescription
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
92-122
857 return;
executed 122 times by 1 test: return;
Executed by:
  • tst_qquickpathview
122
858 d->highlightRangeMode = mode;-
859 d->haveHighlightRange = d->highlightRangeStart <= d->highlightRangeEnd;-
860 if (d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-92
861 d->regenerate();-
862 int index = d->highlightRangeMode != NoHighlightRange
d->highlightRa...HighlightRangeDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickpathview
? d->currentIndex : d->calcCurrentIndex();
6-86
863 if (index >= 0
index >= 0Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-92
864 d->snapToIndex(index, QQuickPathViewPrivate::Other);
executed 92 times by 1 test: d->snapToIndex(index, QQuickPathViewPrivate::Other);
Executed by:
  • tst_qquickpathview
92
865 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
92
866 highlightRangeModeChanged();-
867}
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
92
868int QQuickPathView::highlightMoveDuration() const-
869{-
870 const QQuickPathViewPrivate * const d = d_func();-
871 return
never executed: return d->highlightMoveDuration;
d->highlightMoveDuration;
never executed: return d->highlightMoveDuration;
0
872}-
873-
874void QQuickPathView::setHighlightMoveDuration(int duration)-
875{-
876 QQuickPathViewPrivate * const d = d_func();-
877 if (d->highlightMoveDuration == duration
d->highlightMo...on == durationDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-18
878 return;
never executed: return;
0
879 d->highlightMoveDuration = duration;-
880 highlightMoveDurationChanged();-
881}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
18
882qreal QQuickPathView::dragMargin() const-
883{-
884 const QQuickPathViewPrivate * const d = d_func();-
885 return
executed 12 times by 1 test: return d->dragMargin;
Executed by:
  • tst_qquickpathview
d->dragMargin;
executed 12 times by 1 test: return d->dragMargin;
Executed by:
  • tst_qquickpathview
12
886}-
887-
888void QQuickPathView::setDragMargin(qreal dragMargin)-
889{-
890 QQuickPathViewPrivate * const d = d_func();-
891 if (d->dragMargin == dragMargin
d->dragMargin == dragMarginDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 100 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
4-100
892 return;
executed 4 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
4
893 d->dragMargin = dragMargin;-
894 dragMarginChanged();-
895}
executed 100 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
100
896-
897-
898-
899-
900-
901-
902-
903qreal QQuickPathView::flickDeceleration() const-
904{-
905 const QQuickPathViewPrivate * const d = d_func();-
906 return
never executed: return d->deceleration;
d->deceleration;
never executed: return d->deceleration;
0
907}-
908-
909void QQuickPathView::setFlickDeceleration(qreal dec)-
910{-
911 QQuickPathViewPrivate * const d = d_func();-
912 if (d->deceleration == dec
d->deceleration == decDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-8
913 return;
never executed: return;
0
914 d->deceleration = dec;-
915 flickDecelerationChanged();-
916}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
8
917-
918-
919-
920-
921-
922-
923-
924qreal QQuickPathView::maximumFlickVelocity() const-
925{-
926 const QQuickPathViewPrivate * const d = d_func();-
927 return
never executed: return d->maximumFlickVelocity;
d->maximumFlickVelocity;
never executed: return d->maximumFlickVelocity;
0
928}-
929-
930void QQuickPathView::setMaximumFlickVelocity(qreal vel)-
931{-
932 QQuickPathViewPrivate * const d = d_func();-
933 if (vel == d->maximumFlickVelocity
vel == d->maximumFlickVelocityDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
2-8
934 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
935 d->maximumFlickVelocity = vel;-
936 maximumFlickVelocityChanged();-
937}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
8
938bool QQuickPathView::isInteractive() const-
939{-
940 const QQuickPathViewPrivate * const d = d_func();-
941 return
never executed: return d->interactive;
d->interactive;
never executed: return d->interactive;
0
942}-
943-
944void QQuickPathView::setInteractive(bool interactive)-
945{-
946 QQuickPathViewPrivate * const d = d_func();-
947 if (interactive != d->interactive
interactive != d->interactiveDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-2
948 d->interactive = interactive;-
949 if (!interactive
!interactiveDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-2
950 d->tl.clear();
executed 2 times by 1 test: d->tl.clear();
Executed by:
  • tst_qquickpathview
2
951 interactiveChanged();-
952 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
953}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
954-
955-
956-
957-
958-
959-
960-
961bool QQuickPathView::isMoving() const-
962{-
963 const QQuickPathViewPrivate * const d = d_func();-
964 return
executed 582 times by 1 test: return d->moving;
Executed by:
  • tst_qquickpathview
d->moving;
executed 582 times by 1 test: return d->moving;
Executed by:
  • tst_qquickpathview
582
965}-
966-
967-
968-
969-
970-
971-
972-
973bool QQuickPathView::isFlicking() const-
974{-
975 const QQuickPathViewPrivate * const d = d_func();-
976 return
executed 6 times by 1 test: return d->flicking;
Executed by:
  • tst_qquickpathview
d->flicking;
executed 6 times by 1 test: return d->flicking;
Executed by:
  • tst_qquickpathview
6
977}-
978-
979-
980-
981-
982-
983-
984-
985bool QQuickPathView::isDragging() const-
986{-
987 const QQuickPathViewPrivate * const d = d_func();-
988 return
executed 12 times by 1 test: return d->dragging;
Executed by:
  • tst_qquickpathview
d->dragging;
executed 12 times by 1 test: return d->dragging;
Executed by:
  • tst_qquickpathview
12
989}-
990QQmlComponent *QQuickPathView::delegate() const-
991{-
992 const QQuickPathViewPrivate * const d = d_func();-
993 if (d->model
d->modelDescription
TRUEevaluated 146 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 124 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
124-146
994 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 146 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
)
0-146
995 return
executed 146 times by 2 tests: return dataModel->delegate();
Executed by:
  • tst_examples
  • tst_qquickpathview
dataModel->delegate();
executed 146 times by 2 tests: return dataModel->delegate();
Executed by:
  • tst_examples
  • tst_qquickpathview
146
996 }
never executed: end of block
0
997-
998 return
executed 124 times by 3 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
nullptr;
executed 124 times by 3 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
124
999}-
1000-
1001void QQuickPathView::setDelegate(QQmlComponent *delegate)-
1002{-
1003 QQuickPathViewPrivate * const d = d_func();-
1004 if (delegate
delegate == this->delegate()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 258 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
== this->delegate()
delegate == this->delegate()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 258 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
2-258
1005 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1006 if (!d->ownModel
!d->ownModelDescription
TRUEevaluated 122 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
122-136
1007 d->model = new QQmlDelegateModel(qmlContext(this));-
1008 d->ownModel = true;-
1009 if (isComponentComplete()
isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 122 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-122
1010 static_cast<
never executed: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
QQmlDelegateModel *>(d->model.data())->componentComplete();
never executed: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
0
1011 }
executed 122 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
122
1012 if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)
QQmlDelegateMo...el*>(d->model)Description
TRUEevaluated 258 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-258
1013 int oldCount = dataModel->count();-
1014 dataModel->setDelegate(delegate);-
1015 d->modelCount = dataModel->count();-
1016 d->regenerate();-
1017 if (oldCount != dataModel->count()
oldCount != dataModel->count()Description
TRUEnever evaluated
FALSEevaluated 258 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-258
1018 countChanged();
never executed: countChanged();
0
1019 delegateChanged();-
1020 d->delegateValidated = false;-
1021 }
executed 258 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
258
1022}
executed 258 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
258
1023-
1024-
1025-
1026-
1027-
1028-
1029-
1030int QQuickPathView::pathItemCount() const-
1031{-
1032 const QQuickPathViewPrivate * const d = d_func();-
1033 return
executed 24 times by 2 tests: return d->pathItems;
Executed by:
  • tst_examples
  • tst_qquickpathview
d->pathItems;
executed 24 times by 2 tests: return d->pathItems;
Executed by:
  • tst_examples
  • tst_qquickpathview
24
1034}-
1035-
1036void QQuickPathView::setPathItemCount(int i)-
1037{-
1038 QQuickPathViewPrivate * const d = d_func();-
1039 if (i == d->pathItems
i == d->pathItemsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
2-136
1040 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1041 if (i < 1
i < 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 134 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
2-134
1042 i = 1;
executed 2 times by 1 test: i = 1;
Executed by:
  • tst_examples
2
1043 d->pathItems = i;-
1044 d->updateMappedRange();-
1045 if (d->isValid()
d->isValid()Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 104 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& isComponentComplete()
isComponentComplete()Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-104
1046 d->regenerate();-
1047 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
32
1048 pathItemCountChanged();-
1049}
executed 136 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
136
1050-
1051void QQuickPathView::resetPathItemCount()-
1052{-
1053 QQuickPathViewPrivate * const d = d_func();-
1054 if (-
-1 == d->pathItemsDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
1 == d->pathItems
-1 == d->pathItemsDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-18
1055 return;
never executed: return;
0
1056 d->pathItems = -1;-
1057 d->updateMappedRange();-
1058 if (d->isValid()
d->isValid()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& isComponentComplete()
isComponentComplete()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-18
1059 d->regenerate();
executed 18 times by 1 test: d->regenerate();
Executed by:
  • tst_qquickpathview
18
1060 pathItemCountChanged();-
1061}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
18
1062int QQuickPathView::cacheItemCount() const-
1063{-
1064 const QQuickPathViewPrivate * const d = d_func();-
1065 return
executed 4 times by 1 test: return d->cacheSize;
Executed by:
  • tst_qquickpathview
d->cacheSize;
executed 4 times by 1 test: return d->cacheSize;
Executed by:
  • tst_qquickpathview
4
1066}-
1067-
1068void QQuickPathView::setCacheItemCount(int i)-
1069{-
1070 QQuickPathViewPrivate * const d = d_func();-
1071 if (i == d->cacheSize
i == d->cacheSizeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| i < 0
i < 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-4
1072 return;
never executed: return;
0
1073-
1074 d->cacheSize = i;-
1075 d->updateMappedRange();-
1076 refill();-
1077 cacheItemCountChanged();-
1078}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
1079QQuickPathView::SnapMode QQuickPathView::snapMode() const-
1080{-
1081 const QQuickPathViewPrivate * const d = d_func();-
1082 return
never executed: return d->snapMode;
d->snapMode;
never executed: return d->snapMode;
0
1083}-
1084-
1085void QQuickPathView::setSnapMode(SnapMode mode)-
1086{-
1087 QQuickPathViewPrivate * const d = d_func();-
1088 if (mode == d->snapMode
mode == d->snapModeDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-22
1089 return;
never executed: return;
0
1090 d->snapMode = mode;-
1091 snapModeChanged();-
1092}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
22
1093QQuickPathView::MovementDirection QQuickPathView::movementDirection() const-
1094{-
1095 const QQuickPathViewPrivate * const d = d_func();-
1096 return
executed 6 times by 1 test: return d->movementDirection;
Executed by:
  • tst_qquickpathview
d->movementDirection;
executed 6 times by 1 test: return d->movementDirection;
Executed by:
  • tst_qquickpathview
6
1097}-
1098-
1099void QQuickPathView::setMovementDirection(QQuickPathView::MovementDirection dir)-
1100{-
1101 QQuickPathViewPrivate * const d = d_func();-
1102 if (dir == d->movementDirection
dir == d->movementDirectionDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
2-6
1103 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1104 d->movementDirection = dir;-
1105 if (!d->tl.isActive()
!d->tl.isActive()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-6
1106 d->moveDirection = d->movementDirection;
executed 6 times by 1 test: d->moveDirection = d->movementDirection;
Executed by:
  • tst_qquickpathview
6
1107 movementDirectionChanged();-
1108}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
6
1109void QQuickPathView::positionViewAtIndex(int index, int mode)-
1110{-
1111 QQuickPathViewPrivate * const d = d_func();-
1112 if (!d->isValid()
!d->isValid()Description
TRUEnever evaluated
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-44
1113 return;
never executed: return;
0
1114 if (mode < QQuickPathView::Beginning
mode < QQuickP...iew::BeginningDescription
TRUEnever evaluated
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| mode > QQuickPathView::SnapPosition
mode > QQuickP...::SnapPositionDescription
TRUEnever evaluated
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| mode == 3
mode == 3Description
TRUEnever evaluated
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-44
1115 return;
never executed: return;
0
1116-
1117 if (mode == QQuickPathView::Contain
mode == QQuick...hView::ContainDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& (d->pathItems < 0
d->pathItems < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| d->modelCount <= d->pathItems
d->modelCount <= d->pathItemsDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickpathview
))
0-28
1118 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickpathview
4
1119-
1120 int count = d->pathItems == -1
d->pathItems == -1Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
? d->modelCount : qMin(d->pathItems, d->modelCount);
14-26
1121 int idx = (index+d->modelCount) % d->modelCount;-
1122 bool snap = d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& (d->highlightRangeMode != QQuickPathView::NoHighlightRange
d->highlightRa...HighlightRangeDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
0-40
1123 || d->snapMode != QQuickPathView::NoSnap
d->snapMode !=...thView::NoSnapDescription
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
);
0-18
1124-
1125 qreal beginOffset;-
1126 qreal endOffset;-
1127 if (snap
snapDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
18-22
1128 beginOffset = d->modelCount - idx - qFloor(count * d->highlightRangeStart);-
1129 endOffset = beginOffset + count - 1;-
1130 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
22
1131 beginOffset = d->modelCount - idx;-
1132-
1133-
1134 qreal adj = sizeof(qreal) == sizeof(float)
sizeof(qreal) == sizeof(float)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
? 0.00001f : 0.000000000001;
0-18
1135 endOffset = std::fmod(beginOffset + count, qreal(d->modelCount)) - adj;-
1136 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
18
1137 qreal offset = d->offset;-
1138 switch (mode) {-
1139 case
executed 8 times by 1 test: case Beginning:
Executed by:
  • tst_qquickpathview
Beginning:
executed 8 times by 1 test: case Beginning:
Executed by:
  • tst_qquickpathview
8
1140 offset = beginOffset;-
1141 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickpathview
8
1142 case
executed 8 times by 1 test: case End:
Executed by:
  • tst_qquickpathview
End:
executed 8 times by 1 test: case End:
Executed by:
  • tst_qquickpathview
8
1143 offset = endOffset;-
1144 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickpathview
8
1145 case
executed 8 times by 1 test: case Center:
Executed by:
  • tst_qquickpathview
Center:
executed 8 times by 1 test: case Center:
Executed by:
  • tst_qquickpathview
8
1146 if (beginOffset < endOffset
beginOffset < endOffsetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
4
1147 offset = (beginOffset + endOffset)/2;
executed 4 times by 1 test: offset = (beginOffset + endOffset)/2;
Executed by:
  • tst_qquickpathview
4
1148 else-
1149 offset = (beginOffset + (endOffset + d->modelCount))/2;
executed 4 times by 1 test: offset = (beginOffset + (endOffset + d->modelCount))/2;
Executed by:
  • tst_qquickpathview
4
1150 if (snap
snapDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
4
1151 offset = qRound(offset);
executed 4 times by 1 test: offset = qRound(offset);
Executed by:
  • tst_qquickpathview
4
1152 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickpathview
8
1153 case
executed 12 times by 1 test: case Contain:
Executed by:
  • tst_qquickpathview
Contain:
executed 12 times by 1 test: case Contain:
Executed by:
  • tst_qquickpathview
12
1154 if ((beginOffset < endOffset
beginOffset < endOffsetDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& (d->offset < beginOffset
d->offset < beginOffsetDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
|| d->offset > endOffset
d->offset > endOffsetDescription
TRUEnever evaluated
FALSEnever evaluated
))
0-6
1155 || (d->offset < beginOffset
d->offset < beginOffsetDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& d->offset > endOffset
d->offset > endOffsetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
)) {
0-6
1156 qreal diff1 = std::fmod(beginOffset - d->offset + d->modelCount, qreal(d->modelCount));-
1157 qreal diff2 = std::fmod(d->offset - endOffset + d->modelCount, qreal(d->modelCount));-
1158 if (diff1 < diff2
diff1 < diff2Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
4-6
1159 offset = beginOffset;
executed 4 times by 1 test: offset = beginOffset;
Executed by:
  • tst_qquickpathview
4
1160 else-
1161 offset = endOffset;
executed 6 times by 1 test: offset = endOffset;
Executed by:
  • tst_qquickpathview
6
1162 }-
1163 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qquickpathview
12
1164 case
executed 4 times by 1 test: case SnapPosition:
Executed by:
  • tst_qquickpathview
SnapPosition:
executed 4 times by 1 test: case SnapPosition:
Executed by:
  • tst_qquickpathview
4
1165 offset = d->modelCount - idx;-
1166 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickpathview
4
1167 }-
1168-
1169 d->tl.clear();-
1170 setOffset(offset);-
1171}
executed 40 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
40
1172int QQuickPathView::indexAt(qreal x, qreal y) const-
1173{-
1174 const QQuickPathViewPrivate * const d = d_func();-
1175 QQuickItem *item = itemAt(x, y);-
1176 return
executed 10 times by 1 test: return item ? d->model->indexOf(item, nullptr) : -1;
Executed by:
  • tst_qquickpathview
item ? d->model->indexOf(item, nullptr) : -1;
executed 10 times by 1 test: return item ? d->model->indexOf(item, nullptr) : -1;
Executed by:
  • tst_qquickpathview
10
1177}-
1178QQuickItem *QQuickPathView::itemAt(qreal x, qreal y) const-
1179{-
1180 const QQuickPathViewPrivate * const d = d_func();-
1181 if (!d->isValid()
!d->isValid()Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-20
1182 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
1183-
1184 for (QQuickItem *item : d->items) {-
1185 QPointF p = item->mapFromItem(this, QPointF(x, y));-
1186 if (item->contains(p)
item->contains(p)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
12-64
1187 return
executed 12 times by 1 test: return item;
Executed by:
  • tst_qquickpathview
item;
executed 12 times by 1 test: return item;
Executed by:
  • tst_qquickpathview
12
1188 }
executed 64 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
64
1189-
1190 return
executed 8 times by 1 test: return nullptr;
Executed by:
  • tst_qquickpathview
nullptr;
executed 8 times by 1 test: return nullptr;
Executed by:
  • tst_qquickpathview
8
1191}-
1192-
1193QPointF QQuickPathViewPrivate::pointNear(const QPointF &point, qreal *nearPercent) const-
1194{-
1195 const auto pathLength = path->path().length();-
1196 qreal samples = qMin(pathLength / 5, qreal(500.0));-
1197 qreal res = pathLength / samples;-
1198-
1199 qreal mindist = 1e10;-
1200 QPointF nearPoint = path->pointAt(0);-
1201 qreal nearPc = 0;-
1202-
1203-
1204 for (qreal i=1; i < samples
i < samplesDescription
TRUEevaluated 22836 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 156 times by 1 test
Evaluated by:
  • tst_qquickpathview
; i++) {
156-22836
1205 QPointF pt = path->pointAt(i/samples);-
1206 QPointF diff = pt - point;-
1207 qreal dist = diff.x()*diff.x() + diff.y()*diff.y();-
1208 if (dist < mindist
dist < mindistDescription
TRUEevaluated 8382 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 14454 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
8382-14454
1209 nearPoint = pt;-
1210 nearPc = i;-
1211 mindist = dist;-
1212 }
executed 8382 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
8382
1213 }
executed 22836 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
22836
1214-
1215-
1216 qreal approxPc = nearPc;-
1217 for (qreal i = approxPc-1.0; i < approxPc+1.0
i < approxPc+1.0Description
TRUEevaluated 3204 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 156 times by 1 test
Evaluated by:
  • tst_qquickpathview
; i += 1/(2*res)) {
156-3204
1218 QPointF pt = path->pointAt(i/samples);-
1219 QPointF diff = pt - point;-
1220 qreal dist = diff.x()*diff.x() + diff.y()*diff.y();-
1221 if (dist < mindist
dist < mindistDescription
TRUEevaluated 252 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2952 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
252-2952
1222 nearPoint = pt;-
1223 nearPc = i;-
1224 mindist = dist;-
1225 }
executed 252 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
252
1226 }
executed 3204 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3204
1227-
1228 if (nearPercent
nearPercentDescription
TRUEevaluated 156 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-156
1229 *
executed 156 times by 1 test: *nearPercent = nearPc / samples;
Executed by:
  • tst_qquickpathview
nearPercent = nearPc / samples;
executed 156 times by 1 test: *nearPercent = nearPc / samples;
Executed by:
  • tst_qquickpathview
156
1230-
1231 return
executed 156 times by 1 test: return nearPoint;
Executed by:
  • tst_qquickpathview
nearPoint;
executed 156 times by 1 test: return nearPoint;
Executed by:
  • tst_qquickpathview
156
1232}-
1233-
1234void QQuickPathViewPrivate::addVelocitySample(qreal v)-
1235{-
1236 velocityBuffer.append(v);-
1237 if (velocityBuffer.count() > 3
velocityBuffer.count() > 3Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
16-52
1238 velocityBuffer.remove(0);
executed 16 times by 1 test: velocityBuffer.remove(0);
Executed by:
  • tst_qquickpathview
16
1239}
executed 68 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
68
1240-
1241qreal QQuickPathViewPrivate::calcVelocity() const-
1242{-
1243 qreal velocity = 0;-
1244 if (velocityBuffer.count() > 0
velocityBuffer.count() > 0Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-18
1245 int count = velocityBuffer.count()-0;-
1246 for (int i = 0; i < count
i < countDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
; ++i) {
18-50
1247 qreal v = velocityBuffer.at(i);-
1248 velocity += v;-
1249 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
50
1250 velocity /= count;-
1251 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
18
1252 return
executed 20 times by 1 test: return velocity;
Executed by:
  • tst_qquickpathview
velocity;
executed 20 times by 1 test: return velocity;
Executed by:
  • tst_qquickpathview
20
1253}-
1254-
1255qint64 QQuickPathViewPrivate::computeCurrentTime(QInputEvent *event) const-
1256{-
1257 if (0 != event->timestamp()
0 != event->timestamp()Description
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
4-152
1258 return
executed 152 times by 1 test: return event->timestamp();
Executed by:
  • tst_qquickpathview
event->timestamp();
executed 152 times by 1 test: return event->timestamp();
Executed by:
  • tst_qquickpathview
152
1259 return
executed 4 times by 1 test: return timer.elapsed();
Executed by:
  • tst_qquickpathview
timer.elapsed();
executed 4 times by 1 test: return timer.elapsed();
Executed by:
  • tst_qquickpathview
4
1260}-
1261-
1262void QQuickPathView::mousePressEvent(QMouseEvent *event)-
1263{-
1264 QQuickPathViewPrivate * const d = d_func();-
1265 if (d->interactive
d->interactiveDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-20
1266 d->handleMousePressEvent(event);-
1267 event->accept();-
1268 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
20
1269 QQuickItem::mousePressEvent(event);-
1270 }
never executed: end of block
0
1271}-
1272-
1273void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event)-
1274{-
1275 if (!interactive
!interactiveDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !items.count()
!items.count()Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !model
!modelDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !modelCount
!modelCountDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-26
1276 return;
never executed: return;
0
1277 velocityBuffer.clear();-
1278 int idx = 0;-
1279 for (; idx < items.count()
idx < items.count()Description
TRUEevaluated 232 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
; ++idx) {
10-232
1280 QQuickItem *item = items.at(idx);-
1281 if (item->contains(item->mapFromScene(event->windowPos()))
item->contains...>windowPos()))Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 216 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
16-216
1282 break;
executed 16 times by 1 test: break;
Executed by:
  • tst_qquickpathview
16
1283 }
executed 216 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
216
1284 if (idx == items.count()
idx == items.count()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& dragMargin == 0.
dragMargin == 0.Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-16
1285 return;
never executed: return;
0
1286-
1287 startPoint = pointNear(event->localPos(), &startPc);-
1288 startPos = event->localPos();-
1289 if (idx == items.count()
idx == items.count()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
10-16
1290 qreal distance = qAbs(event->localPos().x() - startPoint.x()) + qAbs(event->localPos().y() - startPoint.y());-
1291 if (distance > dragMargin
distance > dragMarginDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-10
1292 return;
never executed: return;
0
1293 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
10
1294-
1295-
1296 if (tl.isActive()
tl.isActive()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& flicking
flickingDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& flickDuration
flickDurationDescription
TRUEnever evaluated
FALSEnever evaluated
&& qreal(tl.time())/flickDuration < 0.8
qreal(tl.time(...Duration < 0.8Description
TRUEnever evaluated
FALSEnever evaluated
)
0-22
1297 stealMouse = true;
never executed: stealMouse = true;
0
1298 else-
1299 stealMouse = false;
executed 26 times by 1 test: stealMouse = false;
Executed by:
  • tst_qquickpathview
26
1300-
1301 timer.start();-
1302 lastPosTime = computeCurrentTime(event);-
1303 tl.clear();-
1304}
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
26
1305-
1306void QQuickPathView::mouseMoveEvent(QMouseEvent *event)-
1307{-
1308 QQuickPathViewPrivate * const d = d_func();-
1309 if (d->interactive
d->interactiveDescription
TRUEevaluated 106 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-106
1310 d->handleMouseMoveEvent(event);-
1311 event->accept();-
1312 }
executed 106 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
106
1313 QQuickItem::mouseMoveEvent(event);-
1314 }
never executed: end of block
0
1315}-
1316-
1317void QQuickPathViewPrivate::handleMouseMoveEvent(QMouseEvent *event)-
1318{-
1319 QQuickPathView * const q = q_func();-
1320 if (!interactive
!interactiveDescription
TRUEnever evaluated
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !timer.isValid()
!timer.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 130 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !model
!modelDescription
TRUEnever evaluated
FALSEevaluated 130 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !modelCount
!modelCountDescription
TRUEnever evaluated
FALSEevaluated 130 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-132
1321 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1322-
1323 qint64 currentTimestamp = computeCurrentTime(event);-
1324 qreal newPc;-
1325 QPointF pathPoint = pointNear(event->localPos(), &newPc);-
1326 if (!stealMouse
!stealMouseDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
42-88
1327 QPointF posDelta = event->localPos() - startPos;-
1328 if (QQuickWindowPrivate::dragOverThreshold(posDelta.y(), Qt::YAxis, event)
QQuickWindowPr...:YAxis, event)Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| QQuickWindowPrivate::dragOverThreshold(posDelta.x(), Qt::XAxis, event)
QQuickWindowPr...:XAxis, event)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-42
1329-
1330-
1331-
1332 QPointF pathDelta = pathPoint - startPoint;-
1333 const int startDragDistance = QGuiApplication::styleHints()->startDragDistance();-
1334 if (qAbs(pathDelta.x()) > startDragDistance * 0.8
qAbs(pathDelta...Distance * 0.8Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
0-26
1335 || qAbs(pathDelta.y()) > startDragDistance * 0.8
qAbs(pathDelta...Distance * 0.8Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1336 stealMouse = true;-
1337 q->setKeepMouseGrab(true);-
1338 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
26
1339 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
26
1340 }
executed 42 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
42
1341 moveReason = QQuickPathViewPrivate::Mouse;-
1342 int count = pathItems == -1
pathItems == -1Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickpathview
? modelCount : qMin(pathItems, modelCount);
38-50
1343 qreal diff = (newPc - startPc)*count;-
1344 if (diff
diffDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
16-72
1345 q->setOffset(offset + diff);-
1346-
1347 if (diff > modelCount/2
diff > modelCount/2Description
TRUEnever evaluated
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-72
1348 diff -= modelCount;
never executed: diff -= modelCount;
0
1349 else if (diff < -modelCount/2
diff < -modelCount/2Description
TRUEnever evaluated
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-72
1350 diff += modelCount;
never executed: diff += modelCount;
0
1351-
1352 qint64 elapsed = currentTimestamp - lastPosTime;-
1353 if (elapsed > 0
elapsed > 0Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
4-68
1354 addVelocitySample(diff / (qreal(elapsed) / 1000.));
executed 68 times by 1 test: addVelocitySample(diff / (qreal(elapsed) / 1000.));
Executed by:
  • tst_qquickpathview
68
1355 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
72
1356 if (!moving
!movingDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
22-66
1357 moving = true;-
1358 q->movingChanged();-
1359 q->movementStarted();-
1360 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
22
1361 setDragging(true);-
1362 }
executed 88 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
88
1363 startPc = newPc;-
1364 lastPosTime = currentTimestamp;-
1365}
executed 130 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
130
1366-
1367void QQuickPathView::mouseReleaseEvent(QMouseEvent *event)-
1368{-
1369 QQuickPathViewPrivate * const d = d_func();-
1370 if (d->interactive
d->interactiveDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-20
1371 d->handleMouseReleaseEvent(event);-
1372 event->accept();-
1373 ungrabMouse();-
1374 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
20
1375 QQuickItem::mouseReleaseEvent(event);-
1376 }
never executed: end of block
0
1377}-
1378-
1379void QQuickPathViewPrivate::handleMouseReleaseEvent(QMouseEvent *)-
1380{-
1381 QQuickPathView * const q = q_func();-
1382 stealMouse = false;-
1383 q->setKeepMouseGrab(false);-
1384 setDragging(false);-
1385 if (!interactive
!interactiveDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !timer.isValid()
!timer.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !model
!modelDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !modelCount
!modelCountDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-22
1386 timer.invalidate();-
1387 if (!tl.isActive()
!tl.isActive()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-2
1388 q->movementEnding();
executed 2 times by 1 test: q->movementEnding();
Executed by:
  • tst_qquickpathview
2
1389 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1390 }-
1391-
1392 qreal velocity = calcVelocity();-
1393 qreal count = pathItems == -1
pathItems == -1Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
? modelCount : qMin(pathItems, modelCount);
10
1394 const auto averageItemLength = path->path().length() / count;-
1395 qreal pixelVelocity = averageItemLength * velocity;-
1396 if (qAbs(pixelVelocity) > MinimumFlickVelocity
qAbs(pixelVelo...mFlickVelocityDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-18
1397 if (qAbs(pixelVelocity) > maximumFlickVelocity
qAbs(pixelVelo...mFlickVelocityDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| snapMode == QQuickPathView::SnapOneItem
snapMode == QQ...w::SnapOneItemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-10
1398-
1399 qreal maxVel = velocity < 0
velocity < 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
? -maximumFlickVelocity : maximumFlickVelocity;
2-10
1400 velocity = maxVel / averageItemLength;-
1401 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
12
1402-
1403 qreal v2 = velocity*velocity;-
1404 qreal accel = deceleration/10;-
1405 qreal dist = 0;-
1406 if (haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& (highlightRangeMode == QQuickPathView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
0-18
1407 || snapMode != QQuickPathView::NoSnap
snapMode != QQ...thView::NoSnapDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)) {
0-4
1408 if (snapMode == QQuickPathView::SnapOneItem
snapMode == QQ...w::SnapOneItemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-14
1409-
1410 if (velocity > 0.
velocity > 0.Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-4
1411 dist = qRound(0.5 + offset) - offset;
never executed: dist = qRound(0.5 + offset) - offset;
0
1412 else-
1413 dist = qRound(0.5 - offset) + offset;
executed 4 times by 1 test: dist = qRound(0.5 - offset) + offset;
Executed by:
  • tst_qquickpathview
4
1414 } else {-
1415-
1416 dist = qMin(qreal(modelCount-1), qreal(v2 / (accel * 2.0) + 0.25));-
1417-
1418-
1419 if (velocity > 0.
velocity > 0.Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
4-10
1420 dist = qRound(dist + offset) - offset;
executed 4 times by 1 test: dist = qRound(dist + offset) - offset;
Executed by:
  • tst_qquickpathview
4
1421 else-
1422 dist = qRound(dist - offset) + offset;
executed 10 times by 1 test: dist = qRound(dist - offset) + offset;
Executed by:
  • tst_qquickpathview
10
1423 }-
1424-
1425 if (dist <= 0.
dist <= 0.Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-16
1426 dist = 0.;-
1427 accel = 0.;-
1428 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
2
1429 accel = v2 / (2.0f * qAbs(dist));-
1430 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
16
1431 } else {-
1432 dist = qMin(qreal(modelCount-1), qreal(v2 / (accel * 2.0)));-
1433 }
never executed: end of block
0
1434 flickDuration = static_cast<int>(1000 * qAbs(velocity) / accel);-
1435 offsetAdj = 0.0;-
1436 moveOffset.setValue(offset);-
1437 tl.accel(moveOffset, velocity, accel, dist);-
1438 tl.callback(QQuickTimeLineCallback(&moveOffset, fixOffsetCallback, this));-
1439 if (!flicking
!flickingDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-18
1440 flicking = true;-
1441 q->flickingChanged();-
1442 q->flickStarted();-
1443 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
18
1444 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
18
1445 fixOffset();-
1446 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
1447-
1448 timer.invalidate();-
1449 if (!tl.isActive()
!tl.isActive()Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-20
1450 q->movementEnding();
never executed: q->movementEnding();
0
1451}
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
20
1452-
1453bool QQuickPathView::sendMouseEvent(QMouseEvent *event)-
1454{-
1455 QQuickPathViewPrivate * const d = d_func();-
1456 QPointF localPos = mapFromScene(event->windowPos());-
1457-
1458 QQuickWindow *c = window();-
1459 QQuickItem *grabber = c
cDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
? c->mouseGrabberItem() : nullptr;
0-48
1460 if (grabber == this
grabber == thisDescription
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->stealMouse
d->stealMouseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-48
1461-
1462 return
never executed: return true;
true;
never executed: return true;
0
1463 }-
1464-
1465 bool grabberDisabled = grabber
grabberDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& !grabber->isEnabled()
!grabber->isEnabled()Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
;
0-42
1466 bool stealThisEvent = d->stealMouse;-
1467 if ((stealThisEvent
stealThisEventDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| contains(localPos)
contains(localPos)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) && (!grabber
!grabberDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !grabber->keepMouseGrab()
!grabber->keepMouseGrab()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| grabberDisabled
grabberDisabledDescription
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
)) {
0-42
1468 QScopedPointer<QMouseEvent> mouseEvent(QQuickWindowPrivate::cloneMouseEvent(event, &localPos));-
1469 mouseEvent->setAccepted(false);-
1470-
1471 switch (mouseEvent->type()) {-
1472 case
executed 26 times by 1 test: case QEvent::MouseMove:
Executed by:
  • tst_qquickpathview
QEvent::MouseMove:
executed 26 times by 1 test: case QEvent::MouseMove:
Executed by:
  • tst_qquickpathview
26
1473 d->handleMouseMoveEvent(mouseEvent.data());-
1474 break;
executed 26 times by 1 test: break;
Executed by:
  • tst_qquickpathview
26
1475 case
executed 6 times by 1 test: case QEvent::MouseButtonPress:
Executed by:
  • tst_qquickpathview
QEvent::MouseButtonPress:
executed 6 times by 1 test: case QEvent::MouseButtonPress:
Executed by:
  • tst_qquickpathview
6
1476 d->handleMousePressEvent(mouseEvent.data());-
1477 stealThisEvent = d->stealMouse;-
1478 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qquickpathview
6
1479 case
executed 2 times by 1 test: case QEvent::MouseButtonRelease:
Executed by:
  • tst_qquickpathview
QEvent::MouseButtonRelease:
executed 2 times by 1 test: case QEvent::MouseButtonRelease:
Executed by:
  • tst_qquickpathview
2
1480 d->handleMouseReleaseEvent(mouseEvent.data());-
1481 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquickpathview
2
1482 default
never executed: default:
:
never executed: default:
0
1483 break;
never executed: break;
0
1484 }-
1485 grabber = c
cDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
? c->mouseGrabberItem() : nullptr;
0-34
1486 if ((grabber
grabberDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& stealThisEvent
stealThisEventDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& !grabber->keepMouseGrab()
!grabber->keepMouseGrab()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& grabber != this
grabber != thisDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) || grabberDisabled
grabberDisabledDescription
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-32
1487 grabMouse();-
1488 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
1489-
1490 const bool filtered = stealThisEvent
stealThisEventDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| grabberDisabled
grabberDisabledDescription
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickpathview
;
0-32
1491 if (filtered
filteredDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-32
1492 event->setAccepted(false);-
1493 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
1494 return
executed 34 times by 1 test: return filtered;
Executed by:
  • tst_qquickpathview
filtered;
executed 34 times by 1 test: return filtered;
Executed by:
  • tst_qquickpathview
34
1495 } else if (d->timer.isValid()
d->timer.isValid()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-10
1496 d->timer.invalidate();-
1497 d->fixOffset();-
1498 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
1499 if (event->type() == QEvent::MouseButtonRelease
event->type() ...eButtonReleaseDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| (grabber
grabberDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& grabber->keepMouseGrab()
grabber->keepMouseGrab()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& !grabberDisabled
!grabberDisabledDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)) {
0-10
1500 d->stealMouse = false;-
1501 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
14
1502 return
executed 14 times by 1 test: return false;
Executed by:
  • tst_qquickpathview
false;
executed 14 times by 1 test: return false;
Executed by:
  • tst_qquickpathview
14
1503}-
1504-
1505bool QQuickPathView::childMouseEventFilter(QQuickItem *i, QEvent *e)-
1506{-
1507 QQuickPathViewPrivate * const d = d_func();-
1508 if (!isVisible()
!isVisible()Description
TRUEnever evaluated
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| !d->interactive
!d->interactiveDescription
TRUEnever evaluated
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-58
1509 return
never executed: return QQuickItem::childMouseEventFilter(i, e);
QQuickItem::childMouseEventFilter(i, e);
never executed: return QQuickItem::childMouseEventFilter(i, e);
0
1510-
1511 switch (e->type()) {-
1512 case
executed 6 times by 1 test: case QEvent::MouseButtonPress:
Executed by:
  • tst_qquickpathview
QEvent::MouseButtonPress:
executed 6 times by 1 test: case QEvent::MouseButtonPress:
Executed by:
  • tst_qquickpathview
6
1513 case
executed 36 times by 1 test: case QEvent::MouseMove:
Executed by:
  • tst_qquickpathview
QEvent::MouseMove:
executed 36 times by 1 test: case QEvent::MouseMove:
Executed by:
  • tst_qquickpathview
36
1514 case
executed 6 times by 1 test: case QEvent::MouseButtonRelease:
Executed by:
  • tst_qquickpathview
QEvent::MouseButtonRelease:
executed 6 times by 1 test: case QEvent::MouseButtonRelease:
Executed by:
  • tst_qquickpathview
6
1515 return
executed 48 times by 1 test: return sendMouseEvent(static_cast<QMouseEvent *>(e));
Executed by:
  • tst_qquickpathview
sendMouseEvent(static_cast<QMouseEvent *>(e));
executed 48 times by 1 test: return sendMouseEvent(static_cast<QMouseEvent *>(e));
Executed by:
  • tst_qquickpathview
48
1516 default
executed 10 times by 1 test: default:
Executed by:
  • tst_qquickpathview
:
executed 10 times by 1 test: default:
Executed by:
  • tst_qquickpathview
10
1517 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qquickpathview
10
1518 }-
1519-
1520 return
executed 10 times by 1 test: return QQuickItem::childMouseEventFilter(i, e);
Executed by:
  • tst_qquickpathview
QQuickItem::childMouseEventFilter(i, e);
executed 10 times by 1 test: return QQuickItem::childMouseEventFilter(i, e);
Executed by:
  • tst_qquickpathview
10
1521}-
1522-
1523void QQuickPathView::mouseUngrabEvent()-
1524{-
1525 QQuickPathViewPrivate * const d = d_func();-
1526 if (d->stealMouse
d->stealMouseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-20
1527-
1528-
1529 d->stealMouse = false;-
1530 setKeepMouseGrab(false);-
1531 d->timer.invalidate();-
1532 d->fixOffset();-
1533 d->setDragging(false);-
1534 if (!d->tl.isActive()
!d->tl.isActive()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-2
1535 movementEnding();
never executed: movementEnding();
0
1536 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
2
1537}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
22
1538-
1539void QQuickPathView::updatePolish()-
1540{-
1541 QQuickItem::updatePolish();-
1542 refill();-
1543}
executed 37 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
37
1544-
1545static inline int currentIndexRemainder(int currentIndex, int modelCount) noexcept-
1546{-
1547 if (currentIndex < 0
currentIndex < 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-6
1548 return
never executed: return modelCount + currentIndex % modelCount;
modelCount + currentIndex % modelCount;
never executed: return modelCount + currentIndex % modelCount;
0
1549 else-
1550 return
executed 6 times by 1 test: return currentIndex % modelCount;
Executed by:
  • tst_qquickpathview
currentIndex % modelCount;
executed 6 times by 1 test: return currentIndex % modelCount;
Executed by:
  • tst_qquickpathview
6
1551}-
1552-
1553void QQuickPathView::componentComplete()-
1554{-
1555 QQuickPathViewPrivate * const d = d_func();-
1556 if (d->model && d->ownModel
d->ownModelDescription
TRUEevaluated 258 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
20-258
1557 static_cast<
executed 258 times by 3 tests: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
QQmlDelegateModel *>(d->model.data())->componentComplete();
executed 258 times by 3 tests: static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
258
1558-
1559 QQuickItem::componentComplete();-
1560-
1561 if (d->model
d->modelDescription
TRUEevaluated 278 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-278
1562 d->modelCount = d->model->count();-
1563 if (d->modelCount
d->modelCountDescription
TRUEevaluated 268 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& d->currentIndex != 0
d->currentIndex != 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 262 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
6-268
1564 d->offset = std::fmod(qreal(d->modelCount - currentIndexRemainder(d->currentIndex, d->modelCount)), qreal(d->modelCount));
executed 6 times by 1 test: d->offset = std::fmod(qreal(d->modelCount - currentIndexRemainder(d->currentIndex, d->modelCount)), qreal(d->modelCount));
Executed by:
  • tst_qquickpathview
6
1565 }
executed 278 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
278
1566-
1567 d->createHighlight();-
1568 d->regenerate();-
1569 d->updateHighlight();-
1570 d->updateCurrent();-
1571-
1572 if (d->modelCount
d->modelCountDescription
TRUEevaluated 268 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
14-268
1573 countChanged();
executed 268 times by 3 tests: countChanged();
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
268
1574}
executed 282 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
282
1575-
1576void QQuickPathView::refill()-
1577{-
1578 QQuickPathViewPrivate * const d = d_func();-
1579-
1580 if (d->inRefill
d->inRefillDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4448 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
2-4448
1581 d->scheduleLayout();-
1582 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1583 }-
1584-
1585 d->layoutScheduled = false;-
1586-
1587 if (!d->isValid()
!d->isValid()Description
TRUEevaluated 500 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3948 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !isComponentComplete()
!isComponentComplete()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 3936 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
12-3948
1588 return;
executed 512 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
512
1589-
1590 d->inRefill = true;-
1591-
1592 bool currentVisible = false;-
1593 int count = d->pathItems == -1
d->pathItems == -1Description
TRUEevaluated 2381 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 1555 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
? d->modelCount : qMin(d->pathItems, d->modelCount);
1555-2381
1594-
1595-
1596 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 3936 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
; qt_category_enabled = false) QMessageLogger(__FILE__, 1956, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "currentIndex" << d->currentIndex << "offset" << d->offset;
never executed: QMessageLogger(__FILE__, 1956, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "currentIndex" << d->currentIndex << "offset" << d->offset;
0-3936
1597 QList<QQuickItem*>::iterator it = d->items.begin();-
1598 while (it != d->items.end()
it != d->items.end()Description
TRUEevaluated 37500 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 3936 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
3936-37500
1599 QQuickItem *item = *it;-
1600 int idx = d->model->indexOf(item, nullptr);-
1601 qreal pos = d->positionOfIndex(idx);-
1602 if (lcItemViewDelegateLifecycle().isDebugEnabled()
lcItemViewDele...DebugEnabled()Description
TRUEnever evaluated
FALSEevaluated 37500 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-37500
1603 QQuickText *text = qmlobject_cast<QQuickText*>(item);-
1604 if (text
textDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1605 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 1965, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "idx" << idx << "@" << pos << ": QQuickText" << text->objectName() << text->text().leftRef(40);
never executed: QMessageLogger(__FILE__, 1965, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "idx" << idx << "@" << pos << ": QQuickText" << text->objectName() << text->text().leftRef(40);
0
1606 else-
1607 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 1967, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "idx" << idx << "@" << pos << ":" << item;
never executed: QMessageLogger(__FILE__, 1967, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "idx" << idx << "@" << pos << ":" << item;
0
1608 }
never executed: end of block
0
1609 if (pos < 1.0
pos < 1.0Description
TRUEevaluated 36906 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 594 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
594-36906
1610 d->updateItem(item, pos);-
1611 if (idx == d->currentIndex
idx == d->currentIndexDescription
TRUEevaluated 3361 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 33545 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
3361-33545
1612 currentVisible = true;-
1613 d->currentItemOffset = pos;-
1614 }
executed 3361 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3361
1615 ++it;-
1616 }
executed 36906 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
36906
1617 d->updateItem(item, pos);-
1618 if (QQuickPathViewAttached *att = d->attached(item)
QQuickPathView...attached(item)Description
TRUEevaluated 594 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-594
1619 att->setOnPath(pos < 1.0);
executed 594 times by 1 test: att->setOnPath(pos < 1.0);
Executed by:
  • tst_qquickpathview
594
1620 if (!d->isInBound(pos, d->mappedRange - d->mappedCache, 1.0 + d->mappedCache)
!d->isInBound(...->mappedCache)Description
TRUEevaluated 554 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
40-554
1621 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 554 times by 1 test
Evaluated by:
  • tst_qquickpathview
; qt_category_enabled = false) QMessageLogger(__FILE__, 1981, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "release" << idx << "@" << pos << ", !isInBound: lower" << (d->mappedRange - d->mappedCache) << "upper" << (1.0 + d->mappedCache);
never executed: QMessageLogger(__FILE__, 1981, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "release" << idx << "@" << pos << ", !isInBound: lower" << (d->mappedRange - d->mappedCache) << "upper" << (1.0 + d->mappedCache);
0-554
1622 d->releaseItem(item);-
1623 it = d->items.erase(it);-
1624 }
executed 554 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
554
1625 ++it;-
1626 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
40
1627 }-
1628 }-
1629-
1630 bool waiting = false;-
1631 if (d->modelCount
d->modelCountDescription
TRUEevaluated 3918 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
18-3918
1632-
1633 if (d->items.count() < count+d->cacheSize
d->items.count...t+d->cacheSizeDescription
TRUEevaluated 805 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3113 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
805-3113
1634 int endIdx = 0;-
1635 qreal endPos;-
1636 int startIdx = 0;-
1637 qreal startPos = 0.0;-
1638 const bool wasEmpty = d->items.isEmpty();-
1639 if (!wasEmpty
!wasEmptyDescription
TRUEevaluated 350 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 455 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
350-455
1640-
1641 endPos = -1.0;-
1642 startPos = 2.0;-
1643-
1644 for (QQuickItem * item : qAsConst(d->items)) {-
1645 int idx = d->model->indexOf(item, nullptr);-
1646 qreal curPos = d->positionOfIndex(idx);-
1647 if (curPos > endPos
curPos > endPosDescription
TRUEevaluated 4838 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
44-4838
1648 endPos = curPos;-
1649 endIdx = idx;-
1650 }
executed 4838 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4838
1651-
1652 if (curPos < startPos
curPos < startPosDescription
TRUEevaluated 356 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4526 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
356-4526
1653 startPos = curPos;-
1654 startIdx = idx;-
1655 }
executed 356 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
356
1656 }
executed 4882 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4882
1657 }
executed 350 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
350
1658 if (d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 455 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
0-455
1659 && (d->highlightRangeMode != QQuickPathView::NoHighlightRange
d->highlightRa...HighlightRangeDescription
TRUEevaluated 341 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 114 times by 1 test
Evaluated by:
  • tst_qquickpathview
114-341
1660 || d->snapMode != QQuickPathView::NoSnap
d->snapMode !=...thView::NoSnapDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 106 times by 1 test
Evaluated by:
  • tst_qquickpathview
))
8-106
1661 startPos = d->highlightRangeStart;
executed 349 times by 3 tests: startPos = d->highlightRangeStart;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
349
1662-
1663 endIdx = (qRound(d->modelCount - d->offset) - 1) % d->modelCount;-
1664 endPos = d->positionOfIndex(endIdx);-
1665 }
executed 455 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
455
1666-
1667 int idx = endIdx + 1;-
1668 if (idx >= d->modelCount
idx >= d->modelCountDescription
TRUEevaluated 300 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 505 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
300-505
1669 idx = 0;
executed 300 times by 3 tests: idx = 0;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
300
1670 qreal nextPos = d->positionOfIndex(idx);-
1671 while ((d->isInBound(nextPos, endPos, 1.0 + d->mappedCache)
d->isInBound(n...->mappedCache)Description
TRUEevaluated 2615 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 1023 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !d->items.count()
!d->items.count()Description
TRUEevaluated 250 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 773 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
250-2615
1672 && d->items.count() < count+d->cacheSize
d->items.count...t+d->cacheSizeDescription
TRUEevaluated 2857 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
8-2857
1673 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 2857 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
; qt_category_enabled = false) QMessageLogger(__FILE__, 2033, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "append" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
never executed: QMessageLogger(__FILE__, 2033, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "append" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
0-2857
1674 QQuickItem *item = d->getItem(idx, idx+1, nextPos >= 1.0);-
1675 if (!item
!itemDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2839 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
18-2839
1676 waiting = true;-
1677 break;
executed 18 times by 1 test: break;
Executed by:
  • tst_qquickpathview
18
1678 }-
1679 if (d->items.contains(item)
d->items.contains(item)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2833 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
6-2833
1680 d->releaseItem(item);-
1681 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qquickpathview
6
1682 }-
1683 if (d->currentIndex == idx
d->currentIndex == idxDescription
TRUEevaluated 441 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2392 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
441-2392
1684 currentVisible = true;-
1685 d->currentItemOffset = nextPos;-
1686 }
executed 441 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
441
1687 d->items.append(item);-
1688 d->updateItem(item, nextPos);-
1689 endIdx = idx;-
1690 endPos = nextPos;-
1691 ++idx;-
1692 if (idx >= d->modelCount
idx >= d->modelCountDescription
TRUEevaluated 395 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2438 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
395-2438
1693 idx = 0;
executed 395 times by 3 tests: idx = 0;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
395
1694 nextPos = d->positionOfIndex(idx);-
1695 }
executed 2833 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
2833
1696-
1697-
1698 idx = (wasEmpty
wasEmptyDescription
TRUEevaluated 455 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 350 times by 1 test
Evaluated by:
  • tst_qquickpathview
? d->calcCurrentIndex() : startIdx) - 1;
350-455
1699-
1700 if (idx < 0
idx < 0Description
TRUEevaluated 323 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 482 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
323-482
1701 idx = d->modelCount - 1;
executed 323 times by 3 tests: idx = d->modelCount - 1;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
323
1702 nextPos = d->positionOfIndex(idx);-
1703 while (!waiting
!waitingDescription
TRUEevaluated 1318 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->isInBound(nextPos, d->mappedRange - d->mappedCache, startPos)
d->isInBound(n...che, startPos)Description
TRUEevaluated 545 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 773 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
18-1318
1704 && d->items.count() < count+d->cacheSize
d->items.count...t+d->cacheSizeDescription
TRUEevaluated 545 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-545
1705 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 545 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
; qt_category_enabled = false) QMessageLogger(__FILE__, 2065, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "prepend" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
never executed: QMessageLogger(__FILE__, 2065, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "prepend" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
0-545
1706 QQuickItem *item = d->getItem(idx, idx+1, nextPos >= 1.0);-
1707 if (!item
!itemDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 537 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
8-537
1708 waiting = true;-
1709 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickpathview
8
1710 }-
1711 if (d->items.contains(item)
d->items.contains(item)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 531 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
6-531
1712 d->releaseItem(item);-
1713 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qquickpathview
6
1714 }-
1715 if (d->currentIndex == idx
d->currentIndex == idxDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 509 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
22-509
1716 currentVisible = true;-
1717 d->currentItemOffset = nextPos;-
1718 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
22
1719 d->items.prepend(item);-
1720 d->updateItem(item, nextPos);-
1721 startIdx = idx;-
1722 startPos = nextPos;-
1723 --idx;-
1724 if (idx < 0
idx < 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 526 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
5-526
1725 idx = d->modelCount - 1;
executed 5 times by 1 test: idx = d->modelCount - 1;
Executed by:
  • tst_qquickpathview
5
1726 nextPos = d->positionOfIndex(idx);-
1727 }
executed 531 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
531
1728-
1729-
1730-
1731-
1732-
1733 if (!waiting
!waitingDescription
TRUEevaluated 779 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->items.count() < count+d->cacheSize
d->items.count...t+d->cacheSizeDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 773 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
6-779
1734 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
; qt_category_enabled = false) QMessageLogger(__FILE__, 2094, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "Checking for pathview middle inserts, items count was" << d->items.count();
never executed: QMessageLogger(__FILE__, 2094, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "Checking for pathview middle inserts, items count was" << d->items.count();
0-6
1735 idx = startIdx;-
1736 QQuickItem *lastItem = d->items.at(0);-
1737 while (idx != endIdx
idx != endIdxDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-52
1738 nextPos = d->positionOfIndex(idx);-
1739 if (d->isInBound(nextPos, d->mappedRange - d->mappedCache, 1.0 + d->mappedCache)
d->isInBound(n...->mappedCache)Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-52
1740-
1741 QQuickItem *item = d->getItem(idx, idx+1, nextPos >= 1.0);-
1742 if (!item
!itemDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-48
1743 waiting = true;-
1744 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickpathview
4
1745 }-
1746-
1747 if (!d->items.contains(item)
!d->items.contains(item)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-44
1748 for (bool qt_category_enabled = lcItemViewDelegateLifecycle().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
; qt_category_enabled = false) QMessageLogger(__FILE__, 2108, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "middle insert" << idx << "@" << nextPos
never executed: QMessageLogger(__FILE__, 2108, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "middle insert" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
0-4
1749 << (d->currentIndex == idx ? "current" : "")
never executed: QMessageLogger(__FILE__, 2108, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "middle insert" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
0
1750 << "items count was" << d->items.count();
never executed: QMessageLogger(__FILE__, 2108, __PRETTY_FUNCTION__, lcItemViewDelegateLifecycle().categoryName()).debug() << "middle insert" << idx << "@" << nextPos << (d->currentIndex == idx ? "current" : "") << "items count was" << d->items.count();
0
1751 if (d->currentIndex == idx
d->currentIndex == idxDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-4
1752 currentVisible = true;-
1753 d->currentItemOffset = nextPos;-
1754 }
never executed: end of block
0
1755 int lastListIdx = d->items.indexOf(lastItem);-
1756 d->items.insert(lastListIdx + 1, item);-
1757 d->updateItem(item, nextPos);-
1758 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
4
1759 d->releaseItem(item);-
1760 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
44
1761-
1762 lastItem = item;-
1763 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
48
1764-
1765 ++idx;-
1766 if (idx >= d->modelCount
idx >= d->modelCountDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
6-42
1767 idx = 0;
executed 6 times by 1 test: idx = 0;
Executed by:
  • tst_qquickpathview
6
1768 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
48
1769 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
6
1770 }
executed 805 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
805
1771 }
executed 3918 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3918
1772-
1773 bool currentChanged = false;-
1774 if (!currentVisible
!currentVisibleDescription
TRUEevaluated 112 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 3824 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
) {
112-3824
1775 d->currentItemOffset = 1.0;-
1776 if (d->currentItem
d->currentItemDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
20-92
1777 d->updateItem(d->currentItem, 1.0);-
1778 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (!waiting
!waitingDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->currentIndex >= 0
d->currentIndex >= 0Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
&& d->currentIndex < d->modelCount
d->currentInde... d->modelCountDescription
TRUEnever evaluated
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
0-92
1779 if ((
(d->currentIte...currentIndex))Description
TRUEnever evaluated
FALSEnever evaluated
d->currentItem = d->getItem(d->currentIndex, d->currentIndex))
(d->currentIte...currentIndex))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1780 currentChanged = true;-
1781 d->updateItem(d->currentItem, 1.0);-
1782 if (QQuickPathViewAttached *att = d->attached(d->currentItem)
QQuickPathView...->currentItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1783 att->setIsCurrentItem(true);
never executed: att->setIsCurrentItem(true);
0
1784 }
never executed: end of block
0
1785 }
never executed: end of block
0
1786 }
executed 112 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else if (!waiting
!waitingDescription
TRUEevaluated 3798 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& !d->currentItem
!d->currentItemDescription
TRUEevaluated 420 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3378 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
26-3798
1787 if ((
(d->currentIte...currentIndex))Description
TRUEevaluated 420 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
d->currentItem = d->getItem(d->currentIndex, d->currentIndex))
(d->currentIte...currentIndex))Description
TRUEevaluated 420 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-420
1788 currentChanged = true;-
1789 d->currentItem->setFocus(true);-
1790 if (QQuickPathViewAttached *att = d->attached(d->currentItem)
QQuickPathView...->currentItem)Description
TRUEevaluated 420 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-420
1791 att->setIsCurrentItem(true);
executed 420 times by 3 tests: att->setIsCurrentItem(true);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
420
1792 }
executed 420 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
420
1793 }
executed 420 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
420
1794-
1795 if (d->highlightItem
d->highlightItemDescription
TRUEevaluated 3918 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 3914 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->highlightRangeMode == QQuickPathView::StrictlyEnforceRange
d->highlightRa...lyEnforceRangeDescription
TRUEevaluated 3476 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 438 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-3918
1796 d->updateItem(d->highlightItem, d->highlightRangeStart);-
1797 if (QQuickPathViewAttached *att = d->attached(d->highlightItem)
QQuickPathView...highlightItem)Description
TRUEnever evaluated
FALSEevaluated 3476 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-3476
1798 att->setOnPath(true);
never executed: att->setOnPath(true);
0
1799 }
executed 3476 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else if (d->highlightItem
d->highlightItemDescription
TRUEevaluated 442 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& d->moveReason != QQuickPathViewPrivate::SetIndex
d->moveReason ...vate::SetIndexDescription
TRUEevaluated 438 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-3476
1800 d->updateItem(d->highlightItem, d->currentItemOffset);-
1801 if (QQuickPathViewAttached *att = d->attached(d->highlightItem)
QQuickPathView...highlightItem)Description
TRUEnever evaluated
FALSEevaluated 438 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-438
1802 att->setOnPath(currentVisible);
never executed: att->setOnPath(currentVisible);
0
1803 }
executed 438 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
438
1804 for (QQuickItem *item : qAsConst(d->itemCache))-
1805 d->releaseItem(item);
executed 141 times by 1 test: d->releaseItem(item);
Executed by:
  • tst_qquickpathview
141
1806 d->itemCache.clear();-
1807-
1808 d->inRefill = false;-
1809 if (currentChanged
currentChangedDescription
TRUEevaluated 420 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 3516 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
420-3516
1810 currentItemChanged();
executed 420 times by 3 tests: currentItemChanged();
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
420
1811}
executed 3936 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3936
1812-
1813void QQuickPathView::modelUpdated(const QQmlChangeSet &changeSet, bool reset)-
1814{-
1815 QQuickPathViewPrivate * const d = d_func();-
1816 if (!d->model
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 690 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !d->model->isValid()
!d->model->isValid()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 686 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !d->path
!d->pathDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 682 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !isComponentComplete()
!isComponentComplete()Description
TRUEevaluated 516 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 166 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
0-690
1817 return;
executed 524 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
524
1818-
1819 if (reset
resetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 164 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
2-164
1820 d->modelCount = d->model->count();-
1821 d->regenerate();-
1822 countChanged();-
1823 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickpathview
2
1824 }-
1825-
1826 if (changeSet.removes().isEmpty()
changeSet.removes().isEmpty()Description
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 98 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& changeSet.inserts().isEmpty()
changeSet.inserts().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 66 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
0-98
1827 return;
never executed: return;
0
1828-
1829 const int modelCount = d->modelCount;-
1830 int moveId = -1;-
1831 int moveOffset = 0;-
1832 bool currentChanged = false;-
1833 bool changedOffset = false;-
1834 for (const QQmlChangeSet::Change &r : changeSet.removes()) {-
1835 if (moveId == -1
moveId == -1Description
TRUEevaluated 98 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
&& d->currentIndex >= r.index + r.count
d->currentInde...ndex + r.countDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
0-98
1836 d->currentIndex -= r.count;-
1837 currentChanged = true;-
1838 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (moveId == -1
moveId == -1Description
TRUEevaluated 62 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
&& d->currentIndex >= r.index
d->currentIndex >= r.indexDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& d->currentIndex < r.index + r.count
d->currentInde...ndex + r.countDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
) {
0-62
1839-
1840 if (r.isMove()
r.isMove()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
10-18
1841 moveId = r.moveId;-
1842 moveOffset = d->currentIndex - r.index;-
1843 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (d->currentItem
d->currentItemDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
) {
2-16
1844 if (QQuickPathViewAttached *att = d->attached(d->currentItem)
QQuickPathView...->currentItem)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-16
1845 att->setIsCurrentItem(true);
executed 16 times by 1 test: att->setIsCurrentItem(true);
Executed by:
  • tst_qquickpathview
16
1846 d->releaseItem(d->currentItem);-
1847 d->currentItem = nullptr;-
1848 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
16
1849 d->currentIndex = qMin(r.index, d->modelCount - r.count - 1);-
1850 currentChanged = true;-
1851 }
executed 28 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
28
1852-
1853 if (r.index > d->currentIndex
r.index > d->currentIndexDescription
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
48-50
1854 changedOffset = true;-
1855 d->offset -= r.count;-
1856 d->offsetAdj -= r.count;-
1857 }
executed 50 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
50
1858 d->modelCount -= r.count;-
1859 }
executed 98 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
98
1860 for (const QQmlChangeSet::Change &i : changeSet.inserts()) {-
1861 if (d->modelCount
d->modelCountDescription
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
14-96
1862 if (moveId == -1
moveId == -1Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& i.index <= d->currentIndex
i.index <= d->currentIndexDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
10-86
1863 d->currentIndex += i.count;-
1864 currentChanged = true;-
1865 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
38
1866 if (moveId != -1
moveId != -1Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& moveId == i.moveId
moveId == i.moveIdDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-48
1867 d->currentIndex = i.index + moveOffset;-
1868 currentChanged = true;-
1869 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
10
1870 if (i.index > d->currentIndex
i.index > d->currentIndexDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
10-48
1871 d->offset += i.count;-
1872 d->offsetAdj += i.count;-
1873 changedOffset = true;-
1874 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
48
1875 }
executed 58 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
58
1876 }-
1877 d->modelCount += i.count;-
1878 }
executed 110 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
110
1879-
1880 d->offset = std::fmod(d->offset, qreal(d->modelCount));-
1881 if (d->offset < 0
d->offset < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 162 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
2-162
1882 d->offset += d->modelCount;
executed 2 times by 1 test: d->offset += d->modelCount;
Executed by:
  • tst_qquickpathview
2
1883 if (d->currentIndex == -1
d->currentIndex == -1Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 152 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
12-152
1884 d->currentIndex = d->calcCurrentIndex();
executed 12 times by 2 tests: d->currentIndex = d->calcCurrentIndex();
Executed by:
  • tst_examples
  • tst_qquickpathview
12
1885-
1886 d->itemCache += d->items;-
1887 d->items.clear();-
1888-
1889 if (!d->modelCount
!d->modelCountDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 154 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
) {
10-154
1890 for (QQuickItem * item : qAsConst(d->itemCache))-
1891 d->releaseItem(item);
executed 54 times by 1 test: d->releaseItem(item);
Executed by:
  • tst_qquickpathview
54
1892 d->itemCache.clear();-
1893 d->offset = 0;-
1894 changedOffset = true;-
1895 d->tl.reset(d->moveOffset);-
1896 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
else {
10
1897 if (!d->flicking
!d->flickingDescription
TRUEevaluated 154 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
&& !d->moving
!d->movingDescription
TRUEevaluated 154 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
&& d->haveHighlightRange
d->haveHighlightRangeDescription
TRUEevaluated 154 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEnever evaluated
&& d->highlightRangeMode == QQuickPathView::StrictlyEnforceRange
d->highlightRa...lyEnforceRangeDescription
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-154
1898 d->offset = std::fmod(qreal(d->modelCount - d->currentIndex), qreal(d->modelCount));-
1899 changedOffset = true;-
1900 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
88
1901 d->updateMappedRange();-
1902 d->scheduleLayout();-
1903 }
executed 154 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
154
1904 if (changedOffset
changedOffsetDescription
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
36-128
1905 offsetChanged();
executed 128 times by 2 tests: offsetChanged();
Executed by:
  • tst_examples
  • tst_qquickpathview
128
1906 if (currentChanged
currentChangedDescription
TRUEevaluated 94 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 70 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
)
70-94
1907 currentIndexChanged();
executed 94 times by 2 tests: currentIndexChanged();
Executed by:
  • tst_examples
  • tst_qquickpathview
94
1908 if (d->modelCount != modelCount
d->modelCount != modelCountDescription
TRUEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
44-120
1909 countChanged();
executed 120 times by 2 tests: countChanged();
Executed by:
  • tst_examples
  • tst_qquickpathview
120
1910}
executed 164 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
164
1911-
1912void QQuickPathView::destroyingItem(QObject *item)-
1913{-
1914 (void)item;;-
1915}
never executed: end of block
0
1916-
1917void QQuickPathView::ticked()-
1918{-
1919 QQuickPathViewPrivate * const d = d_func();-
1920 d->updateCurrent();-
1921}
executed 3334 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3334
1922-
1923void QQuickPathView::movementEnding()-
1924{-
1925 QQuickPathViewPrivate * const d = d_func();-
1926 if (d->flicking
d->flickingDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
16-98
1927 d->flicking = false;-
1928 flickingChanged();-
1929 flickEnded();-
1930 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
16
1931 if (d->moving
d->movingDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& !d->stealMouse
!d->stealMouseDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-94
1932 d->moving = false;-
1933 movingChanged();-
1934 movementEnded();-
1935 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
20
1936 d->moveDirection = d->movementDirection;-
1937}
executed 114 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
114
1938-
1939-
1940int QQuickPathViewPrivate::calcCurrentIndex()-
1941{-
1942 int current = 0;-
1943 if (modelCount
modelCountDescription
TRUEevaluated 2435 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
&& model && items.count()
items.count()Description
TRUEevaluated 2421 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
10-2435
1944 offset = std::fmod(offset, qreal(modelCount));-
1945 if (offset < 0
offset < 0Description
TRUEnever evaluated
FALSEevaluated 2421 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-2421
1946 offset += modelCount;
never executed: offset += modelCount;
0
1947 current = qRound(qAbs(std::fmod(modelCount - offset, qreal(modelCount))));-
1948 current = current % modelCount;-
1949 }
executed 2421 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
2421
1950-
1951 return
executed 2445 times by 3 tests: return current;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
current;
executed 2445 times by 3 tests: return current;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
2445
1952}-
1953-
1954void QQuickPathViewPrivate::createCurrentItem()-
1955{-
1956 if (requestedIndex != -1
requestedIndex != -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 549 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
6-549
1957 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qquickpathview
6
1958-
1959 bool inItems = false;-
1960 for (QQuickItem *item : qAsConst(items)) {-
1961 if (model->indexOf(item, nullptr) == currentIndex
model->indexOf...= currentIndexDescription
TRUEevaluated 519 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 3277 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
519-3277
1962 inItems = true;-
1963 break;
executed 519 times by 1 test: break;
Executed by:
  • tst_qquickpathview
519
1964 }-
1965 }
executed 3277 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
3277
1966-
1967 if (inItems
inItemsDescription
TRUEevaluated 519 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
30-519
1968 if ((
(currentItem =...currentIndex))Description
TRUEevaluated 519 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
currentItem = getItem(currentIndex, currentIndex))
(currentItem =...currentIndex))Description
TRUEevaluated 519 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-519
1969 currentItem->setFocus(true);-
1970 if (QQuickPathViewAttached *att = attached(currentItem)
QQuickPathView...d(currentItem)Description
TRUEevaluated 519 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-519
1971 att->setIsCurrentItem(true);
executed 519 times by 1 test: att->setIsCurrentItem(true);
Executed by:
  • tst_qquickpathview
519
1972 }
executed 519 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
519
1973 }
executed 519 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (currentIndex >= 0
currentIndex >= 0Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& currentIndex < modelCount
currentIndex < modelCountDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-519
1974 if ((
(currentItem =...currentIndex))Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
currentItem = getItem(currentIndex, currentIndex))
(currentItem =...currentIndex))Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-30
1975 updateItem(currentItem, 1.0);-
1976 if (QQuickPathViewAttached *att = attached(currentItem)
QQuickPathView...d(currentItem)Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-30
1977 att->setIsCurrentItem(true);
executed 30 times by 1 test: att->setIsCurrentItem(true);
Executed by:
  • tst_qquickpathview
30
1978 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
30
1979 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
30
1980}
executed 549 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
549
1981-
1982void QQuickPathViewPrivate::updateCurrent()-
1983{-
1984 QQuickPathView * const q = q_func();-
1985 if (moveReason == SetIndex
moveReason == SetIndexDescription
TRUEevaluated 1646 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 2298 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
1646-2298
1986 return;
executed 1646 times by 1 test: return;
Executed by:
  • tst_qquickpathview
1646
1987 if (!modelCount
!modelCountDescription
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
FALSEevaluated 2210 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !haveHighlightRange
!haveHighlightRangeDescription
TRUEnever evaluated
FALSEevaluated 2210 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| highlightRangeMode != QQuickPathView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 344 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 1866 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-2210
1988 return;
executed 432 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickpathview
432
1989-
1990 int idx = calcCurrentIndex();-
1991 if (model && (idx != currentIndex
idx != currentIndexDescription
TRUEevaluated 405 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 1461 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
|| !currentItem
!currentItemDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 1455 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)) {
6-1461
1992 if (currentItem
currentItemDescription
TRUEevaluated 405 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
6-405
1993 if (QQuickPathViewAttached *att = attached(currentItem)
QQuickPathView...d(currentItem)Description
TRUEevaluated 405 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)
0-405
1994 att->setIsCurrentItem(false);
executed 405 times by 1 test: att->setIsCurrentItem(false);
Executed by:
  • tst_qquickpathview
405
1995 releaseItem(currentItem);-
1996 }
executed 405 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
405
1997 int oldCurrentIndex = currentIndex;-
1998 currentIndex = idx;-
1999 currentItem = nullptr;-
2000 createCurrentItem();-
2001 if (oldCurrentIndex != currentIndex
oldCurrentInde...= currentIndexDescription
TRUEevaluated 405 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
6-405
2002 q->currentIndexChanged();
executed 405 times by 1 test: q->currentIndexChanged();
Executed by:
  • tst_qquickpathview
405
2003 q->currentItemChanged();-
2004 }
executed 411 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
411
2005}
executed 1866 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1866
2006-
2007void QQuickPathViewPrivate::fixOffsetCallback(void *d)-
2008{-
2009 ((QQuickPathViewPrivate *)d)->fixOffset();-
2010}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
18
2011-
2012void QQuickPathViewPrivate::fixOffset()-
2013{-
2014 QQuickPathView * const q = q_func();-
2015 if (model && items.count()
items.count()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
) {
0-26
2016 if (haveHighlightRange
haveHighlightRangeDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
&& (highlightRangeMode == QQuickPathView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
0-26
2017 || snapMode != QQuickPathView::NoSnap
snapMode != QQ...thView::NoSnapDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEnever evaluated
)) {
0-4
2018 int curr = calcCurrentIndex();-
2019 if (curr != currentIndex
curr != currentIndexDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& highlightRangeMode == QQuickPathView::StrictlyEnforceRange
highlightRange...lyEnforceRangeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-22
2020 q->setCurrentIndex(curr);
never executed: q->setCurrentIndex(curr);
0
2021 else-
2022 snapToIndex(curr, Other);
executed 26 times by 1 test: snapToIndex(curr, Other);
Executed by:
  • tst_qquickpathview
26
2023 }-
2024 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
26
2025}
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
26
2026-
2027void QQuickPathViewPrivate::snapToIndex(int index, MovementReason reason)-
2028{-
2029 if (!model
!modelDescription
TRUEnever evaluated
FALSEevaluated 194 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| modelCount <= 0
modelCount <= 0Description
TRUEnever evaluated
FALSEevaluated 194 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
0-194
2030 return;
never executed: return;
0
2031-
2032 qreal targetOffset = std::fmod(qreal(modelCount - index), qreal(modelCount));-
2033-
2034 if (offset == targetOffset
offset == targetOffsetDescription
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquickpathview
)
96-98
2035 return;
executed 96 times by 1 test: return;
Executed by:
  • tst_qquickpathview
96
2036-
2037 moveReason = reason;-
2038 offsetAdj = 0.0;-
2039 tl.reset(moveOffset);-
2040 moveOffset.setValue(offset);-
2041-
2042 const int duration = highlightMoveDuration;-
2043-
2044 if (!duration
!durationDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
6-92
2045 tl.set(moveOffset, targetOffset);-
2046 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else if (moveDirection == QQuickPathView::Positive
moveDirection ...View::PositiveDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| (moveDirection == QQuickPathView::Shortest
moveDirection ...View::ShortestDescription
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
&& targetOffset - offset > modelCount/2.0
targetOffset -...modelCount/2.0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
)) {
4-84
2047 qreal distance = modelCount - targetOffset + offset;-
2048 if (targetOffset > moveOffset
targetOffset > moveOffsetDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
4-8
2049 tl.move(moveOffset, 0.0, QEasingCurve(QEasingCurve::InQuad), int(duration * offset / distance));-
2050 tl.set(moveOffset, modelCount);-
2051 tl.move(moveOffset, targetOffset, QEasingCurve(offset == 0.0 ? QEasingCurve::InOutQuad : QEasingCurve::OutQuad), int(duration * (modelCount-targetOffset) / distance));-
2052 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
8
2053 tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);-
2054 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
4
2055 } else if (moveDirection == QQuickPathView::Negative
moveDirection ...View::NegativeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
|| targetOffset - offset <= -modelCount/2.0
targetOffset -...modelCount/2.0Description
TRUEnever evaluated
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
0-72
2056 qreal distance = modelCount - offset + targetOffset;-
2057 if (targetOffset < moveOffset
targetOffset < moveOffsetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpathview
) {
2-6
2058 tl.move(moveOffset, modelCount, QEasingCurve(targetOffset == 0 ? QEasingCurve::InOutQuad : QEasingCurve::InQuad), int(duration * (modelCount-offset) / distance));-
2059 tl.set(moveOffset, 0.0);-
2060 tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::OutQuad), int(duration * targetOffset / distance));-
2061 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
else {
2
2062 tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);-
2063 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
6
2064 } else {-
2065 tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);-
2066 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquickpathview
72
2067}-
2068-
2069QQuickPathViewAttached *QQuickPathView::qmlAttachedProperties(QObject *obj)-
2070{-
2071 return
executed 3338 times by 3 tests: return new QQuickPathViewAttached(obj);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
new QQuickPathViewAttached(obj);
executed 3338 times by 3 tests: return new QQuickPathViewAttached(obj);
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
3338
2072}-
2073-
2074-
2075-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0