Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
6.5.3
-
None
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.
- 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.
- 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.
- 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
- duplicates
-
QTBUG-105898 Teach views/QQmlComponent how to use qmltc's generated classes
-
- Reported
-
- relates to
-
QTBUG-134236 Add Known Limitations for ListElement, Delegate Creation, and Virtual Keyboard to QML Type Compiler
-
- Reported
-