diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-07 13:28:59 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:18:27 +0000 |
commit | d1af494793961a31747b689cf307b65d99367486 (patch) | |
tree | 1e89898065334e841ded62499331274cb9d0b230 /src/qml/types/qqmllistmodel.cpp | |
parent | 3c090c80c58d99f1bd29493ef747a4f6fa915a71 (diff) |
Change Objects vtable methods to take a StringOrSymbol
This is needed for symbol support.
Change-Id: I83db21f232168710d18999fd97d912016e86d630
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/types/qqmllistmodel.cpp')
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index fd54a51b1d..40e0ec48c3 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1474,8 +1474,12 @@ void ModelNodeMetaObject::emitDirectNotifies(const int *changedRoles, int roleCo namespace QV4 { -bool ModelObject::put(Managed *m, String *name, const Value &value) +bool ModelObject::put(Managed *m, StringOrSymbol *n, const Value &value) { + if (n->isSymbol()) + return Object::put(m, n, value); + String *name = static_cast<String *>(n); + ModelObject *that = static_cast<ModelObject*>(m); ExecutionEngine *eng = that->engine(); @@ -1491,8 +1495,12 @@ bool ModelObject::put(Managed *m, String *name, const Value &value) return true; } -ReturnedValue ModelObject::get(const Managed *m, String *name, bool *hasProperty) +ReturnedValue ModelObject::get(const Managed *m, StringOrSymbol *n, bool *hasProperty) { + if (n->isSymbol()) + return Object::get(m, n, hasProperty); + String *name = static_cast<String *>(n); + const ModelObject *that = static_cast<const ModelObject*>(m); const ListLayout::Role *role = that->d()->m_model->m_listModel->getExistingRole(name); if (!role) |