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
For Gerrit Dashboard: QTBUG-68796 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
248470,23 | Add support for machine-readable JSON output to the MOC | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
248471,28 | Add support for semi-automatic QML type registrations | 5.15 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
289692,5 | Provide a macro for qmlRegisterTypeNotAvailable | 5.15 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
290170,4 | Add a static variant of qmlRegisterInterface() | 5.15 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
290352,2 | moc: Record whether a meta object is an object, gadget, or namespace | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
290355,2 | Provide a way to statically register namespaces | 5.15 | qt/qtdeclarative | Status: MERGED | +2 | 0 |