OpenCoverage

qqmllistmodel.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmllistmodel.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6 template <> struct QMetaTypeId< const QV4::CompiledData::Binding* > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< const QV4::CompiledData::Binding* >("const QV4::CompiledData::Binding*", reinterpret_cast< const QV4::CompiledData::Binding* *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; ;-
7-
8-
9-
10-
11enum { MIN_LISTMODEL_UID = 1024 };-
12-
13static QAtomicInt uidCounter(MIN_LISTMODEL_UID);-
14-
15template <typename T>-
16static bool isMemoryUsed(const char *mem)-
17{-
18 for (size_t i=0 ; i < sizeof(T)
i < sizeof(T)Description
TRUEevaluated 3012 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 344 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i) {
344-3012
19 if (mem[i] != 0
mem[i] != 0Description
TRUEevaluated 248 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2764 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
248-2764
20 return
executed 248 times by 2 tests: return true;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
true;
executed 248 times by 2 tests: return true;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
248
21 }
executed 2764 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
2764
22-
23 return
executed 344 times by 2 tests: return false;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
false;
executed 344 times by 2 tests: return false;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
344
24}-
25-
26static QString roleTypeName(ListLayout::Role::DataType t)-
27{-
28 static const QString roleTypeNames[] = {-
29 ([]() noexcept -> QString { enum { Size = sizeof(u"" "String")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "String" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()), ([]() noexcept -> QString { enum { Size = sizeof(u"" "Number")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Number" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()), ([]() noexcept -> QString { enum { Size = sizeof(u"" "Bool")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Bool" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()),-
30 ([]() noexcept -> QString { enum { Size = sizeof(u"" "List")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "List" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()), ([]() noexcept -> QString { enum { Size = sizeof(u"" "QObject")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "QObject" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()), ([]() noexcept -> QString { enum { Size = sizeof(u"" "VariantMap")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "VariantMap" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()),-
31 ([]() noexcept -> QString { enum { Size = sizeof(u"" "DateTime")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DateTime" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()), ([]() noexcept -> QString { enum { Size = sizeof(u"" "Function")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Function" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())-
32 };-
33-
34 if (t > ListLayout::Role::Invalid
t > ListLayout::Role::InvalidDescription
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
&& t < ListLayout::Role::MaxDataType
t < ListLayout...e::MaxDataTypeDescription
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-36
35 return
executed 36 times by 2 tests: return roleTypeNames[t];
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
roleTypeNames[t];
executed 36 times by 2 tests: return roleTypeNames[t];
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
36
36-
37 return
never executed: return QString();
QString();
never executed: return QString();
0
38}-
39-
40const ListLayout::Role &ListLayout::getRoleOrCreate(const QString &key, Role::DataType type)-
41{-
42 QStringHash<Role *>::Node *node = roleHash.findNode(key);-
43 if (node
nodeDescription
TRUEevaluated 3656 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 910 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
910-3656
44 const Role &r = *node->value;-
45 if (type != r.type
type != r.typeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 3652 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
)
4-3652
46 qmlWarning(nullptr) << ([]() noexcept -> QString { enum { Size = sizeof(u"" "Can't assign to existing role '%1' of different type [%2 -> %3]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Can't assign to existing role '%1' of different type [%2 -> %3]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qqmllistmodel
qstring_literal_temp;
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qqmllistmodel
}()).arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
executed 4 times by 1 test: qmlWarning(nullptr) << ([]() noexcept -> QString { enum { Size = sizeof(u"" "Can't assign to existing role '%1' of different type [%2 -> %3]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) ...ign to existing role '%1' of different type [%2 -> %3]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()).arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
Executed by:
  • tst_qqmllistmodel
4
47 return
executed 3656 times by 11 tests: return r;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
r;
executed 3656 times by 11 tests: return r;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3656
48 }-
49-
50 return
executed 910 times by 13 tests: return createRole(key, type);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
createRole(key, type);
executed 910 times by 13 tests: return createRole(key, type);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
910
51}-
52-
53const ListLayout::Role &ListLayout::getRoleOrCreate(QV4::String *key, Role::DataType type)-
54{-
55 QStringHash<Role *>::Node *node = roleHash.findNode(key);-
56 if (node
nodeDescription
TRUEevaluated 2740 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 1208 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
) {
1208-2740
57 const Role &r = *node->value;-
58 if (type != r.type
type != r.typeDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2728 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
12-2728
59 qmlWarning(nullptr) << ([]() noexcept -> QString { enum { Size = sizeof(u"" "Can't assign to existing role '%1' of different type [%2 -> %3]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Can't assign to existing role '%1' of different type [%2 -> %3]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 12 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
qstring_literal_temp;
executed 12 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
}()).arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
executed 12 times by 2 tests: qmlWarning(nullptr) << ([]() noexcept -> QString { enum { Size = sizeof(u"" "Can't assign to existing role '%1' of different type [%2 -> %3]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) ...ign to existing role '%1' of different type [%2 -> %3]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()).arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
60 return
executed 2740 times by 8 tests: return r;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
r;
executed 2740 times by 8 tests: return r;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
2740
61 }-
62-
63 QString qkey = key->toQString();-
64-
65 return
executed 1208 times by 7 tests: return createRole(qkey, type);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
createRole(qkey, type);
executed 1208 times by 7 tests: return createRole(qkey, type);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
1208
66}-
67-
68const ListLayout::Role &ListLayout::createRole(const QString &key, ListLayout::Role::DataType type)-
69{-
70 const int dataSizes[] = { sizeof(StringOrTranslation), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QPointer<QObject>), sizeof(QVariantMap), sizeof(QDateTime), sizeof(QJSValue) };-
71 const int dataAlignments[] = { sizeof(StringOrTranslation), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QObject *), sizeof(QVariantMap), sizeof(QDateTime), sizeof(QJSValue) };-
72-
73 Role *r = new Role;-
74 r->name = key;-
75 r->type = type;-
76-
77 if (type == Role::List
type == Role::ListDescription
TRUEevaluated 128 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEevaluated 1990 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
128-1990
78 r->subLayout = new ListLayout;-
79 }
executed 128 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
else {
128
80 r->subLayout = nullptr;-
81 }
executed 1990 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
1990
82-
83 int dataSize = dataSizes[type];-
84 int dataAlignment = dataAlignments[type];-
85-
86 int dataOffset = (currentBlockOffset + dataAlignment-1) & ~(dataAlignment-1);-
87 if (dataOffset + dataSize > ListElement::BLOCK_SIZE
dataOffset + d...nt::BLOCK_SIZEDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2112 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
6-2112
88 r->blockIndex = ++currentBlock;-
89 r->blockOffset = 0;-
90 currentBlockOffset = dataSize;-
91 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
6
92 r->blockIndex = currentBlock;-
93 r->blockOffset = dataOffset;-
94 currentBlockOffset = dataOffset + dataSize;-
95 }
executed 2112 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
2112
96-
97 int roleIndex = roles.count();-
98 r->index = roleIndex;-
99-
100 roles.append(r);-
101 roleHash.insert(key, r);-
102-
103 return
executed 2118 times by 15 tests: return *r;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
*r;
executed 2118 times by 15 tests: return *r;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
2118
104}-
105-
106ListLayout::ListLayout(const ListLayout *other) : currentBlock(0), currentBlockOffset(0)-
107{-
108 const int otherRolesCount = other->roles.count();-
109 roles.reserve(otherRolesCount);-
110 for (int i=0 ; i < otherRolesCount
i < otherRolesCountDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 942 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
90-942
111 Role *role = new Role(other->roles[i]);-
112 roles.append(role);-
113 roleHash.insert(role->name, role);-
114 }
executed 90 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
90
115 currentBlockOffset = other->currentBlockOffset;-
116 currentBlock = other->currentBlock;-
117}
executed 942 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
942
118-
119ListLayout::~ListLayout()-
120{-
121 qDeleteAll(roles);-
122}
executed 3516 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3516
123-
124void ListLayout::sync(ListLayout *src, ListLayout *target)-
125{-
126 int roleOffset = target->roles.count();-
127 int newRoleCount = src->roles.count() - roleOffset;-
128-
129 for (int i=0 ; i < newRoleCount
i < newRoleCountDescription
TRUEevaluated 476 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
476-926
130 Role *role = new Role(src->roles[roleOffset + i]);-
131 target->roles.append(role);-
132 target->roleHash.insert(role->name, role);-
133 }
executed 476 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
476
134-
135 target->currentBlockOffset = src->currentBlockOffset;-
136 target->currentBlock = src->currentBlock;-
137}
executed 926 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
926
138-
139ListLayout::Role::Role(const Role *other)-
140{-
141 name = other->name;-
142 type = other->type;-
143 blockIndex = other->blockIndex;-
144 blockOffset = other->blockOffset;-
145 index = other->index;-
146 if (other->subLayout
other->subLayoutDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 528 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
38-528
147 subLayout = new ListLayout(other->subLayout);
executed 38 times by 1 test: subLayout = new ListLayout(other->subLayout);
Executed by:
  • tst_qqmllistmodelworkerscript
38
148 else-
149 subLayout = nullptr;
executed 528 times by 1 test: subLayout = nullptr;
Executed by:
  • tst_qqmllistmodelworkerscript
528
150}-
151-
152ListLayout::Role::~Role()-
153{-
154 delete subLayout;-
155}
executed 2672 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
2672
156-
157const ListLayout::Role *ListLayout::getRoleOrCreate(const QString &key, const QVariant &data)-
158{-
159 Role::DataType type;-
160-
161 switch (data.type()) {-
162 case
executed 302 times by 4 tests: case QVariant::Double:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
QVariant::Double:
executed 302 times by 4 tests: case QVariant::Double:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
type = Role::Number; break;
executed 302 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
302
163 case
executed 144 times by 4 tests: case QVariant::Int:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
QVariant::Int:
executed 144 times by 4 tests: case QVariant::Int:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
type = Role::Number; break;
executed 144 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
144
164 case
executed 66 times by 3 tests: case QVariant::Bool:
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
QVariant::Bool:
executed 66 times by 3 tests: case QVariant::Bool:
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
type = Role::Bool; break;
executed 66 times by 3 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
66
165 case
executed 3944 times by 11 tests: case QVariant::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
QVariant::String:
executed 3944 times by 11 tests: case QVariant::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
type = Role::String; break;
executed 3944 times by 11 tests: break;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3944
166 case
never executed: case QVariant::Map:
QVariant::Map:
never executed: case QVariant::Map:
type = Role::VariantMap; break;
never executed: break;
0
167 case
executed 2 times by 1 test: case QVariant::DateTime:
Executed by:
  • tst_qqmllistmodel
QVariant::DateTime:
executed 2 times by 1 test: case QVariant::DateTime:
Executed by:
  • tst_qqmllistmodel
type = Role::DateTime; break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
2
168 case
executed 42 times by 4 tests: case QVariant::UserType:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
QVariant::UserType:
executed 42 times by 4 tests: case QVariant::UserType:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
{
42
169 if (data.userType() == qMetaTypeId<QJSValue>()
data.userType(...Id<QJSValue>()Description
TRUEnever evaluated
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
&&
0-42
170 data.value<QJSValue>().isCallable()
data.value<QJS...).isCallable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
171 type = Role::Function;-
172 break;
never executed: break;
0
173 } else if (data.userType() == qMetaTypeId<const QV4::CompiledData::Binding*>()
data.userType(...a::Binding*>()Description
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
8-34
174 && data.value<const QV4::CompiledData::Binding*>()->isTranslationBinding()
data.value<con...ationBinding()Description
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
FALSEnever evaluated
) {
0-8
175 type = Role::String;-
176 break;
executed 8 times by 3 tests: break;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
8
177 } else {-
178 type = Role::List;-
179 break;
executed 34 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
34
180 }-
181 }-
182 default
executed 2 times by 1 test: default:
Executed by:
  • tst_qqmllistmodel
:
executed 2 times by 1 test: default:
Executed by:
  • tst_qqmllistmodel
type = Role::Invalid; break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
2
183 }-
184-
185 if (type == Role::Invalid
type == Role::InvalidDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 4500 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
2-4500
186 qmlWarning(nullptr) << "Can't create role for unsupported data type";-
187 return
executed 2 times by 1 test: return nullptr;
Executed by:
  • tst_qqmllistmodel
nullptr;
executed 2 times by 1 test: return nullptr;
Executed by:
  • tst_qqmllistmodel
2
188 }-
189-
190 return
executed 4500 times by 14 tests: return &getRoleOrCreate(key, type);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
&getRoleOrCreate(key, type);
executed 4500 times by 14 tests: return &getRoleOrCreate(key, type);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4500
191}-
192-
193const ListLayout::Role *ListLayout::getExistingRole(const QString &key) const-
194{-
195 Role *r = nullptr;-
196 QStringHash<Role *>::Node *node = roleHash.findNode(key);-
197 if (node
nodeDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-58
198 r = node->value;
executed 58 times by 2 tests: r = node->value;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
199 return
executed 58 times by 2 tests: return r;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
r;
executed 58 times by 2 tests: return r;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
200}-
201-
202const ListLayout::Role *ListLayout::getExistingRole(QV4::String *key) const-
203{-
204 Role *r = nullptr;-
205 QStringHash<Role *>::Node *node = roleHash.findNode(key);-
206 if (node
nodeDescription
TRUEevaluated 862 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
8-862
207 r = node->value;
executed 862 times by 8 tests: r = node->value;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
862
208 return
executed 870 times by 8 tests: return r;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
r;
executed 870 times by 8 tests: return r;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
870
209}-
210-
211StringOrTranslation::StringOrTranslation(const QString &s)-
212{-
213 d.setFlag();-
214 setString(s);-
215}
executed 1170 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1170
216-
217StringOrTranslation::StringOrTranslation(const QV4::CompiledData::Binding *binding)-
218{-
219 d.setFlag();-
220 clear();-
221 d = binding;-
222}
never executed: end of block
0
223-
224StringOrTranslation::~StringOrTranslation()-
225{-
226 clear();-
227}
executed 5122 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5122
228-
229void StringOrTranslation::setString(const QString &s)-
230{-
231 d.setFlag();-
232 clear();-
233 QStringData *stringData = const_cast<QString &>(s).data_ptr();-
234 d = stringData;-
235 if (stringData
stringDataDescription
TRUEevaluated 5126 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-5126
236 stringData->ref.ref();
executed 5126 times by 13 tests: stringData->ref.ref();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5126
237}
executed 5126 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5126
238-
239void StringOrTranslation::setTranslation(const QV4::CompiledData::Binding *binding)-
240{-
241 d.setFlag();-
242 clear();-
243 d = binding;-
244}
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
8
245-
246QString StringOrTranslation::toString(const QQmlListModel *owner) const-
247{-
248 if (d.isNull()
d.isNull()Description
TRUEnever evaluated
FALSEevaluated 10271 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
)
0-10271
249 return
never executed: return QString();
QString();
never executed: return QString();
0
250 if (d.isT1()
d.isT1()Description
TRUEevaluated 10261 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 10 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
) {
10-10261
251 QStringDataPtr holder = { d.asT1() };-
252 holder.ptr->ref.ref();-
253 return
executed 10261 times by 11 tests: return QString(holder);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
QString(holder);
executed 10261 times by 11 tests: return QString(holder);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10261
254 }-
255 if (!owner
!ownerDescription
TRUEnever evaluated
FALSEevaluated 10 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
)
0-10
256 return
never executed: return QString();
QString();
never executed: return QString();
0
257 return
executed 10 times by 3 tests: return d.asT2()->valueAsString(owner->m_compilationUnit->data);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
d.asT2()->valueAsString(owner->m_compilationUnit->data);
executed 10 times by 3 tests: return d.asT2()->valueAsString(owner->m_compilationUnit->data);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
10
258}-
259-
260QString StringOrTranslation::asString() const-
261{-
262 if (d.isNull()
d.isNull()Description
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-6
263 return
never executed: return QString();
QString();
never executed: return QString();
0
264 if (!d.isT1()
!d.isT1()Description
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-6
265 return
never executed: return QString();
QString();
never executed: return QString();
0
266 QStringDataPtr holder = { d.asT1() };-
267 holder.ptr->ref.ref();-
268 return
executed 6 times by 2 tests: return QString(holder);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
QString(holder);
executed 6 times by 2 tests: return QString(holder);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
269}-
270-
271void StringOrTranslation::clear()-
272{-
273 if (QStringData *strData = d.isT1()
d.isT1()Description
TRUEevaluated 10248 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
? d.asT1() : nullptr
QStringData *s...T1() : nullptrDescription
TRUEevaluated 5120 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 5136 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
) {
8-10248
274 if (!strData->ref.deref()
!strData->ref.deref()Description
TRUEevaluated 105 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 5015 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
)
105-5015
275 QStringData::deallocate(strData);
executed 105 times by 7 tests: QStringData::deallocate(strData);
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
105
276 }
executed 5120 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5120
277 d = static_cast<QStringData *>(nullptr);-
278}
executed 10256 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
10256
279-
280QObject *ListModel::getOrCreateModelObject(QQmlListModel *model, int elementIndex)-
281{-
282 ListElement *e = elements[elementIndex];-
283 if (e->m_objectCache == nullptr
e->m_objectCache == nullptrDescription
TRUEevaluated 660 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 298 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquicklistview
) {
298-660
284 void *memory = operator new(sizeof(QObject) + sizeof(QQmlData));-
285 void *ddataMemory = ((char *)memory) + sizeof(QObject);-
286 e->m_objectCache = new (memory) QObject;-
287 QQmlData *ddata = new (ddataMemory) QQmlData;-
288 ddata->ownMemory = false;-
289 QObjectPrivate::get(e->m_objectCache)->declarativeData = ddata;-
290 (void)new ModelNodeMetaObject(e->m_objectCache, model, elementIndex);-
291 }
executed 660 times by 8 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
660
292 return
executed 958 times by 8 tests: return e->m_objectCache;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
e->m_objectCache;
executed 958 times by 8 tests: return e->m_objectCache;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
958
293}-
294-
295bool ListModel::sync(ListModel *src, ListModel *target)-
296{-
297-
298-
299 bool hasChanges = false;-
300-
301-
302 QHash<int, ElementSync> elementHash;-
303 for (int i = 0; i < target->elements.count()
i < target->elements.count()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
64-926
304 ListElement *e = target->elements.at(i);-
305 int uid = e->getUid();-
306 ElementSync sync;-
307 sync.target = e;-
308 sync.targetIndex = i;-
309 elementHash.insert(uid, sync);-
310 }
executed 64 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
64
311 for (int i = 0; i < src->elements.count()
i < src->elements.count()Description
TRUEevaluated 694 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
694-926
312 ListElement *e = src->elements.at(i);-
313 int uid = e->getUid();-
314-
315 QHash<int, ElementSync>::iterator it = elementHash.find(uid);-
316 if (it == elementHash.end()
it == elementHash.end()Description
TRUEevaluated 634 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
60-634
317 ElementSync sync;-
318 sync.src = e;-
319 sync.srcIndex = i;-
320 elementHash.insert(uid, sync);-
321 }
executed 634 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
else {
634
322 ElementSync &sync = it.value();-
323 sync.src = e;-
324 sync.srcIndex = i;-
325 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
60
326 }-
327-
328 QQmlListModel *targetModel = target->m_modelCache;-
329-
330-
331 int rowsRemoved = 0;-
332 for (int i = 0 ; i < target->elements.count()
i < target->elements.count()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
64-926
333 ListElement *element = target->elements.at(i);-
334 ElementSync &s = elementHash.find(element->getUid()).value();-
335 ((s.targetIndex >= 0) ? static_cast<void>(0) : qt_assert("s.targetIndex >= 0", __FILE__, 394));-
336-
337 s.targetIndex -= rowsRemoved;-
338 if (s.src == nullptr
s.src == nullptrDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
4-60
339 ((s.targetIndex == i) ? static_cast<void>(0) : qt_assert("s.targetIndex == i", __FILE__, 398));-
340 hasChanges = true;-
341 if (targetModel
targetModelDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-4
342 targetModel->beginRemoveRows(QModelIndex(), i, i);
executed 4 times by 1 test: targetModel->beginRemoveRows(QModelIndex(), i, i);
Executed by:
  • tst_qqmllistmodelworkerscript
4
343 s.target->destroy(target->m_layout);-
344 target->elements.removeOne(s.target);-
345 delete s.target;-
346 if (targetModel
targetModelDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-4
347 targetModel->endRemoveRows();
executed 4 times by 1 test: targetModel->endRemoveRows();
Executed by:
  • tst_qqmllistmodelworkerscript
4
348 ++rowsRemoved;-
349 --i;-
350 continue;
executed 4 times by 1 test: continue;
Executed by:
  • tst_qqmllistmodelworkerscript
4
351 }-
352 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
60
353-
354-
355 ListLayout::sync(src->m_layout, target->m_layout);-
356-
357-
358 target->elements.clear();-
359 for (int i = 0; i < src->elements.count()
i < src->elements.count()Description
TRUEevaluated 694 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
694-926
360 ListElement *srcElement = src->elements.at(i);-
361 ElementSync &s = elementHash.find(srcElement->getUid()).value();-
362 ((s.srcIndex >= 0) ? static_cast<void>(0) : qt_assert("s.srcIndex >= 0", __FILE__, 421));-
363 ListElement *targetElement = s.target;-
364 if (targetElement == nullptr
targetElement == nullptrDescription
TRUEevaluated 634 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
60-634
365 targetElement = new ListElement(srcElement->getUid());-
366 }
executed 634 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
634
367 s.changedRoles = ListElement::sync(srcElement, src->m_layout, targetElement, target->m_layout);-
368 target->elements.append(targetElement);-
369 }
executed 694 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
694
370-
371 target->updateCacheIndices();-
372-
373-
374 for (int i=0 ; i < target->elements.count()
i < target->elements.count()Description
TRUEevaluated 694 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
694-926
375 ListElement *e = target->elements[i];-
376 if (ModelNodeMetaObject *mo = e->objectCache()
ModelNodeMetaO...>objectCache()Description
TRUEnever evaluated
FALSEevaluated 694 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
0-694
377 mo->updateValues();
never executed: mo->updateValues();
0
378 }
executed 694 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
694
379-
380-
381-
382-
383-
384-
385 int rowsInserted = 0;-
386 for (int i = 0 ; i < target->elements.count()
i < target->elements.count()Description
TRUEevaluated 694 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 926 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
; ++i) {
694-926
387 ListElement *element = target->elements.at(i);-
388 ElementSync &s = elementHash.find(element->getUid()).value();-
389 ((s.srcIndex >= 0) ? static_cast<void>(0) : qt_assert("s.srcIndex >= 0", __FILE__, 448));-
390 s.srcIndex += rowsInserted;-
391 if (s.srcIndex != s.targetIndex
s.srcIndex != s.targetIndexDescription
TRUEevaluated 634 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
60-634
392 if (targetModel
targetModelDescription
TRUEevaluated 544 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
90-544
393 if (s.targetIndex == -1
s.targetIndex == -1Description
TRUEevaluated 544 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-544
394 targetModel->beginInsertRows(QModelIndex(), i, i);-
395 targetModel->endInsertRows();-
396 }
executed 544 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
else {
544
397 targetModel->beginMoveRows(QModelIndex(), i, i, QModelIndex(), s.srcIndex);-
398 targetModel->endMoveRows();-
399 }
never executed: end of block
0
400 }-
401 hasChanges = true;-
402 ++rowsInserted;-
403 }
executed 634 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
634
404 if (s.targetIndex != -1
s.targetIndex != -1Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 634 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
&& !s.changedRoles.isEmpty()
!s.changedRoles.isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
10-634
405 QModelIndex idx = targetModel->createIndex(i, 0);-
406 if (targetModel
targetModelDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-10
407 targetModel->dataChanged(idx, idx, s.changedRoles);
executed 10 times by 1 test: targetModel->dataChanged(idx, idx, s.changedRoles);
Executed by:
  • tst_qqmllistmodelworkerscript
10
408 hasChanges = true;-
409 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
10
410 }
executed 694 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
694
411 return
executed 926 times by 2 tests: return hasChanges;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
hasChanges;
executed 926 times by 2 tests: return hasChanges;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
926
412}-
413-
414ListModel::ListModel(ListLayout *layout, QQmlListModel *modelCache) : m_layout(layout), m_modelCache(modelCache)-
415{-
416}
executed 3596 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3596
417-
418void ListModel::destroy()-
419{-
420 for (const auto &destroyer : remove(0, elements.count()))-
421 destroyer();
executed 6288 times by 15 tests: destroyer();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6288
422-
423 m_layout = nullptr;-
424 if (m_modelCache
m_modelCacheDescription
TRUEevaluated 3490 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 98 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
&& m_modelCache->m_primary == false
m_modelCache->...imary == falseDescription
TRUEevaluated 138 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEevaluated 3352 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
98-3490
425 delete m_modelCache;
executed 138 times by 4 tests: delete m_modelCache;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
138
426 m_modelCache = nullptr;-
427}
executed 3588 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3588
428-
429int ListModel::appendElement()-
430{-
431 int elementIndex = elements.count();-
432 newElement(elementIndex);-
433 return
executed 5560 times by 15 tests: return elementIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
elementIndex;
executed 5560 times by 15 tests: return elementIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
5560
434}-
435-
436void ListModel::insertElement(int index)-
437{-
438 newElement(index);-
439 updateCacheIndices(index);-
440}
executed 460 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
460
441-
442void ListModel::move(int from, int to, int n)-
443{-
444 if (from > to
from > toDescription
TRUEevaluated 34 times by 4 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 54 times by 4 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
) {
34-54
445-
446 int tfrom = from;-
447 int tto = to;-
448 from = tto;-
449 to = tto+n;-
450 n = tfrom-tto;-
451 }
executed 34 times by 4 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
34
452-
453 QPODVector<ListElement *, 4> store;-
454 for (int i=0 ; i < (to-from)
i < (to-from)Description
TRUEevaluated 94 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
; ++i)
88-94
455 store.append(elements[from+n+i]);
executed 94 times by 5 tests: store.append(elements[from+n+i]);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
94
456 for (int i=0 ; i < n
i < nDescription
TRUEevaluated 126 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
; ++i)
88-126
457 store.append(elements[from+i]);
executed 126 times by 5 tests: store.append(elements[from+i]);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
126
458 for (int i=0 ; i < store.count()
i < store.count()Description
TRUEevaluated 220 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
; ++i)
88-220
459 elements[from+i] = store[i];
executed 220 times by 5 tests: elements[from+i] = store[i];
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
220
460-
461 updateCacheIndices(from, to + n);-
462}
executed 88 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
88
463-
464void ListModel::newElement(int index)-
465{-
466 ListElement *e = new ListElement;-
467 elements.insert(index, e);-
468}
executed 6020 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6020
469-
470void ListModel::updateCacheIndices(int start, int end)-
471{-
472 int count = elements.count();-
473-
474 if (end < 0
end < 0Description
TRUEevaluated 5250 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
|| end > count
end > countDescription
TRUEnever evaluated
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
0-5250
475 end = count;
executed 5250 times by 15 tests: end = count;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
5250
476-
477 for (int i = start; i < end
i < endDescription
TRUEevaluated 3118 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 5338 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
; ++i) {
3118-5338
478 ListElement *e = elements.at(i);-
479 if (ModelNodeMetaObject *mo = e->objectCache()
ModelNodeMetaO...>objectCache()Description
TRUEevaluated 324 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 2794 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
324-2794
480 mo->m_elementIndex = i;
executed 324 times by 3 tests: mo->m_elementIndex = i;
Executed by:
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquicklistview
324
481 }
executed 3118 times by 6 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
3118
482}
executed 5338 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
5338
483-
484QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV4::ExecutionEngine *eng)-
485{-
486 if (roleIndex >= m_layout->roleCount()
roleIndex >= m...t->roleCount()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 11583 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
2-11583
487 return
executed 2 times by 1 test: return QVariant();
Executed by:
  • tst_qqmllistmodel
QVariant();
executed 2 times by 1 test: return QVariant();
Executed by:
  • tst_qqmllistmodel
2
488 ListElement *e = elements[elementIndex];-
489 const ListLayout::Role &r = m_layout->getExistingRole(roleIndex);-
490 return
executed 11583 times by 13 tests: return e->getProperty(r, owner, eng);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
e->getProperty(r, owner, eng);
executed 11583 times by 13 tests: return e->getProperty(r, owner, eng);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
11583
491}-
492-
493ListModel *ListModel::getListProperty(int elementIndex, const ListLayout::Role &role)-
494{-
495 ListElement *e = elements[elementIndex];-
496 return
executed 62 times by 2 tests: return e->getListProperty(role);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
e->getListProperty(role);
executed 62 times by 2 tests: return e->getListProperty(role);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
62
497}-
498-
499void ListModel::set(int elementIndex, QV4::Object *object, QVector<int> *roles)-
500{-
501 ListElement *e = elements[elementIndex];-
502-
503 QV4::ExecutionEngine *v4 = object->engine();-
504 QV4::Scope scope(v4);-
505 QV4::ScopedObject o(scope);-
506-
507 QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::WithProtoChain|QV4::ObjectIterator::EnumerableOnly);-
508 QV4::ScopedString propertyName(scope);-
509 QV4::ScopedValue propertyValue(scope);-
510 while (1) {-
511 propertyName = it.nextPropertyNameAsString(propertyValue);-
512 if (!propertyName
!propertyNameDescription
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 134 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
122-134
513 break;
executed 122 times by 2 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
122
514-
515-
516 int roleIndex = -1;-
517-
518-
519 if (const
const QV4::Str...QV4::String>()Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 128 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
QV4::String *s = propertyValue->as<QV4::String>()
const QV4::Str...QV4::String>()Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 128 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
6-128
520 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::String);-
521 roleIndex = e->setStringProperty(r, s->toQString());-
522 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (propertyValue->isNumber()
propertyValue->isNumber()Description
TRUEevaluated 68 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 60 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
6-68
523 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Number);-
524 roleIndex = e->setDoubleProperty(r, propertyValue->asDouble());-
525 }
executed 68 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (QV4::ArrayObject *a = propertyValue->as<QV4::ArrayObject>()
QV4::ArrayObje...ArrayObject>()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
22-68
526 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::List);-
527 ListModel *subModel = new ListModel(r.subLayout, nullptr);-
528-
529 int arrayLength = a->getLength();-
530 for (int j=0 ; j < arrayLength
j < arrayLengthDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++j) {
22-32
531 o = a->get(j);-
532 subModel->append(o);-
533 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
32
534-
535 roleIndex = e->setListProperty(r, subModel);-
536 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (propertyValue->isBoolean()
propertyValue->isBoolean()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
4-34
537 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Bool);-
538 roleIndex = e->setBoolProperty(r, propertyValue->booleanValue());-
539 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else if (QV4::DateObject *dd = propertyValue->as<QV4::DateObject>()
QV4::DateObjec...:DateObject>()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
2-32
540 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::DateTime);-
541 QDateTime dt = dd->toQDateTime();-
542 roleIndex = e->setDateTimeProperty(r, dt);-
543 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else if (QV4::FunctionObject *f = propertyValue->as<QV4::FunctionObject>()
QV4::FunctionO...ctionObject>()Description
TRUEnever evaluated
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
0-32
544 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Function);-
545 QV4::ScopedFunctionObject func(scope, f);-
546 QJSValue jsv;-
547 QJSValuePrivate::setValue(&jsv, v4, func);-
548 roleIndex = e->setFunctionProperty(r, jsv);-
549 }
never executed: end of block
else if (QV4::Object *o = propertyValue->as<QV4::Object>()
QV4::Object *o...QV4::Object>()Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
0-20
550 if (QV4::QObjectWrapper *wrapper = o->as<QV4::QObjectWrapper>()
QV4::QObjectWr...jectWrapper>()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
2-18
551 QObject *o = wrapper->object();-
552 const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::QObject);-
553 if (role.type == ListLayout::Role::QObject
role.type == L...:Role::QObjectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-2
554 roleIndex = e->setQObjectProperty(role, o);
executed 2 times by 1 test: roleIndex = e->setQObjectProperty(role, o);
Executed by:
  • tst_qqmllistmodel
2
555 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else {
2
556 const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::VariantMap);-
557 if (role.type == ListLayout::Role::VariantMap
role.type == L...le::VariantMapDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-18
558 QV4::ScopedObject obj(scope, o);-
559 roleIndex = e->setVariantMapProperty(role, obj);-
560 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
18
561 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
18
562 } else if (propertyValue->isNullOrUndefined()
propertyValue-...lOrUndefined()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-12
563 const ListLayout::Role *r = m_layout->getExistingRole(propertyName);-
564 if (r
rDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-12
565 e->clearProperty(*r);
executed 12 times by 2 tests: e->clearProperty(*r);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
566 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
567-
568 if (roleIndex != -1
roleIndex != -1Description
TRUEevaluated 114 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
20-114
569 roles->append(roleIndex);
executed 114 times by 2 tests: roles->append(roleIndex);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
114
570 }
executed 134 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
134
571-
572 if (ModelNodeMetaObject *mo = e->objectCache()
ModelNodeMetaO...>objectCache()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
26-96
573 mo->updateValues(*roles);
executed 26 times by 1 test: mo->updateValues(*roles);
Executed by:
  • tst_qqmllistmodel
26
574}
executed 122 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
122
575-
576void ListModel::set(int elementIndex, QV4::Object *object)-
577{-
578 if (!object
!objectDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2736 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
6-2736
579 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qqmllistmodel
6
580-
581 ListElement *e = elements[elementIndex];-
582-
583 QV4::ExecutionEngine *v4 = object->engine();-
584 QV4::Scope scope(v4);-
585-
586 QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::WithProtoChain|QV4::ObjectIterator::EnumerableOnly);-
587 QV4::ScopedString propertyName(scope);-
588 QV4::ScopedValue propertyValue(scope);-
589 QV4::ScopedObject o(scope);-
590 while (1) {-
591 propertyName = it.nextPropertyNameAsString(propertyValue);-
592 if (!propertyName
!propertyNameDescription
TRUEevaluated 2736 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 3832 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
2736-3832
593 break;
executed 2736 times by 9 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
2736
594-
595-
596 if (QV4::String *s = propertyValue->stringValue()
QV4::String *s...>stringValue()Description
TRUEevaluated 1176 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 2656 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
) {
1176-2656
597 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::String);-
598 if (r.type == ListLayout::Role::String
r.type == List...::Role::StringDescription
TRUEevaluated 1170 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
6-1170
599 e->setStringPropertyFast(r, s->toQString());
executed 1170 times by 8 tests: e->setStringPropertyFast(r, s->toQString());
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1170
600 }
executed 1176 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
else if (propertyValue->isNumber()
propertyValue->isNumber()Description
TRUEevaluated 2334 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 322 times by 4 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
) {
322-2334
601 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Number);-
602 if (r.type == ListLayout::Role::Number
r.type == List...::Role::NumberDescription
TRUEevaluated 2334 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEnever evaluated
) {
0-2334
603 e->setDoublePropertyFast(r, propertyValue->asDouble());-
604 }
executed 2334 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
2334
605 }
executed 2334 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
else if (QV4::ArrayObject *a = propertyValue->as<QV4::ArrayObject>()
QV4::ArrayObje...ArrayObject>()Description
TRUEevaluated 126 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEevaluated 196 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
) {
126-2334
606 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::List);-
607 if (r.type == ListLayout::Role::List
r.type == List...ut::Role::ListDescription
TRUEevaluated 126 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEnever evaluated
) {
0-126
608 ListModel *subModel = new ListModel(r.subLayout, nullptr);-
609-
610 int arrayLength = a->getLength();-
611 for (int j=0 ; j < arrayLength
j < arrayLengthDescription
TRUEevaluated 344 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
; ++j) {
126-344
612 o = a->get(j);-
613 subModel->append(o);-
614 }
executed 344 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
344
615-
616 e->setListPropertyFast(r, subModel);-
617 }
executed 126 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
126
618 }
executed 126 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
else if (propertyValue->isBoolean()
propertyValue->isBoolean()Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
FALSEevaluated 108 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
88-126
619 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Bool);-
620 if (r.type == ListLayout::Role::Bool
r.type == List...ut::Role::BoolDescription
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
FALSEnever evaluated
) {
0-88
621 e->setBoolPropertyFast(r, propertyValue->booleanValue());-
622 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
88
623 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
else if (QV4::DateObject *date = propertyValue->as<QV4::DateObject>()
QV4::DateObjec...:DateObject>()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 98 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
10-98
624 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::DateTime);-
625 if (r.type == ListLayout::Role::DateTime
r.type == List...Role::DateTimeDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-10
626 QDateTime dt = date->toQDateTime();;-
627 e->setDateTimePropertyFast(r, dt);-
628 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
10
629 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else if (QV4::Object *o = propertyValue->as<QV4::Object>()
QV4::Object *o...QV4::Object>()Description
TRUEevaluated 92 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
6-92
630 if (QV4::QObjectWrapper *wrapper = o->as<QV4::QObjectWrapper>()
QV4::QObjectWr...jectWrapper>()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 84 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
8-84
631 QObject *o = wrapper->object();-
632 const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::QObject);-
633 if (r.type == ListLayout::Role::QObject
r.type == List...:Role::QObjectDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-8
634 e->setQObjectPropertyFast(r, o);
executed 8 times by 1 test: e->setQObjectPropertyFast(r, o);
Executed by:
  • tst_qqmllistmodel
8
635 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else {
8
636 const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::VariantMap);-
637 if (role.type == ListLayout::Role::VariantMap
role.type == L...le::VariantMapDescription
TRUEevaluated 84 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-84
638 e->setVariantMapFast(role, o);
executed 84 times by 2 tests: e->setVariantMapFast(role, o);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
84
639 }
executed 84 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
84
640 } else if (propertyValue->isNullOrUndefined()
propertyValue-...lOrUndefined()Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-6
641 const ListLayout::Role *r = m_layout->getExistingRole(propertyName);-
642 if (r
rDescription
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-6
643 e->clearProperty(*r);
never executed: e->clearProperty(*r);
0
644 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
645 }
executed 3832 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
3832
646}
executed 2736 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
2736
647-
648QVector<std::function<void()>> ListModel::remove(int index, int count)-
649{-
650 QVector<std::function<void()>> toDestroy;-
651 auto layout = m_layout;-
652 for (int i=0 ; i < count
i < countDescription
TRUEevaluated 6636 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 3864 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
; ++i) {
3864-6636
653 auto element = elements[index+i];-
654 toDestroy.append([element, layout](){-
655 element->destroy(layout);-
656 delete element;-
657 }
executed 6636 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
;
6636
658 }
executed 6636 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6636
659 elements.remove(index, count);-
660 updateCacheIndices(index);-
661 return
executed 3864 times by 15 tests: return toDestroy;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
toDestroy;
executed 3864 times by 15 tests: return toDestroy;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3864
662}-
663-
664void ListModel::insert(int elementIndex, QV4::Object *object)-
665{-
666 insertElement(elementIndex);-
667 set(elementIndex, object);-
668}
executed 460 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
460
669-
670int ListModel::append(QV4::Object *object)-
671{-
672 int elementIndex = appendElement();-
673 set(elementIndex, object);-
674 return
executed 2282 times by 8 tests: return elementIndex;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
elementIndex;
executed 2282 times by 8 tests: return elementIndex;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
2282
675}-
676-
677int ListModel::setOrCreateProperty(int elementIndex, const QString &key, const QVariant &data)-
678{-
679 int roleIndex = -1;-
680-
681 if (elementIndex >= 0
elementIndex >= 0Description
TRUEevaluated 4502 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
&& elementIndex < elements.count()
elementIndex <...ements.count()Description
TRUEevaluated 4502 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEnever evaluated
) {
0-4502
682 ListElement *e = elements[elementIndex];-
683-
684 const ListLayout::Role *r = m_layout->getRoleOrCreate(key, data);-
685 if (r
rDescription
TRUEevaluated 4500 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
2-4500
686 roleIndex = e->setVariantProperty(*r, data);-
687-
688 ModelNodeMetaObject *cache = e->objectCache();-
689-
690 if (roleIndex != -1
roleIndex != -1Description
TRUEevaluated 4448 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 52 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
&& cache
cacheDescription
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
FALSEevaluated 4430 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
18-4448
691 cache->updateValues(QVector<int>(1, roleIndex));
executed 18 times by 3 tests: cache->updateValues(QVector<int>(1, roleIndex));
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
18
692 }
executed 4500 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4500
693 }
executed 4502 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4502
694-
695 return
executed 4504 times by 14 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
roleIndex;
executed 4504 times by 14 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4504
696}-
697-
698int ListModel::setExistingProperty(int elementIndex, const QString &key, const QV4::Value &data, QV4::ExecutionEngine *eng)-
699{-
700 int roleIndex = -1;-
701-
702 if (elementIndex >= 0
elementIndex >= 0Description
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
&& elementIndex < elements.count()
elementIndex <...ements.count()Description
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-58
703 ListElement *e = elements[elementIndex];-
704 const ListLayout::Role *r = m_layout->getExistingRole(key);-
705 if (r
rDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-58
706 roleIndex = e->setJsProperty(*r, data, eng);
executed 58 times by 2 tests: roleIndex = e->setJsProperty(*r, data, eng);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
707 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
708-
709 return
executed 58 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 58 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
710}-
711-
712inline char *ListElement::getPropertyMemory(const ListLayout::Role &role)-
713{-
714 ListElement *e = this;-
715 int blockIndex = 0;-
716 while (blockIndex < role.blockIndex
blockIndex < role.blockIndexDescription
TRUEevaluated 48 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 28247 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
48-28247
717 if (e->next == nullptr
e->next == nullptrDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
10-38
718 e->next = new ListElement;-
719 e->next->uid = uid;-
720 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
10
721 e = e->next;-
722 ++blockIndex;-
723 }
executed 48 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
48
724-
725 char *mem = &e->data[role.blockOffset];-
726 return
executed 28247 times by 15 tests: return mem;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
mem;
executed 28247 times by 15 tests: return mem;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
28247
727}-
728-
729ModelNodeMetaObject *ListElement::objectCache()-
730{-
731 if (!m_objectCache
!m_objectCacheDescription
TRUEevaluated 8064 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 370 times by 4 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
)
370-8064
732 return
executed 8064 times by 14 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
nullptr;
executed 8064 times by 14 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
8064
733 return
executed 370 times by 4 tests: return ModelNodeMetaObject::get(m_objectCache);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
ModelNodeMetaObject::get(m_objectCache);
executed 370 times by 4 tests: return ModelNodeMetaObject::get(m_objectCache);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
370
734}-
735-
736StringOrTranslation *ListElement::getStringProperty(const ListLayout::Role &role)-
737{-
738 char *mem = getPropertyMemory(role);-
739 StringOrTranslation *s = reinterpret_cast<StringOrTranslation *>(mem);-
740 return
executed 5122 times by 14 tests: return s;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
s;
executed 5122 times by 14 tests: return s;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5122
741}-
742-
743QObject *ListElement::getQObjectProperty(const ListLayout::Role &role)-
744{-
745 char *mem = getPropertyMemory(role);-
746 QPointer<QObject> *o = reinterpret_cast<QPointer<QObject> *>(mem);-
747 return
never executed: return o->data();
o->data();
never executed: return o->data();
0
748}-
749-
750QVariantMap *ListElement::getVariantMapProperty(const ListLayout::Role &role)-
751{-
752 QVariantMap *map = nullptr;-
753-
754 char *mem = getPropertyMemory(role);-
755 if (isMemoryUsed<QVariantMap>(mem)
isMemoryUsed<QVariantMap>(mem)Description
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 244 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
172-244
756 map = reinterpret_cast<QVariantMap *>(mem);
executed 172 times by 2 tests: map = reinterpret_cast<QVariantMap *>(mem);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
172
757-
758 return
executed 416 times by 2 tests: return map;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
map;
executed 416 times by 2 tests: return map;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
416
759}-
760-
761QDateTime *ListElement::getDateTimeProperty(const ListLayout::Role &role)-
762{-
763 QDateTime *dt = nullptr;-
764-
765 char *mem = getPropertyMemory(role);-
766 if (isMemoryUsed<QDateTime>(mem)
isMemoryUsed<QDateTime>(mem)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-10
767 dt = reinterpret_cast<QDateTime *>(mem);
executed 10 times by 1 test: dt = reinterpret_cast<QDateTime *>(mem);
Executed by:
  • tst_qqmllistmodel
10
768-
769 return
executed 10 times by 1 test: return dt;
Executed by:
  • tst_qqmllistmodel
dt;
executed 10 times by 1 test: return dt;
Executed by:
  • tst_qqmllistmodel
10
770}-
771-
772QJSValue *ListElement::getFunctionProperty(const ListLayout::Role &role)-
773{-
774 QJSValue *f = nullptr;-
775-
776 char *mem = getPropertyMemory(role);-
777 if (isMemoryUsed<QJSValue>(mem)
isMemoryUsed<QJSValue>(mem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
778 f = reinterpret_cast<QJSValue *>(mem);
never executed: f = reinterpret_cast<QJSValue *>(mem);
0
779-
780 return
never executed: return f;
f;
never executed: return f;
0
781}-
782-
783QPointer<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role)-
784{-
785 char *mem = getPropertyMemory(role);-
786-
787 bool existingGuard = false;-
788 for (size_t i=0 ; i < sizeof(QPointer<QObject>)
i < sizeof(QPointer<QObject>)Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
; ++i) {
2-40
789 if (mem[i] != 0
mem[i] != 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
8-32
790 existingGuard = true;-
791 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
8
792 }-
793 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
32
794-
795 QPointer<QObject> *o = nullptr;-
796-
797 if (existingGuard
existingGuardDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
2-8
798 o = reinterpret_cast<QPointer<QObject> *>(mem);
executed 8 times by 1 test: o = reinterpret_cast<QPointer<QObject> *>(mem);
Executed by:
  • tst_qqmllistmodel
8
799-
800 return
executed 10 times by 1 test: return o;
Executed by:
  • tst_qqmllistmodel
o;
executed 10 times by 1 test: return o;
Executed by:
  • tst_qqmllistmodel
10
801}-
802-
803ListModel *ListElement::getListProperty(const ListLayout::Role &role)-
804{-
805 char *mem = getPropertyMemory(role);-
806 ListModel **value = reinterpret_cast<ListModel **>(mem);-
807 return
executed 664 times by 4 tests: return *value;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
*value;
executed 664 times by 4 tests: return *value;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
664
808}-
809-
810QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListModel *owner, QV4::ExecutionEngine *eng)-
811{-
812 char *mem = getPropertyMemory(role);-
813-
814 QVariant data;-
815-
816 switch (role.type) {-
817 case
executed 1848 times by 4 tests: case ListLayout::Role::Number:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
ListLayout::Role::Number:
executed 1848 times by 4 tests: case ListLayout::Role::Number:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
1848
818 {-
819 double *value = reinterpret_cast<double *>(mem);-
820 data = *value;-
821 }-
822 break;
executed 1848 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
1848
823 case
executed 10271 times by 12 tests: case ListLayout::Role::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
ListLayout::Role::String:
executed 10271 times by 12 tests: case ListLayout::Role::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10271
824 {-
825 StringOrTranslation *value = reinterpret_cast<StringOrTranslation *>(mem);-
826 if (value->isSet()
value->isSet()Description
TRUEevaluated 10271 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-10271
827 data = value->toString(owner);
executed 10271 times by 12 tests: data = value->toString(owner);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10271
828 }-
829 break;
executed 10271 times by 12 tests: break;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10271
830 case
executed 122 times by 2 tests: case ListLayout::Role::Bool:
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
ListLayout::Role::Bool:
executed 122 times by 2 tests: case ListLayout::Role::Bool:
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
122
831 {-
832 bool *value = reinterpret_cast<bool *>(mem);-
833 data = *value;-
834 }-
835 break;
executed 122 times by 2 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
122
836 case
executed 202 times by 4 tests: case ListLayout::Role::List:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
ListLayout::Role::List:
executed 202 times by 4 tests: case ListLayout::Role::List:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
202
837 {-
838 ListModel **value = reinterpret_cast<ListModel **>(mem);-
839 ListModel *model = *value;-
840-
841 if (model
modelDescription
TRUEevaluated 202 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEnever evaluated
) {
0-202
842 if (model->m_modelCache == nullptr
model->m_modelCache == nullptrDescription
TRUEevaluated 138 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEevaluated 64 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
64-138
843 model->m_modelCache = new QQmlListModel(owner, model, eng);-
844 QQmlEngine::setContextForObject(model->m_modelCache, QQmlEngine::contextForObject(owner));-
845 }
executed 138 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
138
846-
847 QObject *object = model->m_modelCache;-
848 data = QVariant::fromValue(object);-
849 }
executed 202 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
202
850 }-
851 break;
executed 202 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
202
852 case
executed 4 times by 1 test: case ListLayout::Role::QObject:
Executed by:
  • tst_qqmllistmodel
ListLayout::Role::QObject:
executed 4 times by 1 test: case ListLayout::Role::QObject:
Executed by:
  • tst_qqmllistmodel
4
853 {-
854 QPointer<QObject> *guard = reinterpret_cast<QPointer<QObject> *>(mem);-
855 QObject *object = guard->data();-
856 if (object
objectDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-4
857 data = QVariant::fromValue(object);
executed 4 times by 1 test: data = QVariant::fromValue(object);
Executed by:
  • tst_qqmllistmodel
4
858 }-
859 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
4
860 case
executed 24 times by 2 tests: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
ListLayout::Role::VariantMap:
executed 24 times by 2 tests: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
861 {-
862 if (isMemoryUsed<QVariantMap>(mem)
isMemoryUsed<QVariantMap>(mem)Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-24
863 QVariantMap *map = reinterpret_cast<QVariantMap *>(mem);-
864 data = *map;-
865 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
866 }-
867 break;
executed 24 times by 2 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
868 case
executed 10 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
ListLayout::Role::DateTime:
executed 10 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
10
869 {-
870 if (isMemoryUsed<QDateTime>(mem)
isMemoryUsed<QDateTime>(mem)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-10
871 QDateTime *dt = reinterpret_cast<QDateTime *>(mem);-
872 data = *dt;-
873 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
10
874 }-
875 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
10
876 case
never executed: case ListLayout::Role::Function:
ListLayout::Role::Function:
never executed: case ListLayout::Role::Function:
0
877 {-
878 if (isMemoryUsed<QJSValue>(mem)
isMemoryUsed<QJSValue>(mem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
879 QJSValue *func = reinterpret_cast<QJSValue *>(mem);-
880 data = QVariant::fromValue(*func);-
881 }
never executed: end of block
0
882 }-
883 break;
never executed: break;
0
884 default
never executed: default:
:
never executed: default:
0
885 break;
never executed: break;
0
886 }-
887-
888 return
executed 12481 times by 13 tests: return data;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
data;
executed 12481 times by 13 tests: return data;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
12481
889}-
890-
891int ListElement::setStringProperty(const ListLayout::Role &role, const QString &s)-
892{-
893 int roleIndex = -1;-
894-
895 if (role.type == ListLayout::Role::String
role.type == L...::Role::StringDescription
TRUEevaluated 3956 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
) {
0-3956
896 char *mem = getPropertyMemory(role);-
897 StringOrTranslation *c = reinterpret_cast<StringOrTranslation *>(mem);-
898 bool changed;-
899 if (!c->isSet()
!c->isSet()Description
TRUEevaluated 3950 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
|| c->isTranslation()
c->isTranslation()Description
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-3950
900 changed = true;
executed 3950 times by 12 tests: changed = true;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3950
901 else-
902 changed = c->asString().compare(s) != 0;
executed 6 times by 2 tests: changed = c->asString().compare(s) != 0;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
903 c->setString(s);-
904 if (changed
changedDescription
TRUEevaluated 3956 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-3956
905 roleIndex = role.index;
executed 3956 times by 12 tests: roleIndex = role.index;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3956
906 }
executed 3956 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3956
907-
908 return
executed 3956 times by 12 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
roleIndex;
executed 3956 times by 12 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3956
909}-
910-
911int ListElement::setDoubleProperty(const ListLayout::Role &role, double d)-
912{-
913 int roleIndex = -1;-
914-
915 if (role.type == ListLayout::Role::Number
role.type == L...::Role::NumberDescription
TRUEevaluated 1446 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
6-1446
916 char *mem = getPropertyMemory(role);-
917 double *value = reinterpret_cast<double *>(mem);-
918 bool changed = *value != d;-
919 *value = d;-
920 if (changed
changedDescription
TRUEevaluated 1210 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 236 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
)
236-1210
921 roleIndex = role.index;
executed 1210 times by 5 tests: roleIndex = role.index;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
1210
922 }
executed 1446 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
1446
923-
924 return
executed 1452 times by 5 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
roleIndex;
executed 1452 times by 5 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
1452
925}-
926-
927int ListElement::setBoolProperty(const ListLayout::Role &role, bool b)-
928{-
929 int roleIndex = -1;-
930-
931 if (role.type == ListLayout::Role::Bool
role.type == L...ut::Role::BoolDescription
TRUEevaluated 70 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
FALSEnever evaluated
) {
0-70
932 char *mem = getPropertyMemory(role);-
933 bool *value = reinterpret_cast<bool *>(mem);-
934 bool changed = *value != b;-
935 *value = b;-
936 if (changed
changedDescription
TRUEevaluated 40 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
30-40
937 roleIndex = role.index;
executed 40 times by 3 tests: roleIndex = role.index;
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
40
938 }
executed 70 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
70
939-
940 return
executed 70 times by 3 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
roleIndex;
executed 70 times by 3 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
70
941}-
942-
943int ListElement::setListProperty(const ListLayout::Role &role, ListModel *m)-
944{-
945 int roleIndex = -1;-
946-
947 if (role.type == ListLayout::Role::List
role.type == L...ut::Role::ListDescription
TRUEevaluated 68 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-68
948 char *mem = getPropertyMemory(role);-
949 ListModel **value = reinterpret_cast<ListModel **>(mem);-
950 if (*
*valueDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 46 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
value
*valueDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 46 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
&& *
*value != mDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
value != m
*value != mDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-46
951 (*value)->destroy();-
952 delete *value;-
953 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
22
954 *value = m;-
955 roleIndex = role.index;-
956 }
executed 68 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
68
957-
958 return
executed 68 times by 3 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 68 times by 3 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
68
959}-
960-
961int ListElement::setQObjectProperty(const ListLayout::Role &role, QObject *o)-
962{-
963 int roleIndex = -1;-
964-
965 if (role.type == ListLayout::Role::QObject
role.type == L...:Role::QObjectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-2
966 char *mem = getPropertyMemory(role);-
967 QPointer<QObject> *g = reinterpret_cast<QPointer<QObject> *>(mem);-
968 bool existingGuard = false;-
969 for (size_t i=0 ; i < sizeof(QPointer<QObject>)
i < sizeof(QPointer<QObject>)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
; ++i) {
0-2
970 if (mem[i] != 0
mem[i] != 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-2
971 existingGuard = true;-
972 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
2
973 }-
974 }
never executed: end of block
0
975 bool changed;-
976 if (existingGuard
existingGuardDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-2
977 changed = g->data() != o;-
978 g->~QPointer();-
979 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else {
2
980 changed = true;-
981 }
never executed: end of block
0
982 new (mem) QPointer<QObject>(o);-
983 if (changed
changedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-2
984 roleIndex = role.index;
executed 2 times by 1 test: roleIndex = role.index;
Executed by:
  • tst_qqmllistmodel
2
985 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
2
986-
987 return
executed 2 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodel
roleIndex;
executed 2 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodel
2
988}-
989-
990int ListElement::setVariantMapProperty(const ListLayout::Role &role, QV4::Object *o)-
991{-
992 int roleIndex = -1;-
993-
994 if (role.type == ListLayout::Role::VariantMap
role.type == L...le::VariantMapDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-18
995 char *mem = getPropertyMemory(role);-
996 if (isMemoryUsed<QVariantMap>(mem)
isMemoryUsed<QVariantMap>(mem)Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
6-12
997 QVariantMap *map = reinterpret_cast<QVariantMap *>(mem);-
998 map->~QMap();-
999 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
1000 new (mem) QVariantMap(o->engine()->variantMapFromJS(o));-
1001 roleIndex = role.index;-
1002 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
18
1003-
1004 return
executed 18 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 18 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
18
1005}-
1006-
1007int ListElement::setVariantMapProperty(const ListLayout::Role &role, QVariantMap *m)-
1008{-
1009 int roleIndex = -1;-
1010-
1011 if (role.type == ListLayout::Role::VariantMap
role.type == L...le::VariantMapDescription
TRUEevaluated 106 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-106
1012 char *mem = getPropertyMemory(role);-
1013 if (isMemoryUsed<QVariantMap>(mem)
isMemoryUsed<QVariantMap>(mem)Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
12-94
1014 QVariantMap *map = reinterpret_cast<QVariantMap *>(mem);-
1015 if (m
mDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
&& map->isSharedWith(*m)
map->isSharedWith(*m)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-6
1016 return
executed 6 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 6 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodelworkerscript
6
1017 map->~QMap();-
1018 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (!m
!mDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
6-56
1019 return
executed 56 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 56 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodelworkerscript
56
1020 }-
1021 if (m
mDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
6-38
1022 new
executed 38 times by 1 test: new (mem) QVariantMap(*m);
Executed by:
  • tst_qqmllistmodelworkerscript
(mem) QVariantMap(*m);
executed 38 times by 1 test: new (mem) QVariantMap(*m);
Executed by:
  • tst_qqmllistmodelworkerscript
38
1023 else-
1024 new
executed 6 times by 2 tests: new (mem) QVariantMap;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
(mem) QVariantMap;
executed 6 times by 2 tests: new (mem) QVariantMap;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
1025 roleIndex = role.index;-
1026 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
44
1027-
1028 return
executed 44 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 44 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
44
1029}-
1030-
1031int ListElement::setDateTimeProperty(const ListLayout::Role &role, const QDateTime &dt)-
1032{-
1033 int roleIndex = -1;-
1034-
1035 if (role.type == ListLayout::Role::DateTime
role.type == L...Role::DateTimeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-8
1036 char *mem = getPropertyMemory(role);-
1037 if (isMemoryUsed<QDateTime>(mem)
isMemoryUsed<QDateTime>(mem)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-8
1038 QDateTime *dt = reinterpret_cast<QDateTime *>(mem);-
1039 dt->~QDateTime();-
1040 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
8
1041 new (mem) QDateTime(dt);-
1042 roleIndex = role.index;-
1043 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
8
1044-
1045 return
executed 8 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodel
roleIndex;
executed 8 times by 1 test: return roleIndex;
Executed by:
  • tst_qqmllistmodel
8
1046}-
1047-
1048int ListElement::setFunctionProperty(const ListLayout::Role &role, const QJSValue &f)-
1049{-
1050 int roleIndex = -1;-
1051-
1052 if (role.type == ListLayout::Role::Function
role.type == L...Role::FunctionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1053 char *mem = getPropertyMemory(role);-
1054 if (isMemoryUsed<QJSValue>(mem)
isMemoryUsed<QJSValue>(mem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1055 QJSValue *f = reinterpret_cast<QJSValue *>(mem);-
1056 f->~QJSValue();-
1057 }
never executed: end of block
0
1058 new (mem) QJSValue(f);-
1059 roleIndex = role.index;-
1060 }
never executed: end of block
0
1061-
1062 return
never executed: return roleIndex;
roleIndex;
never executed: return roleIndex;
0
1063}-
1064-
1065int ListElement::setTranslationProperty(const ListLayout::Role &role, const QV4::CompiledData::Binding *b)-
1066{-
1067 int roleIndex = -1;-
1068-
1069 if (role.type == ListLayout::Role::String
role.type == L...::Role::StringDescription
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
FALSEnever evaluated
) {
0-8
1070 char *mem = getPropertyMemory(role);-
1071 StringOrTranslation *s = reinterpret_cast<StringOrTranslation *>(mem);-
1072 s->setTranslation(b);-
1073 roleIndex = role.index;-
1074 }
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
8
1075-
1076 return
executed 8 times by 3 tests: return roleIndex;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
roleIndex;
executed 8 times by 3 tests: return roleIndex;
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
8
1077}-
1078-
1079-
1080void ListElement::setStringPropertyFast(const ListLayout::Role &role, const QString &s)-
1081{-
1082 char *mem = getPropertyMemory(role);-
1083 new (mem) StringOrTranslation(s);-
1084}
executed 1170 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
1170
1085-
1086void ListElement::setDoublePropertyFast(const ListLayout::Role &role, double d)-
1087{-
1088 char *mem = getPropertyMemory(role);-
1089 double *value = new (mem) double;-
1090 *value = d;-
1091}
executed 2334 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
2334
1092-
1093void ListElement::setBoolPropertyFast(const ListLayout::Role &role, bool b)-
1094{-
1095 char *mem = getPropertyMemory(role);-
1096 bool *value = new (mem) bool;-
1097 *value = b;-
1098}
executed 88 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
88
1099-
1100void ListElement::setQObjectPropertyFast(const ListLayout::Role &role, QObject *o)-
1101{-
1102 char *mem = getPropertyMemory(role);-
1103 new (mem) QPointer<QObject>(o);-
1104}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
8
1105-
1106void ListElement::setListPropertyFast(const ListLayout::Role &role, ListModel *m)-
1107{-
1108 char *mem = getPropertyMemory(role);-
1109 ListModel **value = new (mem) ListModel *;-
1110 *value = m;-
1111}
executed 168 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
168
1112-
1113void ListElement::setVariantMapFast(const ListLayout::Role &role, QV4::Object *o)-
1114{-
1115 char *mem = getPropertyMemory(role);-
1116 QVariantMap *map = new (mem) QVariantMap;-
1117 *map = o->engine()->variantMapFromJS(o);-
1118}
executed 84 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
84
1119-
1120void ListElement::setDateTimePropertyFast(const ListLayout::Role &role, const QDateTime &dt)-
1121{-
1122 char *mem = getPropertyMemory(role);-
1123 new (mem) QDateTime(dt);-
1124}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
10
1125-
1126void ListElement::setFunctionPropertyFast(const ListLayout::Role &role, const QJSValue &f)-
1127{-
1128 char *mem = getPropertyMemory(role);-
1129 new (mem) QJSValue(f);-
1130}
never executed: end of block
0
1131-
1132void ListElement::clearProperty(const ListLayout::Role &role)-
1133{-
1134 switch (role.type) {-
1135 case
never executed: case ListLayout::Role::String:
ListLayout::Role::String:
never executed: case ListLayout::Role::String:
0
1136 setStringProperty(role, QString());-
1137 break;
never executed: break;
0
1138 case
executed 6 times by 2 tests: case ListLayout::Role::Number:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
ListLayout::Role::Number:
executed 6 times by 2 tests: case ListLayout::Role::Number:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
1139 setDoubleProperty(role, 0.0);-
1140 break;
executed 6 times by 2 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
1141 case
never executed: case ListLayout::Role::Bool:
ListLayout::Role::Bool:
never executed: case ListLayout::Role::Bool:
0
1142 setBoolProperty(role, false);-
1143 break;
never executed: break;
0
1144 case
never executed: case ListLayout::Role::List:
ListLayout::Role::List:
never executed: case ListLayout::Role::List:
0
1145 setListProperty(role, nullptr);-
1146 break;
never executed: break;
0
1147 case
never executed: case ListLayout::Role::QObject:
ListLayout::Role::QObject:
never executed: case ListLayout::Role::QObject:
0
1148 setQObjectProperty(role, nullptr);-
1149 break;
never executed: break;
0
1150 case
executed 2 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
ListLayout::Role::DateTime:
executed 2 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
2
1151 setDateTimeProperty(role, QDateTime());-
1152 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
2
1153 case
executed 6 times by 2 tests: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
ListLayout::Role::VariantMap:
executed 6 times by 2 tests: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
1154 setVariantMapProperty(role, (QVariantMap *)nullptr);-
1155 break;
executed 6 times by 2 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
6
1156 case
never executed: case ListLayout::Role::Function:
ListLayout::Role::Function:
never executed: case ListLayout::Role::Function:
0
1157 setFunctionProperty(role, QJSValue());-
1158 break;
never executed: break;
0
1159 default
never executed: default:
:
never executed: default:
0
1160 break;
never executed: break;
0
1161 }-
1162}-
1163-
1164ListElement::ListElement()-
1165{-
1166 m_objectCache = nullptr;-
1167 uid = uidCounter.fetchAndAddOrdered(1);-
1168 next = nullptr;-
1169 memset(data, 0, sizeof(data));-
1170}
executed 6030 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6030
1171-
1172ListElement::ListElement(int existingUid)-
1173{-
1174 m_objectCache = nullptr;-
1175 uid = existingUid;-
1176 next = nullptr;-
1177 memset(data, 0, sizeof(data));-
1178}
executed 634 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
634
1179-
1180ListElement::~ListElement()-
1181{-
1182 delete next;-
1183}
executed 6650 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6650
1184-
1185QVector<int> ListElement::sync(ListElement *src, ListLayout *srcLayout, ListElement *target, ListLayout *targetLayout)-
1186{-
1187 QVector<int> changedRoles;-
1188 for (int i=0 ; i < srcLayout->roleCount()
i < srcLayout->roleCount()Description
TRUEevaluated 1104 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 694 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
694-1104
1189 const ListLayout::Role &srcRole = srcLayout->getExistingRole(i);-
1190 const ListLayout::Role &targetRole = targetLayout->getExistingRole(i);-
1191-
1192 int roleIndex = -1;-
1193 switch (srcRole.type) {-
1194 case
executed 106 times by 1 test: case ListLayout::Role::List:
Executed by:
  • tst_qqmllistmodelworkerscript
ListLayout::Role::List:
executed 106 times by 1 test: case ListLayout::Role::List:
Executed by:
  • tst_qqmllistmodelworkerscript
106
1195 {-
1196 ListModel *srcSubModel = src->getListProperty(srcRole);-
1197 ListModel *targetSubModel = target->getListProperty(targetRole);-
1198-
1199 if (srcSubModel
srcSubModelDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
50-56
1200 if (targetSubModel == nullptr
targetSubModel == nullptrDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
14-42
1201 targetSubModel = new ListModel(targetRole.subLayout, nullptr);-
1202 target->setListPropertyFast(targetRole, targetSubModel);-
1203 }
executed 42 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
42
1204 if (ListModel::sync(srcSubModel, targetSubModel)
ListModel::syn...argetSubModel)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
14-42
1205 roleIndex = targetRole.index;
executed 42 times by 1 test: roleIndex = targetRole.index;
Executed by:
  • tst_qqmllistmodelworkerscript
42
1206 }
executed 56 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
56
1207 }-
1208 break;
executed 106 times by 1 test: break;
Executed by:
  • tst_qqmllistmodelworkerscript
106
1209 case
never executed: case ListLayout::Role::QObject:
ListLayout::Role::QObject:
never executed: case ListLayout::Role::QObject:
0
1210 {-
1211 QObject *object = src->getQObjectProperty(srcRole);-
1212 roleIndex = target->setQObjectProperty(targetRole, object);-
1213 }-
1214 break;
never executed: break;
0
1215 case
executed 8 times by 1 test: case ListLayout::Role::String:
Executed by:
  • tst_qqmllistmodelworkerscript
ListLayout::Role::String:
executed 8 times by 1 test: case ListLayout::Role::String:
Executed by:
  • tst_qqmllistmodelworkerscript
8
1216 case
executed 890 times by 1 test: case ListLayout::Role::Number:
Executed by:
  • tst_qqmllistmodelworkerscript
ListLayout::Role::Number:
executed 890 times by 1 test: case ListLayout::Role::Number:
Executed by:
  • tst_qqmllistmodelworkerscript
890
1217 case
never executed: case ListLayout::Role::Bool:
ListLayout::Role::Bool:
never executed: case ListLayout::Role::Bool:
0
1218 case
never executed: case ListLayout::Role::DateTime:
ListLayout::Role::DateTime:
never executed: case ListLayout::Role::DateTime:
0
1219 case
never executed: case ListLayout::Role::Function:
ListLayout::Role::Function:
never executed: case ListLayout::Role::Function:
0
1220 {-
1221 QVariant v = src->getProperty(srcRole, nullptr, nullptr);-
1222 roleIndex = target->setVariantProperty(targetRole, v);-
1223 }-
1224 break;
executed 898 times by 1 test: break;
Executed by:
  • tst_qqmllistmodelworkerscript
898
1225 case
executed 100 times by 1 test: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodelworkerscript
ListLayout::Role::VariantMap:
executed 100 times by 1 test: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodelworkerscript
100
1226 {-
1227 QVariantMap *map = src->getVariantMapProperty(srcRole);-
1228 roleIndex = target->setVariantMapProperty(targetRole, map);-
1229 }-
1230 break;
executed 100 times by 1 test: break;
Executed by:
  • tst_qqmllistmodelworkerscript
100
1231 default
never executed: default:
:
never executed: default:
0
1232 break;
never executed: break;
0
1233 }-
1234 if (roleIndex >= 0
roleIndex >= 0Description
TRUEevaluated 766 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 338 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
338-766
1235 changedRoles << roleIndex;
executed 766 times by 1 test: changedRoles << roleIndex;
Executed by:
  • tst_qqmllistmodelworkerscript
766
1236 }
executed 1104 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
1104
1237-
1238 return
executed 694 times by 1 test: return changedRoles;
Executed by:
  • tst_qqmllistmodelworkerscript
changedRoles;
executed 694 times by 1 test: return changedRoles;
Executed by:
  • tst_qqmllistmodelworkerscript
694
1239}-
1240-
1241void ListElement::destroy(ListLayout *layout)-
1242{-
1243 if (layout
layoutDescription
TRUEevaluated 6640 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
10-6640
1244 for (int i=0 ; i < layout->roleCount()
i < layout->roleCount()Description
TRUEevaluated 9940 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 6640 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
; ++i) {
6640-9940
1245 const ListLayout::Role &r = layout->getExistingRole(i);-
1246-
1247 switch (r.type) {-
1248 case
executed 5122 times by 14 tests: case ListLayout::Role::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
ListLayout::Role::String:
executed 5122 times by 14 tests: case ListLayout::Role::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5122
1249 {-
1250 StringOrTranslation *string = getStringProperty(r);-
1251 if (string
stringDescription
TRUEevaluated 5122 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEnever evaluated
)
0-5122
1252 string->~StringOrTranslation();
executed 5122 times by 14 tests: string->~StringOrTranslation();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5122
1253 }-
1254 break;
executed 5122 times by 14 tests: break;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
5122
1255 case
executed 390 times by 4 tests: case ListLayout::Role::List:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
ListLayout::Role::List:
executed 390 times by 4 tests: case ListLayout::Role::List:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
390
1256 {-
1257 ListModel *model = getListProperty(r);-
1258 if (model
modelDescription
TRUEevaluated 214 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
176-214
1259 model->destroy();-
1260 delete model;-
1261 }
executed 214 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
214
1262 }-
1263 break;
executed 390 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
390
1264 case
executed 10 times by 1 test: case ListLayout::Role::QObject:
Executed by:
  • tst_qqmllistmodel
ListLayout::Role::QObject:
executed 10 times by 1 test: case ListLayout::Role::QObject:
Executed by:
  • tst_qqmllistmodel
10
1265 {-
1266 QPointer<QObject> *guard = getGuardProperty(r);-
1267 if (guard
guardDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
2-8
1268 guard->~QPointer();
executed 8 times by 1 test: guard->~QPointer();
Executed by:
  • tst_qqmllistmodel
8
1269 }-
1270 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
10
1271 case
executed 316 times by 2 tests: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
ListLayout::Role::VariantMap:
executed 316 times by 2 tests: case ListLayout::Role::VariantMap:
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
316
1272 {-
1273 QVariantMap *map = getVariantMapProperty(r);-
1274 if (map
mapDescription
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 188 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
128-188
1275 map->~QMap();
executed 128 times by 2 tests: map->~QMap();
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
128
1276 }-
1277 break;
executed 316 times by 2 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
316
1278 case
executed 10 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
ListLayout::Role::DateTime:
executed 10 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
10
1279 {-
1280 QDateTime *dt = getDateTimeProperty(r);-
1281 if (dt
dtDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-10
1282 dt->~QDateTime();
executed 10 times by 1 test: dt->~QDateTime();
Executed by:
  • tst_qqmllistmodel
10
1283 }-
1284 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
10
1285 case
never executed: case ListLayout::Role::Function:
ListLayout::Role::Function:
never executed: case ListLayout::Role::Function:
0
1286 {-
1287 QJSValue *f = getFunctionProperty(r);-
1288 if (f
fDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1289 f->~QJSValue();
never executed: f->~QJSValue();
0
1290 }-
1291 break;
never executed: break;
0
1292 default
executed 4092 times by 6 tests: default:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qtqmlmodules
:
executed 4092 times by 6 tests: default:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qtqmlmodules
4092
1293-
1294 break;
executed 4092 times by 6 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qtqmlmodules
4092
1295 }-
1296 }-
1297-
1298 delete m_objectCache;-
1299 }
executed 6640 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6640
1300-
1301 if (next
nextDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 6640 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
10-6640
1302 next->destroy(nullptr);
executed 10 times by 2 tests: next->destroy(nullptr);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
10
1303 uid = -1;-
1304}
executed 6650 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
6650
1305-
1306int ListElement::setVariantProperty(const ListLayout::Role &role, const QVariant &d)-
1307{-
1308 int roleIndex = -1;-
1309-
1310 switch (role.type) {-
1311 case
executed 1338 times by 5 tests: case ListLayout::Role::Number:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
ListLayout::Role::Number:
executed 1338 times by 5 tests: case ListLayout::Role::Number:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
1338
1312 roleIndex = setDoubleProperty(role, d.toDouble());-
1313 break;
executed 1338 times by 5 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
1338
1314 case
executed 3958 times by 13 tests: case ListLayout::Role::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
ListLayout::Role::String:
executed 3958 times by 13 tests: case ListLayout::Role::String:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3958
1315 if (d.userType() == qMetaTypeId<const QV4::CompiledData::Binding *>()
d.userType() =...::Binding *>()Description
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
FALSEevaluated 3950 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
)
8-3950
1316 roleIndex = setTranslationProperty(role, d.value<const QV4::CompiledData::Binding*>());
executed 8 times by 3 tests: roleIndex = setTranslationProperty(role, d.value<const QV4::CompiledData::Binding*>());
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
8
1317 else-
1318 roleIndex = setStringProperty(role, d.toString());
executed 3950 times by 12 tests: roleIndex = setStringProperty(role, d.toString());
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3950
1319 break;
executed 3958 times by 13 tests: break;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
3958
1320 case
executed 66 times by 3 tests: case ListLayout::Role::Bool:
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
ListLayout::Role::Bool:
executed 66 times by 3 tests: case ListLayout::Role::Bool:
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
66
1321 roleIndex = setBoolProperty(role, d.toBool());-
1322 break;
executed 66 times by 3 tests: break;
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
66
1323 case
executed 34 times by 2 tests: case ListLayout::Role::List:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
ListLayout::Role::List:
executed 34 times by 2 tests: case ListLayout::Role::List:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
34
1324 roleIndex = setListProperty(role, d.value<ListModel *>());-
1325 break;
executed 34 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
34
1326 case
never executed: case ListLayout::Role::VariantMap:
ListLayout::Role::VariantMap:
never executed: case ListLayout::Role::VariantMap:
{
0
1327 QVariantMap map = d.toMap();-
1328 roleIndex = setVariantMapProperty(role, &map);-
1329 }-
1330 break;
never executed: break;
0
1331 case
executed 2 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
ListLayout::Role::DateTime:
executed 2 times by 1 test: case ListLayout::Role::DateTime:
Executed by:
  • tst_qqmllistmodel
2
1332 roleIndex = setDateTimeProperty(role, d.toDateTime());-
1333 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qqmllistmodel
2
1334 case
never executed: case ListLayout::Role::Function:
ListLayout::Role::Function:
never executed: case ListLayout::Role::Function:
0
1335 roleIndex = setFunctionProperty(role, d.value<QJSValue>());-
1336 break;
never executed: break;
0
1337 default
never executed: default:
:
never executed: default:
0
1338 break;
never executed: break;
0
1339 }-
1340-
1341 return
executed 5398 times by 14 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
roleIndex;
executed 5398 times by 14 tests: return roleIndex;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
5398
1342}-
1343-
1344int ListElement::setJsProperty(const ListLayout::Role &role, const QV4::Value &d, QV4::ExecutionEngine *eng)-
1345{-
1346-
1347 int roleIndex = -1;-
1348-
1349 QV4::Scope scope(eng);-
1350-
1351-
1352 if (d.isString()
d.isString()Description
TRUEnever evaluated
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
0-58
1353 QString qstr = d.toQString();-
1354 roleIndex = setStringProperty(role, qstr);-
1355 }
never executed: end of block
else if (d.isNumber()
d.isNumber()Description
TRUEevaluated 40 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
0-40
1356 roleIndex = setDoubleProperty(role, d.asDouble());-
1357 }
executed 40 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (d.as<QV4::ArrayObject>()
d.as<QV4::ArrayObject>()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
4-40
1358 QV4::ScopedArrayObject a(scope, d);-
1359 if (role.type == ListLayout::Role::List
role.type == L...ut::Role::ListDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
2-12
1360 QV4::Scope scope(a->engine());-
1361 QV4::ScopedObject o(scope);-
1362-
1363 ListModel *subModel = new ListModel(role.subLayout, nullptr);-
1364 int arrayLength = a->getLength();-
1365 for (int j=0 ; j < arrayLength
j < arrayLengthDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++j) {
12-24
1366 o = a->get(j);-
1367 subModel->append(o);-
1368 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
1369 roleIndex = setListProperty(role, subModel);-
1370 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
12
1371 qmlWarning(nullptr) << ([]() noexcept -> QString { enum { Size = sizeof(u"" "Can't assign to existing role '%1' of different type [%2 -> %3]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Can't assign to existing role '%1' of different type [%2 -> %3]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qqmllistmodel
qstring_literal_temp;
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qqmllistmodel
}()).arg(role.name).arg(roleTypeName(role.type)).arg(roleTypeName(ListLayout::Role::List));
2
1372 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
2
1373 } else if (d.isBoolean()
d.isBoolean()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-4
1374 roleIndex = setBoolProperty(role, d.booleanValue());-
1375 }
never executed: end of block
else if (d.as<QV4::DateObject>()
d.as<QV4::DateObject>()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-2
1376 QV4::Scoped<QV4::DateObject> dd(scope, d);-
1377 QDateTime dt = dd->toQDateTime();-
1378 roleIndex = setDateTimeProperty(role, dt);-
1379 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else if (d.as<QV4::FunctionObject>()
d.as<QV4::FunctionObject>()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-2
1380 QV4::ScopedFunctionObject f(scope, d);-
1381 QJSValue jsv;-
1382 QJSValuePrivate::setValue(&jsv, eng, f);-
1383 roleIndex = setFunctionProperty(role, jsv);-
1384 }
never executed: end of block
else if (d.isObject()
d.isObject()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-2
1385 QV4::ScopedObject o(scope, d);-
1386 QV4::QObjectWrapper *wrapper = o->as<QV4::QObjectWrapper>();-
1387 if (role.type == ListLayout::Role::QObject
role.type == L...:Role::QObjectDescription
TRUEnever evaluated
FALSEnever evaluated
&& wrapper
wrapperDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1388 QObject *o = wrapper->object();-
1389 roleIndex = setQObjectProperty(role, o);-
1390 }
never executed: end of block
else if (role.type == ListLayout::Role::VariantMap
role.type == L...le::VariantMapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1391 roleIndex = setVariantMapProperty(role, o);-
1392 }
never executed: end of block
0
1393 }
never executed: end of block
else if (d.isNullOrUndefined()
d.isNullOrUndefined()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-2
1394 clearProperty(role);-
1395 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
2
1396-
1397 return
executed 58 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
roleIndex;
executed 58 times by 2 tests: return roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
1398}-
1399-
1400ModelNodeMetaObject::ModelNodeMetaObject(QObject *object, QQmlListModel *model, int elementIndex)-
1401: QQmlOpenMetaObject(object), m_enabled(false), m_model(model), m_elementIndex(elementIndex), m_initialized(false)-
1402{}
executed 660 times by 8 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
660
1403-
1404void ModelNodeMetaObject::initialize()-
1405{-
1406 const int roleCount = m_model->m_listModel->roleCount();-
1407 QVector<QByteArray> properties;-
1408 properties.reserve(roleCount);-
1409 for (int i = 0 ; i < roleCount
i < roleCountDescription
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
; ++i) {
36-104
1410 const ListLayout::Role &role = m_model->m_listModel->getExistingRole(i);-
1411 QByteArray name = role.name.toUtf8();-
1412 properties << name;-
1413 }
executed 104 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
104
1414 type()->createProperties(properties);-
1415 updateValues();-
1416 m_enabled = true;-
1417}
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
36
1418-
1419ModelNodeMetaObject::~ModelNodeMetaObject()-
1420{-
1421}-
1422-
1423QAbstractDynamicMetaObject *ModelNodeMetaObject::toDynamicMetaObject(QObject *object)-
1424{-
1425 if (!m_initialized
!m_initializedDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 412 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
36-412
1426 m_initialized = true;-
1427 initialize();-
1428 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
36
1429 return
executed 448 times by 1 test: return QQmlOpenMetaObject::toDynamicMetaObject(object);
Executed by:
  • tst_qqmllistmodel
QQmlOpenMetaObject::toDynamicMetaObject(object);
executed 448 times by 1 test: return QQmlOpenMetaObject::toDynamicMetaObject(object);
Executed by:
  • tst_qqmllistmodel
448
1430}-
1431-
1432ModelNodeMetaObject *ModelNodeMetaObject::get(QObject *obj)-
1433{-
1434 QObjectPrivate *op = QObjectPrivate::get(obj);-
1435 return
executed 428 times by 4 tests: return static_cast<ModelNodeMetaObject*>(op->metaObject);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
static_cast<ModelNodeMetaObject*>(op->metaObject);
executed 428 times by 4 tests: return static_cast<ModelNodeMetaObject*>(op->metaObject);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
428
1436}-
1437-
1438void ModelNodeMetaObject::updateValues()-
1439{-
1440 const int roleCount = m_model->m_listModel->roleCount();-
1441 if (!m_initialized
!m_initializedDescription
TRUEnever evaluated
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-36
1442 if (roleCount
roleCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1443 int *changedRoles = 0; changedRoles = static_cast<int*>(-
1444 __builtin_alloca (-
1445 roleCount * sizeof(int)-
1446 )-
1447 );-
1448 for (int i = 0; i < roleCount
i < roleCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1449 changedRoles[i] = i;
never executed: changedRoles[i] = i;
0
1450 emitDirectNotifies(changedRoles, roleCount);-
1451 }
never executed: end of block
0
1452 return;
never executed: return;
0
1453 }-
1454 for (int i=0 ; i < roleCount
i < roleCountDescription
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
; ++i) {
36-104
1455 const ListLayout::Role &role = m_model->m_listModel->getExistingRole(i);-
1456 QByteArray name = role.name.toUtf8();-
1457 const QVariant &data = m_model->data(m_elementIndex, i);-
1458 setValue(name, data, role.type == ListLayout::Role::List);-
1459 }
executed 104 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
104
1460}
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
36
1461-
1462void ModelNodeMetaObject::updateValues(const QVector<int> &roles)-
1463{-
1464 if (!m_initialized
!m_initializedDescription
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
18-26
1465 emitDirectNotifies(roles.constData(), roles.count());-
1466 return;
executed 18 times by 3 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
18
1467 }-
1468 int roleCount = roles.count();-
1469 for (int i=0 ; i < roleCount
i < roleCountDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
; ++i) {
24-26
1470 int roleIndex = roles.at(i);-
1471 const ListLayout::Role &role = m_model->m_listModel->getExistingRole(roleIndex);-
1472 QByteArray name = role.name.toUtf8();-
1473 const QVariant &data = m_model->data(m_elementIndex, roleIndex);-
1474 setValue(name, data, role.type == ListLayout::Role::List);-
1475 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
24
1476}
executed 26 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
26
1477-
1478void ModelNodeMetaObject::propertyWritten(int index)-
1479{-
1480 if (!m_enabled
!m_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1481 return;
never executed: return;
0
1482-
1483 QString propName = QString::fromUtf8(name(index));-
1484 const QVariant value = this->value(index);-
1485-
1486 QV4::Scope scope(m_model->engine());-
1487 QV4::ScopedValue v(scope, scope.engine->fromVariant(value));-
1488-
1489 int roleIndex = m_model->m_listModel->setExistingProperty(m_elementIndex, propName, v, scope.engine);-
1490 if (roleIndex != -1
roleIndex != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1491 m_model->emitItemsChanged(m_elementIndex, 1, QVector<int>(1, roleIndex));
never executed: m_model->emitItemsChanged(m_elementIndex, 1, QVector<int>(1, roleIndex));
0
1492}
never executed: end of block
0
1493-
1494-
1495void ModelNodeMetaObject::emitDirectNotifies(const int *changedRoles, int roleCount)-
1496{-
1497 ((!m_initialized) ? static_cast<void>(0) : qt_assert("!m_initialized", __FILE__, 1552));-
1498 QQmlData *ddata = QQmlData::get(object(), false);-
1499 if (!ddata
!ddataDescription
TRUEnever evaluated
FALSEevaluated 18 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
)
0-18
1500 return;
never executed: return;
0
1501-
1502 if (!qmlEngine(m_model)
!qmlEngine(m_model)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
)
4-14
1503 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qqmllistmodelworkerscript
4
1504 for (int i = 0; i < roleCount
i < roleCountDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
; ++i) {
14
1505 const int changedRole = changedRoles[i];-
1506 QQmlNotifier::notify(ddata, changedRole);-
1507 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
14
1508}
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
14
1509-
1510namespace QV4 {-
1511-
1512bool ModelObject::virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver)-
1513{-
1514 if (!id.isString()
!id.isString()Description
TRUEnever evaluated
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-58
1515 return
never executed: return Object::virtualPut(m, id, value, receiver);
Object::virtualPut(m, id, value, receiver);
never executed: return Object::virtualPut(m, id, value, receiver);
0
1516 QString propName = id.toQString();-
1517-
1518 ModelObject *that = static_cast<ModelObject*>(m);-
1519-
1520 ExecutionEngine *eng = that->engine();-
1521 const int elementIndex = that->d()->elementIndex();-
1522 int roleIndex = that->d()->m_model->m_listModel->setExistingProperty(elementIndex, propName, value, eng);-
1523 if (roleIndex != -1
roleIndex != -1Description
TRUEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
4-54
1524 that->d()->m_model->emitItemsChanged(elementIndex, 1, QVector<int>(1, roleIndex));
executed 54 times by 2 tests: that->d()->m_model->emitItemsChanged(elementIndex, 1, QVector<int>(1, roleIndex));
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
54
1525-
1526 ModelNodeMetaObject *mo = ModelNodeMetaObject::get(that->object());-
1527 if (mo->initialized()
mo->initialized()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
4-54
1528 mo->emitPropertyNotification(propName.toUtf8());
executed 4 times by 1 test: mo->emitPropertyNotification(propName.toUtf8());
Executed by:
  • tst_qqmllistmodel
4
1529 return
executed 58 times by 2 tests: return true;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
true;
executed 58 times by 2 tests: return true;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
1530}-
1531-
1532ReturnedValue ModelObject::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)-
1533{-
1534 if (!id.isString()
!id.isString()Description
TRUEnever evaluated
FALSEevaluated 852 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
)
0-852
1535 return
never executed: return QObjectWrapper::virtualGet(m, id, receiver, hasProperty);
QObjectWrapper::virtualGet(m, id, receiver, hasProperty);
never executed: return QObjectWrapper::virtualGet(m, id, receiver, hasProperty);
0
1536-
1537 const ModelObject *that = static_cast<const ModelObject*>(m);-
1538 Scope scope(that);-
1539 ScopedString name(scope, id.asStringOrSymbol());-
1540 const ListLayout::Role *role = that->d()->m_model->m_listModel->getExistingRole(name);-
1541 if (!role
!roleDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 850 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
)
2-850
1542 return
executed 2 times by 1 test: return QObjectWrapper::virtualGet(m, id, receiver, hasProperty);
Executed by:
  • tst_qqmllistmodel
QObjectWrapper::virtualGet(m, id, receiver, hasProperty);
executed 2 times by 1 test: return QObjectWrapper::virtualGet(m, id, receiver, hasProperty);
Executed by:
  • tst_qqmllistmodel
2
1543 if (hasProperty
hasPropertyDescription
TRUEnever evaluated
FALSEevaluated 850 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
)
0-850
1544 *
never executed: *hasProperty = true;
hasProperty = true;
never executed: *hasProperty = true;
0
1545-
1546 if (QQmlEngine *qmlEngine = that->engine()->qmlEngine()
QQmlEngine *qm...)->qmlEngine()Description
TRUEevaluated 736 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 114 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
114-736
1547 QQmlEnginePrivate *ep = QQmlEnginePrivate::get(qmlEngine);-
1548 if (ep
epDescription
TRUEevaluated 736 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEnever evaluated
&& ep->propertyCapture
ep->propertyCaptureDescription
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
FALSEevaluated 678 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
)
0-736
1549 ep->propertyCapture->captureProperty(that->object(), -1, role->index,
executed 58 times by 3 tests: ep->propertyCapture->captureProperty(that->object(), -1, role->index, QQmlPropertyCapture::OnlyOnce, false);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
58
1550 QQmlPropertyCapture::OnlyOnce, false);
executed 58 times by 3 tests: ep->propertyCapture->captureProperty(that->object(), -1, role->index, QQmlPropertyCapture::OnlyOnce, false);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
58
1551 }
executed 736 times by 8 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
736
1552-
1553 const int elementIndex = that->d()->elementIndex();-
1554 QVariant value = that->d()->m_model->data(elementIndex, role->index);-
1555 return
executed 850 times by 8 tests: return that->engine()->fromVariant(value);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
that->engine()->fromVariant(value);
executed 850 times by 8 tests: return that->engine()->fromVariant(value);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
850
1556}-
1557-
1558void ModelObject::virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)-
1559{-
1560 ModelObject *that = static_cast<ModelObject*>(m);-
1561 ExecutionEngine *v4 = that->engine();-
1562 name->setM(nullptr);-
1563 *index = -
1564 (0x7fffffff * 2U + 1U)-
1565 ;-
1566 if (it->arrayIndex < uint(that->d()->m_model->m_listModel->roleCount())
it->arrayIndex...->roleCount())Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
4-14
1567 Scope scope(that->engine());-
1568 const ListLayout::Role &role = that->d()->m_model->m_listModel->getExistingRole(it->arrayIndex);-
1569 ++it->arrayIndex;-
1570 ScopedString roleName(scope, v4->newString(role.name));-
1571 name->setM(roleName->d());-
1572 *attributes = QV4::Attr_Data;-
1573 QVariant value = that->d()->m_model->data(that->d()->elementIndex(), role.index);-
1574 p->value = v4->fromVariant(value);-
1575 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_qqmllistmodel
14
1576 }-
1577-
1578-
1579-
1580 QV4::Object::virtualAdvanceIterator(m, it, name, index, p, attributes);-
1581}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
4
1582-
1583const QV4::VTable ModelObject::static_vtbl = { (std::is_same<ModelObject::SuperClass, Object>::value) ? nullptr : &ModelObject::SuperClass::static_vtbl, (sizeof(ModelObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ModelObject::Data) + (ModelObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ModelObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ModelObject::IsExecutionContext, ModelObject::IsString, ModelObject::IsObject, ModelObject::IsFunctionObject, ModelObject::IsErrorObject, ModelObject::IsArrayData, ModelObject::IsStringOrSymbol, ModelObject::MyType, { 0, 0, 0, 0 }, "ModelObject", ModelObject::virtualDestroy, ModelObject::Data::markObjects, ModelObject::virtualIsEqualTo, ModelObject::virtualGet, ModelObject::virtualPut, ModelObject::virtualDeleteProperty, ModelObject::virtualHasProperty, ModelObject::virtualGetOwnProperty, ModelObject::virtualDefineOwnProperty, ModelObject::virtualIsExtensible, ModelObject::virtualPreventExtensions, ModelObject::virtualGetPrototypeOf, ModelObject::virtualSetPrototypeOf, ModelObject::virtualGetLength, ModelObject::virtualAdvanceIterator, ModelObject::virtualInstanceOf, ModelObject::virtualCall, ModelObject::virtualCallAsConstructor, };-
1584-
1585}-
1586-
1587DynamicRoleModelNode::DynamicRoleModelNode(QQmlListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this))-
1588{-
1589 setNodeUpdatesEnabled(true);-
1590}
executed 2238 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
2238
1591-
1592DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQmlListModel *owner)-
1593{-
1594 DynamicRoleModelNode *object = new DynamicRoleModelNode(owner, uidCounter.fetchAndAddOrdered(1));-
1595 QVector<int> roles;-
1596 object->updateValues(obj, roles);-
1597 return
executed 1514 times by 2 tests: return object;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
object;
executed 1514 times by 2 tests: return object;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
1514
1598}-
1599-
1600QVector<int> DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target)-
1601{-
1602 QVector<int> changedRoles;-
1603 for (int i = 0; i < src->m_meta->count()
i < src->m_meta->count()Description
TRUEevaluated 1116 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 824 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
824-1116
1604 const QByteArray &name = src->m_meta->name(i);-
1605 QVariant value = src->m_meta->value(i);-
1606-
1607 QQmlListModel *srcModel = qobject_cast<QQmlListModel *>(value.value<QObject *>());-
1608 QQmlListModel *targetModel = qobject_cast<QQmlListModel *>(target->m_meta->value(i).value<QObject *>());-
1609-
1610 bool modelHasChanges = false;-
1611 if (srcModel
srcModelDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1034 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
82-1034
1612 if (targetModel == nullptr
targetModel == nullptrDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
26-56
1613 targetModel = QQmlListModel::createWithOwner(target->m_owner);
executed 56 times by 1 test: targetModel = QQmlListModel::createWithOwner(target->m_owner);
Executed by:
  • tst_qqmllistmodelworkerscript
56
1614-
1615 modelHasChanges = QQmlListModel::sync(srcModel, targetModel);-
1616-
1617 QObject *targetModelObject = targetModel;-
1618 value = QVariant::fromValue(targetModelObject);-
1619 }
executed 82 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
else if (targetModel
targetModelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1032 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
2-1032
1620 delete targetModel;-
1621 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
2
1622-
1623 if (target->setValue(name, value)
target->setValue(name, value)Description
TRUEevaluated 944 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
|| modelHasChanges
modelHasChangesDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 158 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
14-944
1624 changedRoles << target->m_owner->m_roles.indexOf(QString::fromUtf8(name));
executed 958 times by 1 test: changedRoles << target->m_owner->m_roles.indexOf(QString::fromUtf8(name));
Executed by:
  • tst_qqmllistmodelworkerscript
958
1625 }
executed 1116 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
1116
1626 return
executed 824 times by 1 test: return changedRoles;
Executed by:
  • tst_qqmllistmodelworkerscript
changedRoles;
executed 824 times by 1 test: return changedRoles;
Executed by:
  • tst_qqmllistmodelworkerscript
824
1627}-
1628-
1629void DynamicRoleModelNode::updateValues(const QVariantMap &object, QVector<int> &roles)-
1630{-
1631 for (auto it = object.cbegin(), end = object.cend(); it != end
it != endDescription
TRUEevaluated 2284 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1652 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++it) {
1652-2284
1632 const QString &key = it.key();-
1633-
1634 int roleIndex = m_owner->m_roles.indexOf(key);-
1635 if (roleIndex == -1
roleIndex == -1Description
TRUEevaluated 1518 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 766 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
766-1518
1636 roleIndex = m_owner->m_roles.count();-
1637 m_owner->m_roles.append(key);-
1638 }
executed 1518 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
1518
1639-
1640 QVariant value = it.value();-
1641-
1642-
1643-
1644 if (value.userType() == qMetaTypeId<QJSValue>()
value.userType...Id<QJSValue>()Description
TRUEnever evaluated
FALSEevaluated 2284 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-2284
1645 value = value.value<QJSValue>().toVariant();
never executed: value = value.value<QJSValue>().toVariant();
0
1646-
1647 if (value.type() == QVariant::List
value.type() == QVariant::ListDescription
TRUEevaluated 164 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2120 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
164-2120
1648 QQmlListModel *subModel = QQmlListModel::createWithOwner(m_owner);-
1649-
1650 QVariantList subArray = value.toList();-
1651 QVariantList::const_iterator subIt = subArray.cbegin();-
1652 QVariantList::const_iterator subEnd = subArray.cend();-
1653 while (subIt != subEnd
subIt != subEndDescription
TRUEevaluated 414 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 164 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
164-414
1654 const QVariantMap &subObject = subIt->toMap();-
1655 subModel->m_modelObjects.append(DynamicRoleModelNode::create(subObject, subModel));-
1656 ++subIt;-
1657 }
executed 414 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
414
1658-
1659 QObject *subModelObject = subModel;-
1660 value = QVariant::fromValue(subModelObject);-
1661 }
executed 164 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
164
1662-
1663 const QByteArray &keyUtf8 = key.toUtf8();-
1664-
1665 QQmlListModel *existingModel = qobject_cast<QQmlListModel *>(m_meta->value(keyUtf8).value<QObject *>());-
1666 delete existingModel;-
1667-
1668 if (m_meta->setValue(keyUtf8, value)
m_meta->setVal...eyUtf8, value)Description
TRUEevaluated 2190 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 94 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
94-2190
1669 roles << roleIndex;
executed 2190 times by 2 tests: roles << roleIndex;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
2190
1670 }
executed 2284 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
2284
1671}
executed 1652 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
1652
1672-
1673DynamicRoleModelNodeMetaObject::DynamicRoleModelNodeMetaObject(DynamicRoleModelNode *object)-
1674 : QQmlOpenMetaObject(object), m_enabled(false), m_owner(object)-
1675{-
1676}
executed 2238 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
2238
1677-
1678DynamicRoleModelNodeMetaObject::~DynamicRoleModelNodeMetaObject()-
1679{-
1680 for (int i=0 ; i < count()
i < count()Description
TRUEevaluated 3096 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2238 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i) {
2238-3096
1681 QQmlListModel *subModel = qobject_cast<QQmlListModel *>(value(i).value<QObject *>());-
1682 delete subModel;-
1683 }
executed 3096 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
3096
1684}
executed 2238 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
2238
1685-
1686void DynamicRoleModelNodeMetaObject::propertyWrite(int index)-
1687{-
1688 if (!m_enabled
!m_enabledDescription
TRUEnever evaluated
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-58
1689 return;
never executed: return;
0
1690-
1691 QVariant v = value(index);-
1692 QQmlListModel *model = qobject_cast<QQmlListModel *>(v.value<QObject *>());-
1693 delete model;-
1694}
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
1695-
1696void DynamicRoleModelNodeMetaObject::propertyWritten(int index)-
1697{-
1698 if (!m_enabled
!m_enabledDescription
TRUEnever evaluated
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
0-58
1699 return;
never executed: return;
0
1700-
1701 QQmlListModel *parentModel = m_owner->m_owner;-
1702-
1703 QVariant v = value(index);-
1704-
1705-
1706-
1707 if (v.userType() == qMetaTypeId<QJSValue>()
v.userType() =...Id<QJSValue>()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
12-46
1708 v= v.value<QJSValue>().toVariant();
executed 12 times by 2 tests: v= v.value<QJSValue>().toVariant();
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
1709-
1710 if (v.type() == QVariant::List
v.type() == QVariant::ListDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-46
1711 QQmlListModel *subModel = QQmlListModel::createWithOwner(parentModel);-
1712-
1713 QVariantList subArray = v.toList();-
1714 QVariantList::const_iterator subIt = subArray.cbegin();-
1715 QVariantList::const_iterator subEnd = subArray.cend();-
1716 while (subIt != subEnd
subIt != subEndDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-24
1717 const QVariantMap &subObject = subIt->toMap();-
1718 subModel->m_modelObjects.append(DynamicRoleModelNode::create(subObject, subModel));-
1719 ++subIt;-
1720 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
1721-
1722 QObject *subModelObject = subModel;-
1723 v = QVariant::fromValue(subModelObject);-
1724-
1725 setValue(index, v);-
1726 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
1727-
1728 int elementIndex = parentModel->m_modelObjects.indexOf(m_owner);-
1729 if (elementIndex != -1
elementIndex != -1Description
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-58
1730 int roleIndex = parentModel->m_roles.indexOf(QString::fromLatin1(name(index).constData()));-
1731 if (roleIndex != -1
roleIndex != -1Description
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
)
0-58
1732 parentModel->emitItemsChanged(elementIndex, 1, QVector<int>(1, roleIndex));
executed 58 times by 2 tests: parentModel->emitItemsChanged(elementIndex, 1, QVector<int>(1, roleIndex));
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
1733 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
1734}
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
58
1735QQmlListModel::QQmlListModel(QObject *parent)-
1736: QAbstractListModel(parent)-
1737{-
1738 m_mainThread = true;-
1739 m_primary = true;-
1740 m_agent = nullptr;-
1741 m_dynamicRoles = false;-
1742-
1743 m_layout = new ListLayout;-
1744 m_listModel = new ListModel(m_layout, this);-
1745-
1746 m_engine = nullptr;-
1747}
executed 2456 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
2456
1748-
1749QQmlListModel::QQmlListModel(const QQmlListModel *owner, ListModel *data, QV4::ExecutionEngine *engine, QObject *parent)-
1750: QAbstractListModel(parent)-
1751{-
1752 m_mainThread = owner->m_mainThread;-
1753 m_primary = false;-
1754 m_agent = owner->m_agent;-
1755-
1756 ((owner->m_dynamicRoles == false) ? static_cast<void>(0) : qt_assert("owner->m_dynamicRoles == false", __FILE__, 1904));-
1757 m_dynamicRoles = false;-
1758 m_layout = nullptr;-
1759 m_listModel = data;-
1760-
1761 m_engine = engine;-
1762 m_compilationUnit = owner->m_compilationUnit;-
1763}
executed 138 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
138
1764-
1765QQmlListModel::QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent)-
1766: QAbstractListModel(agent)-
1767{-
1768 m_mainThread = false;-
1769 m_primary = true;-
1770 m_agent = agent;-
1771 m_dynamicRoles = orig->m_dynamicRoles;-
1772-
1773 m_layout = new ListLayout(orig->m_layout);-
1774 m_listModel = new ListModel(m_layout, this);-
1775-
1776 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 468 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 436 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
)
436-468
1777 sync(orig, this);
executed 468 times by 1 test: sync(orig, this);
Executed by:
  • tst_qqmllistmodelworkerscript
468
1778 else-
1779 ListModel::sync(orig->m_listModel, m_listModel);
executed 436 times by 2 tests: ListModel::sync(orig->m_listModel, m_listModel);
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
436
1780-
1781 m_engine = nullptr;-
1782 m_compilationUnit = orig->m_compilationUnit;-
1783}
executed 904 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
904
1784-
1785QQmlListModel::~QQmlListModel()-
1786{-
1787 qDeleteAll(m_modelObjects);-
1788-
1789 if (m_primary
m_primaryDescription
TRUEevaluated 3352 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 138 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickrepeater
) {
138-3352
1790 m_listModel->destroy();-
1791 delete m_listModel;-
1792-
1793 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 2378 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 974 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
&& m_agent
m_agentDescription
TRUEevaluated 934 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1444 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
934-2378
1794 m_agent->modelDestroyed();-
1795 m_agent->release();-
1796 }
executed 934 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
934
1797 }
executed 3352 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3352
1798-
1799 m_listModel = nullptr;-
1800-
1801 delete m_layout;-
1802 m_layout = nullptr;-
1803}
executed 3490 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3490
1804-
1805QQmlListModel *QQmlListModel::createWithOwner(QQmlListModel *newOwner)-
1806{-
1807 QQmlListModel *model = new QQmlListModel;-
1808-
1809 model->m_mainThread = newOwner->m_mainThread;-
1810 model->m_engine = newOwner->m_engine;-
1811 model->m_agent = newOwner->m_agent;-
1812 model->m_dynamicRoles = newOwner->m_dynamicRoles;-
1813-
1814 if (model->m_mainThread
model->m_mainThreadDescription
TRUEevaluated 160 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
&& model->m_agent
model->m_agentDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 130 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
30-160
1815 model->m_agent->addref();
executed 30 times by 1 test: model->m_agent->addref();
Executed by:
  • tst_qqmllistmodelworkerscript
30
1816-
1817 QQmlEngine::setContextForObject(model, QQmlEngine::contextForObject(newOwner));-
1818-
1819 return
executed 232 times by 2 tests: return model;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
model;
executed 232 times by 2 tests: return model;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
232
1820}-
1821-
1822QV4::ExecutionEngine *QQmlListModel::engine() const-
1823{-
1824 if (m_engine == nullptr
m_engine == nullptrDescription
TRUEevaluated 640 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 12779 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
640-12779
1825 m_engine = qmlEngine(this)->handle();-
1826 }
executed 640 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
640
1827-
1828 return
executed 13419 times by 13 tests: return m_engine;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
m_engine;
executed 13419 times by 13 tests: return m_engine;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
13419
1829}-
1830-
1831bool QQmlListModel::sync(QQmlListModel *src, QQmlListModel *target)-
1832{-
1833 ((src->m_dynamicRoles && target->m_dynamicRoles) ? static_cast<void>(0) : qt_assert("src->m_dynamicRoles && target->m_dynamicRoles", __FILE__, 1981));-
1834-
1835 bool hasChanges = false;-
1836-
1837 target->m_roles = src->m_roles;-
1838-
1839-
1840 QHash<int, ElementSync> elementHash;-
1841 for (int i = 0 ; i < target->m_modelObjects.count()
i < target->m_...bjects.count()Description
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
128-1018
1842 DynamicRoleModelNode *e = target->m_modelObjects.at(i);-
1843 int uid = e->getUid();-
1844 ElementSync sync;-
1845 sync.target = e;-
1846 sync.targetIndex = i;-
1847 elementHash.insert(uid, sync);-
1848 }
executed 128 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
128
1849 for (int i = 0 ; i < src->m_modelObjects.count()
i < src->m_mod...bjects.count()Description
TRUEevaluated 824 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
824-1018
1850 DynamicRoleModelNode *e = src->m_modelObjects.at(i);-
1851 int uid = e->getUid();-
1852-
1853 QHash<int, ElementSync>::iterator it = elementHash.find(uid);-
1854 if (it == elementHash.end()
it == elementHash.end()Description
TRUEevaluated 724 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
100-724
1855 ElementSync sync;-
1856 sync.src = e;-
1857 sync.srcIndex = i;-
1858 elementHash.insert(uid, sync);-
1859 }
executed 724 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
else {
724
1860 ElementSync &sync = it.value();-
1861 sync.src = e;-
1862 sync.srcIndex = i;-
1863 }
executed 100 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
100
1864 }-
1865-
1866-
1867 int rowsRemoved = 0;-
1868 for (int i = 0 ; i < target->m_modelObjects.count()
i < target->m_...bjects.count()Description
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
128-1018
1869 DynamicRoleModelNode *element = target->m_modelObjects.at(i);-
1870 ElementSync &s = elementHash.find(element->getUid()).value();-
1871 ((s.targetIndex >= 0) ? static_cast<void>(0) : qt_assert("s.targetIndex >= 0", __FILE__, 2019));-
1872-
1873 s.targetIndex -= rowsRemoved;-
1874 if (s.src == nullptr
s.src == nullptrDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
28-100
1875 ((s.targetIndex == i) ? static_cast<void>(0) : qt_assert("s.targetIndex == i", __FILE__, 2023));-
1876 hasChanges = true;-
1877 target->beginRemoveRows(QModelIndex(), i, i);-
1878 target->m_modelObjects.remove(i, 1);-
1879 target->endRemoveRows();-
1880 delete s.target;-
1881 ++rowsRemoved;-
1882 --i;-
1883 continue;
executed 28 times by 1 test: continue;
Executed by:
  • tst_qqmllistmodelworkerscript
28
1884 }-
1885 }
executed 100 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
100
1886-
1887-
1888 target->m_modelObjects.clear();-
1889 for (int i = 0 ; i < src->m_modelObjects.count()
i < src->m_mod...bjects.count()Description
TRUEevaluated 824 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
824-1018
1890 DynamicRoleModelNode *element = src->m_modelObjects.at(i);-
1891 ElementSync &s = elementHash.find(element->getUid()).value();-
1892 ((s.srcIndex >= 0) ? static_cast<void>(0) : qt_assert("s.srcIndex >= 0", __FILE__, 2040));-
1893 DynamicRoleModelNode *targetElement = s.target;-
1894 if (targetElement == nullptr
targetElement == nullptrDescription
TRUEevaluated 724 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
100-724
1895 targetElement = new DynamicRoleModelNode(target, element->getUid());-
1896 }
executed 724 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
724
1897 s.changedRoles = DynamicRoleModelNode::sync(element, targetElement);-
1898 target->m_modelObjects.append(targetElement);-
1899 }
executed 824 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
824
1900-
1901-
1902-
1903-
1904-
1905-
1906 int rowsInserted = 0;-
1907 for (int i = 0 ; i < target->m_modelObjects.count()
i < target->m_...bjects.count()Description
TRUEevaluated 824 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
; ++i) {
824-1018
1908 DynamicRoleModelNode *element = target->m_modelObjects.at(i);-
1909 ElementSync &s = elementHash.find(element->getUid()).value();-
1910 ((s.srcIndex >= 0) ? static_cast<void>(0) : qt_assert("s.srcIndex >= 0", __FILE__, 2058));-
1911 s.srcIndex += rowsInserted;-
1912 if (s.srcIndex != s.targetIndex
s.srcIndex != s.targetIndexDescription
TRUEevaluated 724 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
100-724
1913 if (s.targetIndex == -1
s.targetIndex == -1Description
TRUEevaluated 724 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-724
1914 target->beginInsertRows(QModelIndex(), i, i);-
1915 target->endInsertRows();-
1916 }
executed 724 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
else {
724
1917 target->beginMoveRows(QModelIndex(), i, i, QModelIndex(), s.srcIndex);-
1918 target->endMoveRows();-
1919 }
never executed: end of block
0
1920 hasChanges = true;-
1921 ++rowsInserted;-
1922 }
executed 724 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
724
1923 if (s.targetIndex != -1
s.targetIndex != -1Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 724 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
&& !s.changedRoles.isEmpty()
!s.changedRoles.isEmpty()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
38-724
1924 QModelIndex idx = target->createIndex(i, 0);-
1925 target->dataChanged(idx, idx, s.changedRoles);-
1926 hasChanges = true;-
1927 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
38
1928 }
executed 824 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
824
1929 return
executed 1018 times by 1 test: return hasChanges;
Executed by:
  • tst_qqmllistmodelworkerscript
hasChanges;
executed 1018 times by 1 test: return hasChanges;
Executed by:
  • tst_qqmllistmodelworkerscript
1018
1930}-
1931-
1932void QQmlListModel::emitItemsChanged(int index, int count, const QVector<int> &roles)-
1933{-
1934 if (count <= 0
count <= 0Description
TRUEnever evaluated
FALSEevaluated 458 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
)
0-458
1935 return;
never executed: return;
0
1936-
1937 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 252 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
FALSEevaluated 206 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
206-252
1938 dataChanged(createIndex(index, 0), createIndex(index + count - 1, 0), roles);
executed 252 times by 3 tests: dataChanged(createIndex(index, 0), createIndex(index + count - 1, 0), roles);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
;
252
1939}
executed 458 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
458
1940-
1941void QQmlListModel::emitItemsAboutToBeInserted(int index, int count)-
1942{-
1943 ((index >= 0 && count >= 0) ? static_cast<void>(0) : qt_assert("index >= 0 && count >= 0", __FILE__, 2091));-
1944 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 2224 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 1098 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
)
1098-2224
1945 beginInsertRows(QModelIndex(), index, index + count - 1);
executed 2224 times by 9 tests: beginInsertRows(QModelIndex(), index, index + count - 1);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
2224
1946}
executed 3322 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
3322
1947-
1948void QQmlListModel::emitItemsInserted()-
1949{-
1950 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 2224 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 1098 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
) {
1098-2224
1951 endInsertRows();-
1952 countChanged();-
1953 }
executed 2224 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
2224
1954}
executed 3322 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
3322
1955-
1956QQmlListModelWorkerAgent *QQmlListModel::agent()-
1957{-
1958 if (m_agent
m_agentDescription
TRUEevaluated 952 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
FALSEevaluated 904 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
)
904-952
1959 return
executed 952 times by 2 tests: return m_agent;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
m_agent;
executed 952 times by 2 tests: return m_agent;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
952
1960-
1961 m_agent = new QQmlListModelWorkerAgent(this);-
1962 return
executed 904 times by 2 tests: return m_agent;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
m_agent;
executed 904 times by 2 tests: return m_agent;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
904
1963}-
1964-
1965QModelIndex QQmlListModel::index(int row, int column, const QModelIndex &parent) const-
1966{-
1967 return
executed 10815 times by 9 tests: return row >= 0 && row < count() && column == 0 && !parent.isValid() ? createIndex(row, column) : QModelIndex();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
row >= 0 && row < count() && column == 0 && !parent.isValid()
executed 10815 times by 9 tests: return row >= 0 && row < count() && column == 0 && !parent.isValid() ? createIndex(row, column) : QModelIndex();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10815
1968 ? createIndex(row, column)
executed 10815 times by 9 tests: return row >= 0 && row < count() && column == 0 && !parent.isValid() ? createIndex(row, column) : QModelIndex();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10815
1969 : QModelIndex();
executed 10815 times by 9 tests: return row >= 0 && row < count() && column == 0 && !parent.isValid() ? createIndex(row, column) : QModelIndex();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10815
1970}-
1971-
1972int QQmlListModel::rowCount(const QModelIndex &parent) const-
1973{-
1974 return
executed 18716 times by 12 tests: return !parent.isValid() ? count() : 0;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
!parent.isValid() ? count() : 0;
executed 18716 times by 12 tests: return !parent.isValid() ? count() : 0;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
18716
1975}-
1976-
1977QVariant QQmlListModel::data(const QModelIndex &index, int role) const-
1978{-
1979 return
executed 10503 times by 9 tests: return data(index.row(), role);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
data(index.row(), role);
executed 10503 times by 9 tests: return data(index.row(), role);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
10503
1980}-
1981-
1982bool QQmlListModel::setData(const QModelIndex &index, const QVariant &value, int role)-
1983{-
1984 const int row = index.row();-
1985 if (row >= count()
row >= count()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
|| row < 0
row < 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
0-4
1986 return
never executed: return false;
false;
never executed: return false;
0
1987-
1988 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-4
1989 const QByteArray property = m_roles.at(role).toUtf8();-
1990 if (m_modelObjects[row]->setValue(property, value)
m_modelObjects...operty, value)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1991 emitItemsChanged(row, 1, QVector<int>(1, role));-
1992 return
never executed: return true;
true;
never executed: return true;
0
1993 }-
1994 }
never executed: end of block
else {
0
1995 const ListLayout::Role &r = m_listModel->getExistingRole(role);-
1996 const int roleIndex = m_listModel->setOrCreateProperty(row, r.name, value);-
1997 if (roleIndex != -1
roleIndex != -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-4
1998 emitItemsChanged(row, 1, QVector<int>(1, role));-
1999 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qqmllistmodel
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qqmllistmodel
4
2000 }-
2001 }
never executed: end of block
0
2002-
2003 return
never executed: return false;
false;
never executed: return false;
0
2004}-
2005-
2006QVariant QQmlListModel::data(int index, int role) const-
2007{-
2008 QVariant v;-
2009-
2010 if (index >= count()
index >= count()Description
TRUEnever evaluated
FALSEevaluated 11687 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
|| index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 11687 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
0-11687
2011 return
never executed: return v;
v;
never executed: return v;
0
2012-
2013 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 11585 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
102-11585
2014 v = m_modelObjects[index]->getValue(m_roles[role]);
executed 102 times by 2 tests: v = m_modelObjects[index]->getValue(m_roles[role]);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
102
2015 else-
2016 v = m_listModel->getProperty(index, role, this, engine());
executed 11585 times by 13 tests: v = m_listModel->getProperty(index, role, this, engine());
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
11585
2017-
2018 return
executed 11687 times by 13 tests: return v;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
v;
executed 11687 times by 13 tests: return v;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
11687
2019}-
2020-
2021QHash<int, QByteArray> QQmlListModel::roleNames() const-
2022{-
2023 QHash<int, QByteArray> roleNames;-
2024-
2025 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 734 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
) {
88-734
2026 for (int i = 0 ; i < m_roles.count()
i < m_roles.count()Description
TRUEevaluated 300 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 88 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i)
88-300
2027 roleNames.insert(i, m_roles.at(i).toUtf8());
executed 300 times by 2 tests: roleNames.insert(i, m_roles.at(i).toUtf8());
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
300
2028 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
88
2029 for (int i = 0 ; i < m_listModel->roleCount()
i < m_listModel->roleCount()Description
TRUEevaluated 1128 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 734 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
; ++i) {
734-1128
2030 const ListLayout::Role &r = m_listModel->getExistingRole(i);-
2031 roleNames.insert(i, r.name.toUtf8());-
2032 }
executed 1128 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
1128
2033 }
executed 734 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
734
2034-
2035 return
executed 822 times by 11 tests: return roleNames;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
roleNames;
executed 822 times by 11 tests: return roleNames;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
822
2036}-
2037void QQmlListModel::setDynamicRoles(bool enableDynamicRoles)-
2038{-
2039 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 1454 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
&& m_agent == nullptr
m_agent == nullptrDescription
TRUEevaluated 1454 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEnever evaluated
) {
0-1454
2040 if (enableDynamicRoles
enableDynamicRolesDescription
TRUEevaluated 748 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 706 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
706-748
2041 if (m_layout->roleCount()
m_layout->roleCount()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 746 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
2-746
2042 qmlWarning(this) << tr("unable to enable dynamic roles as this model is not empty");
executed 2 times by 1 test: qmlWarning(this) << tr("unable to enable dynamic roles as this model is not empty");
Executed by:
  • tst_qqmllistmodel
2
2043 else-
2044 m_dynamicRoles = true;
executed 746 times by 2 tests: m_dynamicRoles = true;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
746
2045 } else {-
2046 if (m_roles.count()
m_roles.count()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 704 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
2-704
2047 qmlWarning(this) << tr("unable to enable static roles as this model is not empty");-
2048 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else {
2
2049 m_dynamicRoles = false;-
2050 }
executed 704 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
704
2051 }-
2052 } else {-
2053 qmlWarning(this) << tr("dynamic role setting must be made from the main thread, before any worker scripts are created");-
2054 }
never executed: end of block
0
2055}-
2056-
2057-
2058-
2059-
2060-
2061int QQmlListModel::count() const-
2062{-
2063 return
executed 48668 times by 14 tests: return m_dynamicRoles ? m_modelObjects.count() : m_listModel->elementCount();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
m_dynamicRoles ? m_modelObjects.count() : m_listModel->elementCount();
executed 48668 times by 14 tests: return m_dynamicRoles ? m_modelObjects.count() : m_listModel->elementCount();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
48668
2064}-
2065void QQmlListModel::clear()-
2066{-
2067 removeElements(0, count());-
2068}
executed 80 times by 4 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
80
2069void QQmlListModel::remove(QQmlV4Function *args)-
2070{-
2071 int argLength = args->length();-
2072-
2073 if (argLength == 1
argLength == 1Description
TRUEevaluated 190 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 238 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
|| argLength == 2
argLength == 2Description
TRUEevaluated 214 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
24-238
2074 QV4::Scope scope(args->v4engine());-
2075 int index = QV4::ScopedValue(scope, (*args)[0])->toInt32();-
2076 int removeCount = (argLength == 2
argLength == 2Description
TRUEevaluated 214 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 190 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
? QV4::ScopedValue(scope, (*args)[1])->toInt32() : 1);
190-214
2077-
2078 if (index < 0
index < 0Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 392 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
|| index+removeCount > count()
index+removeCount > count()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 356 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
|| removeCount <= 0
removeCount <= 0Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 332 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
12-392
2079 qmlWarning(this) << tr("remove: indices [%1 - %2] out of range [0 - %3]").arg(index).arg(index+removeCount).arg(count());-
2080 return;
executed 72 times by 2 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
72
2081 }-
2082-
2083 removeElements(index, removeCount);-
2084 }
executed 332 times by 6 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
else {
332
2085 qmlWarning(this) << tr("remove: incorrect number of arguments");-
2086 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
2087}-
2088-
2089void QQmlListModel::removeElements(int index, int removeCount)-
2090{-
2091 ((index >= 0 && removeCount >= 0) ? static_cast<void>(0) : qt_assert("index >= 0 && removeCount >= 0", __FILE__, 2282));-
2092-
2093 if (!removeCount
!removeCountDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 408 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
4-408
2094 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qqmllistmodel
4
2095-
2096 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 260 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
148-260
2097 beginRemoveRows(QModelIndex(), index, index + removeCount - 1);
executed 260 times by 6 tests: beginRemoveRows(QModelIndex(), index, index + removeCount - 1);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
260
2098-
2099 QVector<std::function<void()>> toDestroy;-
2100 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 132 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 276 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
132-276
2101 for (int i=0 ; i < removeCount
i < removeCountDescription
TRUEevaluated 158 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 132 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i) {
132-158
2102 auto modelObject = m_modelObjects[index+i];-
2103 toDestroy.append([modelObject](){-
2104 delete modelObject;-
2105 }
executed 158 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
;
158
2106 }
executed 158 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
158
2107 m_modelObjects.remove(index, removeCount);-
2108 }
executed 132 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
132
2109 toDestroy = m_listModel->remove(index, removeCount);-
2110 }
executed 276 times by 6 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
276
2111-
2112 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 260 times by 6 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
) {
148-260
2113 endRemoveRows();-
2114 countChanged();-
2115 }
executed 260 times by 6 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
260
2116 for (const auto &destroyer : toDestroy)-
2117 destroyer();
executed 506 times by 6 tests: destroyer();
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
506
2118}
executed 408 times by 6 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
408
2119void QQmlListModel::insert(QQmlV4Function *args)-
2120{-
2121 if (args->length() == 2
args->length() == 2Description
TRUEevaluated 538 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-538
2122 QV4::Scope scope(args->v4engine());-
2123 QV4::ScopedValue arg0(scope, (*args)[0]);-
2124 int index = arg0->toInt32();-
2125-
2126 if (index < 0
index < 0Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 526 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
|| index > count()
index > count()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 514 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
) {
12-526
2127 qmlWarning(this) << tr("insert: index %1 out of range").arg(index);-
2128 return;
executed 24 times by 2 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
2129 }-
2130-
2131 QV4::ScopedObject argObject(scope, (*args)[1]);-
2132 QV4::ScopedArrayObject objectArray(scope, (*args)[1]);-
2133 if (objectArray
objectArrayDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 490 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
) {
24-490
2134 QV4::ScopedObject argObject(scope);-
2135-
2136 int objectArrayLength = objectArray->getLength();-
2137 emitItemsAboutToBeInserted(index, objectArrayLength);-
2138 for (int i=0 ; i < objectArrayLength
i < objectArrayLengthDescription
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i) {
24-72
2139 argObject = objectArray->get(i);-
2140-
2141 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
36
2142 m_modelObjects.insert(index+i, DynamicRoleModelNode::create(scope.engine->variantMapFromJS(argObject), this));-
2143 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
36
2144 m_listModel->insert(index+i, argObject);-
2145 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
36
2146 }-
2147 emitItemsInserted();-
2148 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (argObject
argObjectDescription
TRUEevaluated 466 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
24-466
2149 emitItemsAboutToBeInserted(index, 1);-
2150-
2151 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 412 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
) {
54-412
2152 m_modelObjects.insert(index, DynamicRoleModelNode::create(scope.engine->variantMapFromJS(argObject), this));-
2153 }
executed 54 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
54
2154 m_listModel->insert(index, argObject);-
2155 }
executed 412 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
412
2156-
2157 emitItemsInserted();-
2158 }
executed 466 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
else {
466
2159 qmlWarning(this) << tr("insert: value is not an object");-
2160 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
2161 } else {-
2162 qmlWarning(this) << tr("insert: value is not an object");-
2163 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
2164}-
2165void QQmlListModel::move(int from, int to, int n)-
2166{-
2167 if (n == 0
n == 0Description
TRUEnever evaluated
FALSEevaluated 190 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
|| from == to
from == toDescription
TRUEnever evaluated
FALSEevaluated 190 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
)
0-190
2168 return;
never executed: return;
0
2169 if (!canMove(from, to, n)
!canMove(from, to, n)Description
TRUEevaluated 48 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 142 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
48-142
2170 qmlWarning(this) << tr("move: out of range");-
2171 return;
executed 48 times by 2 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
48
2172 }-
2173-
2174 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 70 times by 4 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
70-72
2175 beginMoveRows(QModelIndex(), from, from + n - 1, QModelIndex(), to > from ? to + n : to);
executed 70 times by 4 tests: beginMoveRows(QModelIndex(), from, from + n - 1, QModelIndex(), to > from ? to + n : to);
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
70
2176-
2177 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 88 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
54-88
2178-
2179 int realFrom = from;-
2180 int realTo = to;-
2181 int realN = n;-
2182-
2183 if (from > to
from > toDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-42
2184-
2185 int tfrom = from;-
2186 int tto = to;-
2187 realFrom = tto;-
2188 realTo = tto+n;-
2189 realN = tfrom-tto;-
2190 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
2191-
2192 QPODVector<DynamicRoleModelNode *, 4> store;-
2193 for (int i=0 ; i < (realTo-realFrom)
i < (realTo-realFrom)Description
TRUEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i)
54
2194 store.append(m_modelObjects[realFrom+realN+i]);
executed 54 times by 2 tests: store.append(m_modelObjects[realFrom+realN+i]);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
54
2195 for (int i=0 ; i < realN
i < realNDescription
TRUEevaluated 78 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i)
54-78
2196 store.append(m_modelObjects[realFrom+i]);
executed 78 times by 2 tests: store.append(m_modelObjects[realFrom+i]);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
78
2197 for (int i=0 ; i < store.count()
i < store.count()Description
TRUEevaluated 132 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i)
54-132
2198 m_modelObjects[realFrom+i] = store[i];
executed 132 times by 2 tests: m_modelObjects[realFrom+i] = store[i];
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
132
2199-
2200 }
executed 54 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
54
2201 m_listModel->move(from, to, n);-
2202 }
executed 88 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
88
2203-
2204 if (m_mainThread
m_mainThreadDescription
TRUEevaluated 70 times by 4 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
70-72
2205 endMoveRows();
executed 70 times by 4 tests: endMoveRows();
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
70
2206}
executed 142 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
142
2207void QQmlListModel::append(QQmlV4Function *args)-
2208{-
2209 if (args->length() == 1
args->length() == 1Description
TRUEevaluated 2834 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-2834
2210 QV4::Scope scope(args->v4engine());-
2211 QV4::ScopedObject argObject(scope, (*args)[0]);-
2212 QV4::ScopedArrayObject objectArray(scope, (*args)[0]);-
2213-
2214 if (objectArray
objectArrayDescription
TRUEevaluated 26 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2808 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
26-2808
2215 QV4::ScopedObject argObject(scope);-
2216-
2217 int objectArrayLength = objectArray->getLength();-
2218 if (objectArrayLength > 0
objectArrayLength > 0Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
2-24
2219 int index = count();-
2220 emitItemsAboutToBeInserted(index, objectArrayLength);-
2221-
2222 for (int i=0 ; i < objectArrayLength
i < objectArrayLengthDescription
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
; ++i) {
24-72
2223 argObject = objectArray->get(i);-
2224-
2225 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
36
2226 m_modelObjects.append(DynamicRoleModelNode::create(scope.engine->variantMapFromJS(argObject), this));-
2227 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
36
2228 m_listModel->append(argObject);-
2229 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
36
2230 }-
2231-
2232 emitItemsInserted();-
2233 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
2234 }
executed 26 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else if (argObject
argObjectDescription
TRUEevaluated 2784 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
24-2784
2235 int index;-
2236-
2237 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 938 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1846 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
) {
938-1846
2238 index = m_modelObjects.count();-
2239 emitItemsAboutToBeInserted(index, 1);-
2240 m_modelObjects.append(DynamicRoleModelNode::create(scope.engine->variantMapFromJS(argObject), this));-
2241 }
executed 938 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
938
2242 index = m_listModel->elementCount();-
2243 emitItemsAboutToBeInserted(index, 1);-
2244 m_listModel->append(argObject);-
2245 }
executed 1846 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
1846
2246-
2247 emitItemsInserted();-
2248 }
executed 2784 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
else {
2784
2249 qmlWarning(this) << tr("append: value is not an object");-
2250 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
24
2251 } else {-
2252 qmlWarning(this) << tr("append: value is not an object");-
2253 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
2254}-
2255QQmlV4Handle QQmlListModel::get(int index) const-
2256{-
2257 QV4::Scope scope(engine());-
2258 QV4::ScopedValue result(scope, QV4::Primitive::undefinedValue());-
2259-
2260 if (index >= 0
index >= 0Description
TRUEevaluated 1514 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
&& index < count()
index < count()Description
TRUEevaluated 1502 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-1514
2261-
2262 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 544 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 958 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
) {
544-958
2263 DynamicRoleModelNode *object = m_modelObjects[index];-
2264 result = QV4::QObjectWrapper::wrap(scope.engine, object);-
2265 }
executed 544 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
544
2266 QObject *object = m_listModel->getOrCreateModelObject(const_cast<QQmlListModel *>(this), index);-
2267 QQmlData *ddata = QQmlData::get(object);-
2268 if (ddata->jsWrapper.isNullOrUndefined()
ddata->jsWrapp...lOrUndefined()Description
TRUEevaluated 660 times by 8 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 298 times by 5 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquicklistview
) {
298-660
2269 result = scope.engine->memoryManager->allocate<QV4::ModelObject>(object, const_cast<QQmlListModel *>(this));-
2270-
2271 ddata->jsWrapper.set(scope.engine, result);-
2272 }
executed 660 times by 8 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
else {
660
2273 result = ddata->jsWrapper.value();-
2274 }
executed 298 times by 5 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquicklistview
298
2275 }-
2276 }-
2277-
2278 return
executed 1526 times by 8 tests: return QQmlV4Handle(result);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
QQmlV4Handle(result);
executed 1526 times by 8 tests: return QQmlV4Handle(result);
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmltranslation
  • tst_qqmlxmlhttprequest
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickrepeater
1526
2279}-
2280void QQmlListModel::set(int index, const QQmlV4Handle &handle)-
2281{-
2282 QV4::Scope scope(engine());-
2283 QV4::ScopedObject object(scope, handle);-
2284-
2285 if (!object
!objectDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 296 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12-296
2286 qmlWarning(this) << tr("set: value is not an object");-
2287 return;
executed 12 times by 2 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
2288 }-
2289 if (index > count()
index > count()Description
TRUEnever evaluated
FALSEevaluated 296 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
|| index < 0
index < 0Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 284 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
0-296
2290 qmlWarning(this) << tr("set: index %1 out of range").arg(index);-
2291 return;
executed 12 times by 2 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
2292 }-
2293-
2294-
2295 if (index == count()
index == count()Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 260 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
24-260
2296 emitItemsAboutToBeInserted(index, 1);-
2297-
2298 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
12
2299 m_modelObjects.append(DynamicRoleModelNode::create(scope.engine->variantMapFromJS(object), this));-
2300 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
12
2301 m_listModel->insert(index, object);-
2302 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
12
2303-
2304 emitItemsInserted();-
2305 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
24
2306-
2307 QVector<int> roles;-
2308-
2309 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 138 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 122 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
122-138
2310 m_modelObjects[index]->updateValues(scope.engine->variantMapFromJS(object), roles);-
2311 }
executed 138 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
138
2312 m_listModel->set(index, object, &roles);-
2313 }
executed 122 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
122
2314-
2315 if (roles.count()
roles.count()Description
TRUEevaluated 230 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
30-230
2316 emitItemsChanged(index, 1, roles);
executed 230 times by 2 tests: emitItemsChanged(index, 1, roles);
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
230
2317 }
executed 260 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
260
2318}-
2319void QQmlListModel::setProperty(int index, const QString& property, const QVariant& value)-
2320{-
2321 if (count() == 0
count() == 0Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 132 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
|| index >= count()
index >= count()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 120 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
|| index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 120 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
) {
0-132
2322 qmlWarning(this) << tr("set: index %1 out of range").arg(index);-
2323 return;
executed 36 times by 2 tests: return;
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
36
2324 }-
2325-
2326 if (m_dynamicRoles
m_dynamicRolesDescription
TRUEevaluated 56 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 64 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
) {
56-64
2327 int roleIndex = m_roles.indexOf(property);-
2328 if (roleIndex == -1
roleIndex == -1Description
TRUEnever evaluated
FALSEevaluated 56 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
) {
0-56
2329 roleIndex = m_roles.count();-
2330 m_roles.append(property);-
2331 }
never executed: end of block
0
2332 if (m_modelObjects[index]->setValue(property.toUtf8(), value)
m_modelObjects...Utf8(), value)Description
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
)
4-52
2333 emitItemsChanged(index, 1, QVector<int>(1, roleIndex));
executed 52 times by 2 tests: emitItemsChanged(index, 1, QVector<int>(1, roleIndex));
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
52
2334 }
executed 56 times by 2 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
else {
56
2335 int roleIndex = m_listModel->setOrCreateProperty(index, property, value);-
2336 if (roleIndex != -1
roleIndex != -1Description
TRUEevaluated 60 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
4-60
2337 emitItemsChanged(index, 1, QVector<int>(1, roleIndex));
executed 60 times by 3 tests: emitItemsChanged(index, 1, QVector<int>(1, roleIndex));
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
60
2338 }
executed 64 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qquicklistview
64
2339}-
2340-
2341-
2342-
2343-
2344-
2345-
2346-
2347void QQmlListModel::sync()-
2348{-
2349-
2350-
2351-
2352 qmlWarning(this) << "List sync() can only be called from a WorkerScript";-
2353}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
2
2354-
2355bool QQmlListModelParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding)-
2356{-
2357 if (binding->type >= QV4::CompiledData::Binding::Type_Object
binding->type ...g::Type_ObjectDescription
TRUEevaluated 1928 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 2826 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
1928-2826
2358 const quint32 targetObjectIndex = binding->value.objectIndex;-
2359 const QV4::CompiledData::Object *target = qmlUnit->objectAt(targetObjectIndex);-
2360 QString objName = qmlUnit->stringAt(target->inheritedTypeNameIndex);-
2361 if (objName != listElementTypeName
objName != listElementTypeNameDescription
TRUEevaluated 388 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 1540 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
) {
388-1540
2362 const QMetaObject *mo = resolveType(objName);-
2363 if (mo != &QQmlListElement::staticMetaObject
mo != &QQmlLis...aticMetaObjectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 386 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
2-386
2364 error(target, QQmlListModel::tr("ListElement: cannot contain nested elements"));-
2365 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
2
2366 }-
2367 listElementTypeName = objName;-
2368 }
executed 386 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
386
2369-
2370 if (!qmlUnit->stringAt(target->idNameIndex).isEmpty()
!qmlUnit->stri...dex).isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 1924 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
2-1924
2371 error(target->locationOfIdProperty, QQmlListModel::tr("ListElement: cannot use reserved \"id\" property"));-
2372 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
2
2373 }-
2374-
2375 const QV4::CompiledData::Binding *binding = target->bindingTable();-
2376 for (quint32 i = 0; i < target->nBindings
i < target->nBindingsDescription
TRUEevaluated 2896 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 1912 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
; ++i, ++binding) {
1912-2896
2377 QString propName = qmlUnit->stringAt(binding->propertyNameIndex);-
2378 if (propName.isEmpty()
propName.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2894 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
2-2894
2379 error(binding, QQmlListModel::tr("ListElement: cannot contain nested elements"));-
2380 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
2
2381 }-
2382 if (!verifyProperty(qmlUnit, binding)
!verifyPropert...Unit, binding)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 2884 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
10-2884
2383 return
executed 10 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
10
2384 }
executed 2884 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
2884
2385 }
executed 1912 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
else if (binding->type == QV4::CompiledData::Binding::Type_Script
binding->type ...g::Type_ScriptDescription
TRUEevaluated 100 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEevaluated 2726 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
100-2726
2386 QString scriptStr = binding->valueAsScriptString(qmlUnit);-
2387 if (!binding->isFunctionExpression()
!binding->isFu...onExpression()Description
TRUEevaluated 100 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEnever evaluated
&& !definesEmptyList(scriptStr)
!definesEmptyList(scriptStr)Description
TRUEevaluated 98 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
0-100
2388 QByteArray script = scriptStr.toUtf8();-
2389 bool ok;-
2390 evaluateEnum(script, &ok);-
2391 if (!ok
!okDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 90 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
8-90
2392 error(binding, QQmlListModel::tr("ListElement: cannot use script for property value"));-
2393 return
executed 8 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_qqmllistmodel
8
2394 }-
2395 }
executed 90 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
90
2396 }
executed 92 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
92
2397-
2398 return
executed 4730 times by 14 tests: return true;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
true;
executed 4730 times by 14 tests: return true;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4730
2399}-
2400-
2401bool QQmlListModelParser::applyProperty(QV4::CompiledData::CompilationUnit *compilationUnit, const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex)-
2402{-
2403 const QString elementName = qmlUnit->stringAt(binding->propertyNameIndex);-
2404-
2405 bool roleSet = false;-
2406 if (binding->type >= QV4::CompiledData::Binding::Type_Object
binding->type ...g::Type_ObjectDescription
TRUEevaluated 3280 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 4404 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
3280-4404
2407 const quint32 targetObjectIndex = binding->value.objectIndex;-
2408 const QV4::CompiledData::Object *target = qmlUnit->objectAt(targetObjectIndex);-
2409-
2410 ListModel *subModel = nullptr;-
2411 if (outterElementIndex == -1
outterElementIndex == -1Description
TRUEevaluated 3216 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 64 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
64-3216
2412 subModel = model;-
2413 }
executed 3216 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
else {
3216
2414 const ListLayout::Role &role = model->getOrCreateListRole(elementName);-
2415 if (role.type == ListLayout::Role::List
role.type == L...ut::Role::ListDescription
TRUEevaluated 62 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
2-62
2416 subModel = model->getListProperty(outterElementIndex, role);-
2417 if (subModel == nullptr
subModel == nullptrDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
30-32
2418 subModel = new ListModel(role.subLayout, nullptr);-
2419 QVariant vModel = QVariant::fromValue(subModel);-
2420 model->setOrCreateProperty(outterElementIndex, elementName, vModel);-
2421 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
32
2422 }
executed 62 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
62
2423 }
executed 64 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
64
2424-
2425 int elementIndex = subModel
subModelDescription
TRUEevaluated 3278 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
? subModel->appendElement() : -1;
2-3278
2426-
2427 const QV4::CompiledData::Binding *subBinding = target->bindingTable();-
2428 for (quint32 i = 0; i < target->nBindings
i < target->nBindingsDescription
TRUEevaluated 4468 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
FALSEevaluated 3280 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
; ++i, ++subBinding) {
3280-4468
2429 roleSet |= applyProperty(compilationUnit, qmlUnit, subBinding, subModel, elementIndex);-
2430 }
executed 4468 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4468
2431-
2432 }
executed 3280 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
else {
3280
2433 QVariant value;-
2434-
2435 if (binding->isTranslationBinding()
binding->isTra...ationBinding()Description
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
FALSEevaluated 4396 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
8-4396
2436 value = QVariant::fromValue<const QV4::CompiledData::Binding*>(binding);-
2437 }
executed 8 times by 3 tests: end of block
Executed by:
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmltranslation
else if (binding->evaluatesToString()
binding->evaluatesToString()Description
TRUEevaluated 3944 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
FALSEevaluated 452 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
  • tst_qtqmlmodules
) {
8-3944
2438 value = binding->valueAsString(qmlUnit);-
2439 }
executed 3944 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
else if (binding->type == QV4::CompiledData::Binding::Type_Number
binding->type ...g::Type_NumberDescription
TRUEevaluated 304 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
FALSEevaluated 148 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
) {
148-3944
2440 value = binding->valueAsNumber();-
2441 }
executed 304 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qquickrepeater
else if (binding->type == QV4::CompiledData::Binding::Type_Boolean
binding->type ...::Type_BooleanDescription
TRUEevaluated 56 times by 3 tests
Evaluated by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
FALSEevaluated 92 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
56-304
2442 value = binding->valueAsBoolean();-
2443 }
executed 56 times by 3 tests: end of block
Executed by:
  • tst_qqmllistmodel
  • tst_qquicklistview
  • tst_qtqmlmodules
else if (binding->type == QV4::CompiledData::Binding::Type_Script
binding->type ...g::Type_ScriptDescription
TRUEevaluated 92 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-92
2444 QString scriptStr = binding->valueAsScriptString(qmlUnit);-
2445 if (definesEmptyList(scriptStr)
definesEmptyList(scriptStr)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 90 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
2-90
2446 const ListLayout::Role &role = model->getOrCreateListRole(elementName);-
2447 ListModel *emptyModel = new ListModel(role.subLayout, nullptr);-
2448 value = QVariant::fromValue(emptyModel);-
2449 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
else if (binding->isFunctionExpression()
binding->isFun...onExpression()Description
TRUEnever evaluated
FALSEevaluated 90 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
0-90
2450 QQmlBinding::Identifier id = binding->value.compiledScriptIndex;-
2451 ((id != QQmlBinding::Invalid) ? static_cast<void>(0) : qt_assert("id != QQmlBinding::Invalid", __FILE__, 2750));-
2452-
2453 auto v4 = compilationUnit->engine;-
2454 QV4::Scope scope(v4);-
2455-
2456 QV4::ScopedContext context(scope, QV4::QmlContext::create(v4->rootContext(), QQmlContextData::get(qmlContext(model->m_modelCache)), nullptr));-
2457 QV4::ScopedFunctionObject function(scope, QV4::FunctionObject::createScriptFunction(context, compilationUnit->runtimeFunctions[id]));-
2458-
2459 QV4::ReturnedValue result = function->call(v4->globalObject, nullptr, 0);-
2460-
2461 QJSValue v;-
2462 QJSValuePrivate::setValue(&v, v4, result);-
2463 value.setValue<QJSValue>(v);-
2464 }
never executed: end of block
else {
0
2465 QByteArray script = scriptStr.toUtf8();-
2466 bool ok;-
2467 value = evaluateEnum(script, &ok);-
2468 }
executed 90 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
90
2469 } else {-
2470 do { ((false) ? static_cast<void>(0) : qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached", __FILE__, 2769)); __builtin_unreachable(); } while (false);-
2471 }
never executed: end of block
0
2472-
2473 model->setOrCreateProperty(outterElementIndex, elementName, value);-
2474 roleSet = true;-
2475 }
executed 4404 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
4404
2476 return
executed 7684 times by 13 tests: return roleSet;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
roleSet;
executed 7684 times by 13 tests: return roleSet;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
7684
2477}-
2478-
2479void QQmlListModelParser::verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings)-
2480{-
2481 listElementTypeName = QString();-
2482-
2483 for (const QV4::CompiledData::Binding *binding : bindings) {-
2484 QString propName = qmlUnit->stringAt(binding->propertyNameIndex);-
2485 if (!propName.isEmpty()
!propName.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 1860 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
) {
2-1860
2486 error(binding, QQmlListModel::tr("ListModel: undefined property '%1'").arg(propName));-
2487 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qqmllistmodel
2
2488 }-
2489 if (!verifyProperty(qmlUnit, binding)
!verifyPropert...Unit, binding)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 1846 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
14-1846
2490 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_qqmllistmodel
14
2491 }
executed 1846 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
1846
2492}
executed 372 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
372
2493-
2494void QQmlListModelParser::applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings)-
2495{-
2496 QQmlListModel *rv = static_cast<QQmlListModel *>(obj);-
2497-
2498 rv->m_engine = qmlEngine(rv)->handle();-
2499 rv->m_compilationUnit = compilationUnit;-
2500-
2501 const QV4::CompiledData::Unit *qmlUnit = compilationUnit->data;-
2502-
2503 bool setRoles = false;-
2504-
2505 for (const QV4::CompiledData::Binding *binding : bindings) {-
2506 if (binding->type != QV4::CompiledData::Binding::Type_Object
binding->type ...g::Type_ObjectDescription
TRUEnever evaluated
FALSEevaluated 3216 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
0-3216
2507 continue;
never executed: continue;
0
2508 setRoles |= applyProperty(compilationUnit, qmlUnit, binding, rv->m_listModel, -1);-
2509 }
executed 3216 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
3216
2510-
2511 if (setRoles == false
setRoles == falseDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 696 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
4-696
2512 qmlWarning(obj) << "All ListElement declarations are empty, no roles can be created unless dynamicRoles is set.";
executed 4 times by 1 test: qmlWarning(obj) << "All ListElement declarations are empty, no roles can be created unless dynamicRoles is set.";
Executed by:
  • tst_qqmllistmodel
4
2513}
executed 700 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
700
2514-
2515bool QQmlListModelParser::definesEmptyList(const QString &s)-
2516{-
2517 if (s.startsWith(QLatin1Char('['))
s.startsWith(QLatin1Char('['))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 188 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
&& s.endsWith(QLatin1Char(']'))
s.endsWith(QLatin1Char(']'))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-188
2518 for (int i=1; i<s.length()-1
i<s.length()-1Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
; i++) {
4-56
2519 if (!s[i].isSpace()
!s[i].isSpace()Description
TRUEnever evaluated
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
0-56
2520 return
never executed: return false;
false;
never executed: return false;
0
2521 }
executed 56 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
56
2522 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qqmllistmodel
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qqmllistmodel
4
2523 }-
2524 return
executed 188 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
false;
executed 188 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
188
2525}-
2526-
2527-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0