[Interest] QML plugin with wasm not building

Konstantin Shegunov kshegunov at gmail.com
Mon Feb 13 09:22:46 CET 2023


Hi,
I wanted to build a simple QML application with webassembly, to try things
out. However I've hit a strange problem I can't really figure out. The
application consists of an executable and a library. It builds and runs
fine for desktop, however switching to wasm - it fails with an unresolved
symbol:
`qt_register_pluginXXX` (or something of this sort). In the cmake I used
the qt_add_qml_module
with pointing the target to the actual library (I don't really need a
separate plugin). It goes something like this:

qt_add_library(xxx SHARED ... sources)
...
qt_add_qml_module(xxx
    URI My.Module
    PLUGIN_TARGET xxx
    ...
)

Now seeing the error I attempted to put the now outdated (apparently)
NO_PLUGIN which causes the application to build successfully, but then it
doesn't load - it can't find the QML-exposed classes (the .qml files are
found okay). So it appears that the binary is indeed correctly linked (as
the qml files are in a resource and can be loaded), but the type
registration isn't run.
What am I doing wrong here? Should I do some manual call to register the
types I'm not aware of?

Kind regards,
Konstantin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230213/3079306f/attachment.htm>


More information about the Interest mailing list