diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-05-08 15:52:34 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-05-11 08:51:33 +0000 |
commit | 5132709440d9161aae5893341d9180137f1181d7 (patch) | |
tree | d30d3da5bc3bd36f4bbce5e7368456060edfe6be /src/qml/types/qqmllistmodel.cpp | |
parent | fb04917e8eb1f7cc5832b2f13ab1d208b0e1014f (diff) |
Clean up QQmlOpenMetaObject property data structure
Use a vector instead of a list for a more compact storage - random
access is a more frequent operation than appending/removal. Also use
a struct instead of a QPair for increased readability of the code and
encapsulate read and write operations.
Clean up the internal API to avoid unnecessary mutable property
extraction. This also helps to ensure that in all cases but intended
mutation we end up using the property getter that returns a QVariant by
value, something that will allow returning a null variant when QObject
tracking gets fixed in the next patch.
Change-Id: I563a930fe959b7636f9e9dc88a28cdcefc196707
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/types/qqmllistmodel.cpp')
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 40e0ec48c3..10066ae84a 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1446,7 +1446,7 @@ void ModelNodeMetaObject::propertyWritten(int index) return; QString propName = QString::fromUtf8(name(index)); - QVariant value = operator[](index); + const QVariant value = this->value(index); QV4::Scope scope(m_model->engine()); QV4::ScopedValue v(scope, scope.engine->fromVariant(value)); |