Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.7
-
None
Description
I have a class B that I want to declarativly expose to QML. B is a subclass of A.
#include <a.h> class B : public A { Q_OBJECT QML_ELEMENT };
A is defined in a separate library that is installed into system dirs
class A : public QObject { Q_OBJECT }
When building my project I get
Warning: b.h:: A is used but cannot be found.
Looking into the generated qmltypes file B has type information, but is missing all the inherited properties/signals/invokables from A.
I suspect the answer here is to call qt_extract_metatypes() on the library where A is defined. But that will add the metatypes file to the build directory of that library, which doesn't make it available when building the project that contains B. For that it would need to be installed to the system as part of the library's installation process, but as far as I can tell that doesn't happen and there seems to be no API to do that.
Attachments
Issue Links
- relates to
-
QTBUG-127459 Document the need to qt_extract_metatypes or qt_add_library for external libraries exposed in QML modules
-
- Reported
-