New file fails to register to QML module - how to debug?
-
I have added one more to many C++ files that register to a QML module due to be added to the SOURCES of qt_qml_add_module (we're talking cmake here).
Just like any other of my similar files, it
- derives from QObject
- has Q_OBJECT
- has QML_ELEMENT
However, this file does not get added to the generated *qmltyperegistrations.cpp files with a "qmlRegisterTypesAndRevisions" entry, like everything else.
I do not see any warnings during build that could shed light on this. How does one gather more information on why this file specifically does not get registered to qml?
Obviously, this is not something I can reproduce in a small project - after all, I had >200 files properly registered before this happened for the first time...
-
Do additional files also fail to register?
If you remove one existing file does it still fail? -
Well, I can play around. But is there
- no way to enable some kind of tracing for this?
- no documentation explaining exactly under which circumstances things get added, and when not?
-
It was the same for the new file as for all the others.
But there is a subtle different I did not find documented anywhere:You have to
#include <QQmlEngine>
otherwise it silently fails
-
-