aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qobjectwrapper.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-06-25 16:16:58 +0200
committerLars Knoll <lars.knoll@qt.io>2021-08-09 14:53:44 +0000
commit3cf2df4a7e8a53a63068613311c4799e55c971b9 (patch)
treee06c00cc157af252a179d9af83ff78bbb832b1e0 /src/qml/jsruntime/qv4qobjectwrapper.cpp
parent00b580427071acb9341bc49fe37e289201cbf02c (diff)
Skip superfluous property capture attempt
If a QQmlProperyBinding tries to capture a QProperty, there is nothing to do as the dependency tracking happens in C++ anyway. Thus we can avoid calling captureProperty. Pick-to: 6.2 Change-Id: I96b2876d4b2ba10b00af8342be9beae660a95ef3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 49a43860df..1d5d3dedf7 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -289,7 +289,8 @@ ReturnedValue QObjectWrapper::getProperty(ExecutionEngine *engine, QObject *obje
QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : nullptr;
if (ep && ep->propertyCapture && !property->isConstant())
- ep->propertyCapture->captureProperty(object, property->coreIndex(), property->notifyIndex());
+ if (!property->isBindable() || ep->propertyCapture->expression->mustCaptureBindableProperty())
+ ep->propertyCapture->captureProperty(object, property->coreIndex(), property->notifyIndex());
if (property->isVarProperty()) {
QQmlVMEMetaObject *vmemo = QQmlVMEMetaObject::get(object);