From 21301c1dbb00f4a2cd991e520423ed039b297ffb Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 20 Mar 2018 09:44:30 -0500 Subject: Simplify handling of function expressions as signal handlers Change-Id: I4bfa05b4619c248119c78d05e64270e6627f6065 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlobjectcreator.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/qml/qml/qqmlobjectcreator.cpp') diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 7c36f59035..7051fb51da 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -879,14 +879,6 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *bindingProper if (binding->type == QV4::CompiledData::Binding::Type_Script || binding->containsTranslations()) { if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression) { QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]; - - // When a user writes the following: - // onSignal: function() { doSomethingUsefull } - // then do not run the binding that returns the closure, but run the closure - // instead. - if (auto closure = runtimeFunction->nestedFunction()) - runtimeFunction = closure; - int signalIndex = _propertyCache->methodIndexToSignalIndex(bindingProperty->coreIndex()); QQmlBoundSignal *bs = new QQmlBoundSignal(_bindingTarget, signalIndex, _scopeObject, engine); QQmlBoundSignalExpression *expr = new QQmlBoundSignalExpression(_bindingTarget, signalIndex, -- cgit v1.2.3