diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-12-05 14:31:50 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-12-09 14:02:26 +0000 |
commit | b45ebc6f456cf26912b14bb3809d14d696d9809a (patch) | |
tree | 43be87e1b24071ef85b0564283bb914416b0a00c /src/qml/qml/qqmlvaluetypewrapper.cpp | |
parent | a11be5881a38933d36facfbc4f8baa1becd22546 (diff) |
Avoid passing a FunctionObject to QQmlBinding::create()
Like this we can remove the QQmlBinding::create() overload
that takes a FunctionObject.
Change-Id: Ib6c37395ded325e68cf0fbf3afd08fb6dd6efa3b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmlvaluetypewrapper.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index 4ce7f67760..bbef62186a 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -454,7 +454,8 @@ void QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value) QV4::Scoped<QQmlBindingFunction> bindingFunction(scope, (const Value &)f); - QQmlBinding *newBinding = QQmlBinding::create(&cacheData, f, reference->d()->object, context); + QV4::ScopedContext ctx(scope, bindingFunction->scope()); + QQmlBinding *newBinding = QQmlBinding::create(&cacheData, bindingFunction->function(), reference->d()->object, context, ctx); newBinding->setSourceLocation(bindingFunction->currentLocation()); newBinding->setTarget(reference->d()->object, cacheData, pd); QQmlPropertyPrivate::setBinding(newBinding); |