diff options
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 11 | ||||
-rw-r--r-- | src/qml/types/qqmllistmodel_p_p.h | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 41c52e742c..a8f4708ff6 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1564,24 +1564,23 @@ void ModelNodeMetaObject::emitDirectNotifies(const int *changedRoles, int roleCo namespace QV4 { -bool ModelObject::put(Managed *m, StringOrSymbol *n, const Value &value) +bool ModelObject::put(Managed *m, Identifier id, const Value &value, Value *receiver) { - if (n->isSymbol()) - return Object::put(m, n, value); - String *name = static_cast<String *>(n); + if (!id.isString()) + return Object::put(m, id, value, receiver); + QString propName = id.toQString(); ModelObject *that = static_cast<ModelObject*>(m); ExecutionEngine *eng = that->engine(); const int elementIndex = that->d()->elementIndex(); - const QString propName = name->toQString(); int roleIndex = that->d()->m_model->m_listModel->setExistingProperty(elementIndex, propName, value, eng); if (roleIndex != -1) that->d()->m_model->emitItemsChanged(elementIndex, 1, QVector<int>(1, roleIndex)); ModelNodeMetaObject *mo = ModelNodeMetaObject::get(that->object()); if (mo->initialized()) - mo->emitPropertyNotification(name->toQString().toUtf8()); + mo->emitPropertyNotification(propName.toUtf8()); return true; } diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h index 75eeaeed0c..a271d9b4d2 100644 --- a/src/qml/types/qqmllistmodel_p_p.h +++ b/src/qml/types/qqmllistmodel_p_p.h @@ -173,7 +173,7 @@ struct ModelObject : public QObjectWrapper { struct ModelObject : public QObjectWrapper { - static bool put(Managed *m, StringOrSymbol *name, const Value& value); + static bool put(Managed *m, Identifier id, const Value& value, Value *receiver); static ReturnedValue get(const Managed *m, StringOrSymbol *name, bool *hasProperty); static void advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes); |