From 82ee8341fba141e2e1e44948d2161a694add1584 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 5 Dec 2016 12:42:41 +0100 Subject: Get rid of FunctionObject::createQmlFunction Instead, simply create a QmlContext, and setup the bindings with the QV4::Function itself. Change-Id: I9db93b15112e43a6d5e275d126fb20f9c8833e8f Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmllanguage/testtypes.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/auto/qml/qqmllanguage/testtypes.cpp') diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp index 91c7cfe305..bc8c192a61 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.cpp +++ b/tests/auto/qml/qqmllanguage/testtypes.cpp @@ -128,12 +128,11 @@ void CustomBinding::componentComplete() QQmlContextData *context = QQmlContextData::get(qmlContext(this)); - QV4::Scope scope(QQmlEnginePrivate::getV4Engine(qmlEngine(this))); - QV4::ScopedFunctionObject function(scope, QV4::FunctionObject::createQmlFunction(context, m_target, compilationUnit->runtimeFunctions[bindingId])); - QQmlProperty property(m_target, name, qmlContext(this)); + QV4::Scope scope(QQmlEnginePrivate::getV4Engine(qmlEngine(this))); + QV4::Scoped qmlContext(scope, QV4::QmlContext::create(scope.engine->rootContext(), context, m_target)); QQmlBinding *qmlBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, - function, m_target, context); + compilationUnit->runtimeFunctions[bindingId], m_target, context, qmlContext); qmlBinding->setTarget(property); QQmlPropertyPrivate::setBinding(property, qmlBinding); } -- cgit v1.2.3