Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-68796

Create plugin.qmltypes automatically at build time

    XMLWordPrintable

Details

    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

          For Gerrit Dashboard: QTBUG-68796
          # Subject Branch Project Status CR V

          Activity

            People

              ulherman Ulf Hermann
              shausman Simon Hausmann
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews