Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
many
Description
The plugin.qmltypes files are generated by qmlplugindump manually and they are checked into version control inside Qt.
We should replace the need to generate the file manually by extracting all relevant information from the QObject subclasses in the project at build time and generating the file on the fly.
By generating it automatically and unconditionally, tools that want to perform static type analysis can rely on these files for precise work.
A successful extraction process requires eliminating the imperative qmlRegisterType<T>(module, element, version, etc..) API by annotating the type T and letting the moc generated code automatically call qmlRegisterType<T> for automatic registration.
On the build system level the extraction could be done by placing the static meta-object into a special section of the object file - similar to how we store the plugin json meta-data in a special section - and extracting that data after the creation of the .o file. There is a limited number of .o files that need to be supported.
Attachments
Issue Links
- is required for
-
QTBUG-68791 QML type system: Make it possible to verify the type correctness of binding expressions at build time
- Closed
-
QTBUG-74839 Implement QML code model in Qt
- Closed
- relates to
-
QTBUG-71574 Provide a better way to register sequential and associative types for usage in QML
- Closed
- resulted in
-
QTBUG-88828 [REG 5.14 -> 5.15]Code completion not works and false error messages for QML with Qt 5.15 for Android
- Closed
-
QTBUG-82307 moc: Document new json arguments
- Open
-
QTBUG-82305 qmake: Document qmltypes.prf
- Closed