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.