diff options
Diffstat (limited to 'src/declarative/util/qdeclarativelistmodel.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index e3f26d7..b968ca5 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -284,12 +284,11 @@ void ModelNode::setObjectValue(const QScriptValue& valuemap) { } void ModelNode::setListValue(const QScriptValue& valuelist) { - QScriptValueIterator it(valuelist); + int size = valuelist.property(QString::fromLatin1("length")).toInt32(); values.clear(); - while (it.hasNext()) { - it.next(); + for (int i = 0; i < size; ++i) { ModelNode *value = new ModelNode; - QScriptValue v = it.value(); + QScriptValue v = valuelist.property(i); if (v.isArray()) { value->isArray = true; value->setListValue(v); |