[Interest] problem with type registration during QML module compilation
Stefan Seefeld
stefan at seefeld.name
Fri Jul 12 20:36:24 CEST 2024
Hello,
any idea why I'm getting the below error ? What tool is used to generate
the *_qmltyperegistrations.cpp file, and how does it figure out to add the
line `#include <A.h>` instead of `#include <view/A.h>` ?
On Fri, Jul 5, 2024 at 10:15 AM Stefan Seefeld <stefan at seefeld.name> wrote:
> Hello,
>
> following up on an earlier conversation...
>
> I'm trying to convert a legacy QML module to use the "new"
> `qt_add_qml_module` function. This process includes the generation of a
> ..._qmltyperegistrations.cpp file that contains an invalid reference to a
> header file <A.h>
>
> My library layout looks like this:
>
> libs/foo/
> ├── CMakeLists.txt
> ├── view
> │ ├── A.h
> │ ...
> ├── qml
> ...
>
> and the makefile above compiles a shared library libfoo.so from the
> contents. I now want to use `qt_add_qml_module()` to automate the
> generation of the associated QML module (including all the QML resources,
> as well as exposing the QML types defined in C++, such as the one in
> `view/A.h`. However, the generated code expects to be able to include
> "A.h", while it should actually be including "view/A.h". Is there a
> property I should be passing to `qt_add_qml_module()` to make that happen,
> or is there anything else I'm missing ?
>
> For context: The type `A` is actually a singleton (a QQmlPropertyMap)
> which is accessed directly from C++ code, so its C++ API needs to be
> accessible as a regular class in the library, in addition to being
> registered to the QML runtime.
>
> Thanks for any help,
>
> --
>
> ...ich hab' noch einen Koffer in Berlin...
>
>
--
...ich hab' noch einen Koffer in Berlin...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240712/40ce0a6a/attachment.htm>
More information about the Interest
mailing list