diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-12-05 12:42:41 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-12-09 14:01:57 +0000 |
commit | 82ee8341fba141e2e1e44948d2161a694add1584 (patch) | |
tree | 2e23b8101e996a5f462575105be2864a50b3db33 /src/qml/jsruntime | |
parent | bf661342652b02177fc1a5cd29195a443dac5bc1 (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 19 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 2 |
2 files changed, 0 insertions, 21 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index c65882ed7a..0f2a0ebf86 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -200,25 +200,6 @@ Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *sco return scope->d()->engine->memoryManager->allocObject<ScriptFunction>(scope, function); } -Heap::FunctionObject *FunctionObject::createQmlFunction(QQmlContextData *qmlContext, QObject *scopeObject, Function *runtimeFunction, const QList<QByteArray> &signalParameters, QString *error) -{ - ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(qmlContext->engine); - QV4::Scope valueScope(engine); - ExecutionContext *global = valueScope.engine->rootContext(); - QV4::Scoped<QmlContext> wrapperContext(valueScope, QmlContext::create(global, qmlContext, scopeObject)); - - if (!signalParameters.isEmpty()) { - if (error) { - QQmlPropertyCache::signalParameterStringForJS(engine, signalParameters, error); - return 0; - } - runtimeFunction->updateInternalClass(engine, signalParameters); - } - - return QV4::FunctionObject::createScriptFunction(wrapperContext, runtimeFunction); -} - - bool FunctionObject::isBinding() const { return d()->vtable() == QQmlBindingFunction::staticVTable(); diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 118caffadb..56e3cb92f7 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -150,8 +150,6 @@ struct Q_QML_EXPORT FunctionObject: Object { static void call(const Managed *that, Scope &scope, CallData *d); static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function, bool createProto = true); - static Heap::FunctionObject *createQmlFunction(QQmlContextData *qmlContext, QObject *scopeObject, QV4::Function *runtimeFunction, - const QList<QByteArray> &signalParameters = QList<QByteArray>(), QString *error = 0); ReturnedValue protoProperty() const { return propertyData(Heap::FunctionObject::Index_Prototype)->asReturnedValue(); } |