diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-04-21 12:13:18 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-04-22 22:15:22 +0200 |
commit | e44a949f9028df1d4750dad2925b074c9c59efcc (patch) | |
tree | 1d0378b904a74a50ce4d1cf7dd8d3d04212c0343 /src/qml/qml/qqmlbinding_p.h | |
parent | 92b99e85bb294d598a8143f33eab5bbce3fbebaa (diff) |
Optimize QQmlBinding::slowWrite()
That's not uncommon at all, and we don't need to convert the value back
and forth for it. If we have a metatype/void* representation already, we
can just create a QVariant from that and forward it to
writeValueProperty(). Even the QVariant is unnecessary, but that will be
resolved in a second step.
Change-Id: Ideae979a73276c9fba1bc19c10d799b8fe59dde5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlbinding_p.h')
-rw-r--r-- | src/qml/qml/qqmlbinding_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 9542f3acca..a74e76f475 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -137,6 +137,9 @@ protected: bool slowWrite(const QQmlPropertyData &core, const QQmlPropertyData &valueTypeData, const QV4::Value &result, bool isUndefined, QQmlPropertyData::WriteFlags flags); + bool slowWrite(const QQmlPropertyData &core, const QQmlPropertyData &valueTypeData, + const void *result, QMetaType resultType, bool isUndefined, + QQmlPropertyData::WriteFlags flags); QV4::ReturnedValue evaluate(bool *isUndefined); bool evaluate(void *result, QMetaType type) @@ -154,6 +157,7 @@ private: QQmlSourceLocation *m_sourceLocation = nullptr; // used for Qt.binding() created functions QV4::PersistentValue m_boundFunction; // used for Qt.binding() that are created from a bound function object + void handleWriteError(const void *result, QMetaType resultType, QMetaType metaType); }; bool QQmlBinding::updatingFlag() const |