[Interest] QJSEngine with QRC
Thiago Macieira
thiago.macieira at intel.com
Wed Oct 29 06:36:12 CET 2025
On Tuesday, 28 October 2025 18:57:42 Pacific Daylight Time Scott Bloom wrote:
> For Qt, I have created a QRC file with the node modules, as well as the
> script.mjs
>
> I would like to be able to do something along the lines of
>
> QJSEngine engine;
There's an incompatibility between the two things above:
1) the JS engine
2) the storage (Qt resources)
Node.js is an external application and thus does not understand Qt resources.
If you want to use Node.js and modules for it, extract the files to disk and
then run "node" using QProcess.
If you want to use QtQml's QJSEngine, you can load from Qt resources. But that
is not Node.js, does not understand Node.js modules nor does it claim to be
compatible with Node.js's JS language level or the TypeScript language, or any
of the metadata/overhead that is usually associated with Node.js components.
You can still run JavaScript, but you need to write code that QJSEngine can
understand.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel Data Center Group
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5150 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20251028/8e43b180/attachment.bin>
More information about the Interest
mailing list