From ec79af7396fd695b25f8f7dba66e8048d54b953b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 28 Mar 2022 10:44:48 +0200 Subject: DelegateModel: Use actual bindings for required properties Tracking the change signals is brittle and error prone. We have bindings for this case. Let's use them. We can construct a synthetic QV4::Function that contains its own QQmlJSAotFunction. In order to pass the property index to the function we generalize the "index" property of QQmlJSAotFunction to contain any extra data the function may want to use. If there is no compilation unit, we pass that instead. Fixes: QTBUG-91649 Change-Id: I0758bcc4964a48c6818d18bfb0972e67dbc16a1f Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4function.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/qml/jsruntime/qv4function.cpp') diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index 95a7506c80..a34f93be31 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -138,6 +138,18 @@ Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit, nFormals = compiledFunction->nFormals; } +Function::Function(ExecutionEngine *engine, const QQmlPrivate::AOTCompiledFunction *aotFunction) + : FunctionData(nullptr) + , compiledFunction(nullptr) + , codeData(nullptr) + , jittedCode(nullptr) + , codeRef(nullptr) + , aotFunction(aotFunction) +{ + internalClass = engine->internalClasses(EngineBase::Class_CallContext); + nFormals = aotFunction->argumentTypes.length(); +} + Function::~Function() { if (codeRef) { -- cgit v1.2.1