-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
6.10.0
-
None
-
MacOS, M2 Pro
Description
qmltyperegistrar warns about missing Qt base types not found such as QObject:
Automatic QML type registration for target mymodule
Warning: ClassA.h:6: QObject is used as base type but cannot be found.
This issue can be reproduced either by using the qt_add_qml_module() cmake function or running the qmltyperegistrar executable in qt declarative.
Reproduction
Please find attached a minimal code to reproduce it using cmake and one registered class. Run:
./configure cmake --build build --target mymodule_qmltyperegistration --verbose
Note: the setup is using conan, so make sure to have qt/6.10.0@local/test built
Additional details
- This warning didn't exist in Qt 6.5.0.
- After building and running the tool in debug mode, I've found out that the warning comes from https://github.com/qt/qtdeclarative/blob/dev/src/qmltyperegistrar/qmetatypesjsonprocessor.cpp#L544
- The tools warns only once when using qt_add_qml_module(), change the name of class to make it appear again. Running the tool from qt declarative always gives warning.
- Having this issue in a larger, corporate, project gives more warnings such as:
QAbstractListModel, QAbstractItemModel, QQuickImageProvider, QSortFilterProxyModel, Qt3DCore::QEntity, QQuickItem