diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-28 10:44:48 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-04-11 14:12:09 +0200 |
commit | ec79af7396fd695b25f8f7dba66e8048d54b953b (patch) | |
tree | 68c3d2967228cfc8befecec233c87cec4f039f87 /src/qml/jsruntime/qv4function.cpp | |
parent | 60d9f0dd737f23ad239bfbdb21573c8a7633a63f (diff) |
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4function.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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) { |