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

delegated QML types are not compiled with QML Type Compiler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.5.3
    • QML: Compiler
    • None
    • Windows

    Description

      Minimal Reproduction Project

      A minimal reproduction project is available at the following repository: qt-quick-compiler/qml-type-compiler/delegate_issue

      Issue Description

      When a QML type is compiled with QML Type Compiler (QMLTC), its creation phase is usually skipped at runtime (i.e., the "Creating" step in the QML Profiler does not appear). This is one of the key performance benefits of QMLTC: faster application startup and quicker instantiation of QMLTC-compiled components.

      However, when using a delegate (for example, in a Repeater or ListView), it appears that the "Creating" step reappears in the profiler logs, negating the performance benefit of QMLTC. Since delegates are a common pattern in Qt applications, this behavior could significantly reduce the effectiveness of QMLTC in real-world projects.

      Steps to Reproduce

      *Corresponding QML profiler logs can be found in the QMLProfiler_logs folder.

      1. Check the commit: At commit d97251a2 (master branch of the linked repo), observe how a Repeater with a delegate triggers the creation of the CustomQML type in the QML Profiler logs.
      2. Compare with no delegate: When the Repeater does not have a delegate (in the same commit), the profiler log shows that the Creating phase for CustomQML.qml does not occur.
      3. Test with ListView: To confirm this issue is related to delegates rather than just Repeater, the test was repeated using a ListView with a delegate. The profiler logs again showed the creation step for CustomQML, indicating that any delegate usage triggers this unexpected creation phase.

      Observations

      • Expected Behavior: QMLTC-compilation should remove or bypass the Creating step at runtime, leading to improved performance.
      • Actual Behavior: When a delegate is present, the Creating step occurs even though QMLTC is in use.

      Conclusion

      Delegates in Repeater, ListView, or similar QML elements cause QMLTC to revert to a runtime creation phase for compiled QML types. This diminishes one of the core benefits of QML Type Compiler—namely, speeding up application load times and component instantiation.

      Further investigation or a fix would be needed to ensure that delegates do not force a runtime creation step in QMLTC-compiled code.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              mikio_hirai Mikio Hirai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes