[Development] Question about QtDeclarative Internals
ulf.hermann at qt.io
Thu Apr 22 07:54:15 CEST 2021
the simplest way I can see here would not be a compilation unit. The
where the imports of a script are saved is
QV4::CompiledData::CompilationUnitBase::imports of the _importing_ unit.
That's an array QV4::StaticValue*. Imports are always resolved
statically when loading the script that does the import.
You need a way to tell the engine "Hey, here is my implementation of
provide a QV4::Value (that has been protected against garbage collection
in some way) as that will fit the bill for the imports array.
You might store those values as a hash of QUrl to QV4::PersistentValue
in QV4::ExecutionEngine. Then you can query them in addition to the
compilation units whenever something is imported. In a second step, the
original modules hash may be changed to store some abstraction over both
This of course does involve some changes in the QML engine itself.
has been on my list for a long time. This would be a welcome addition.
Don't hesitate to ask me if you have further questions. You can also
find me on freenode IRC in the #qt-v4vm channel.
More information about the Development