-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ahead-of-time compilation of QML #242
Comments
There is also the And we should support commercial tools as well. |
After reading various posts on the Qt blog and the documentation for the upcoming Qt 6.5 release, I have a better understanding of the various QML processing tools and how to approach this. Originally, in Qt 5, qmlcachegen only generated precompiled bytecode from QML files to improve startup performance. qmake could automatically call qmlcachegen and add the generated bytecode to the Qt resource system. In Qt 5, qmlcachegen didn't optimize runtime performance though. This has changed in Qt6. qmlcachegen can now compile some parts of QML to C++ files containing "QML compilation units", which include the compiled parts of the QML and the rest as bytecode embedded into the C++ files. qmlsc does the same thing as qmlcachegen but can compile QML to C++ in more cases. qmlsc is not open source and it doesn't seem it will be, but I'm not entirely sure. qmltc works differently than both qmlcachegen and qmlsc. It generates C++ classes from the QML files which are more efficient at runtime than the "QML compilation units" generated by qmlcachegen & qmlsc. However, qmltc only works with a limited subset of QML, so using it must be optional. In Qt 6.3 - 6.4, C++ headers generated by qmltc need to be So, qmlcachegen is helpful in any case when qmltc isn't used. However, qmlcachegen in Qt 6 has some new command line options in Qt 5 which are used by the qt_add_qml_module CMake function, so figuring out how to use qmlcachegen with Qt5 would require examining how qmake works with it. In the end, it might require substantially different code between Qt 5 and Qt 6. Considering that drawback, and that qmlcachegen only speeds up load time but not run time in Qt 5, I suggest only supporting qmlcachegen for Qt 6 (qmltc was added in Qt 6.3). |
For examining how the |
I asked about this on a recent Qt blog post and this isn't quite right. qmlcachegen is always helpful. qmltc can be used together with qmlcachegen; they work on different aspects of speeding up QML. |
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This is detailed in a new blog post now that Qt 6.5 has been released: https://www.qt.io/blog/whats-new-for-qml-modules-in-6.5 |
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (KDAB#242)
This avoids the need to repeatedly specify the URI and version of the QML module in the bridges. QObjects that are registered as QML elements are now marked by [cxx_qt::qobject(qml_element = "OptionalName")] This is a precursor to generating qmldir files which are required for qmlcachegen and qmltc (#242)
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen KDAB#242
This is a prerequisite for using qmlcachegen #242
It would be nice if qt-build could call qmlcachegen (Qt5) or qmlsc (Qt6).
https://www.qt.io/blog/the-new-qtquick-compiler-technology
However qmlsc is not open source yet:
https://doc.qt.io/qt-6/qtqml-tool-qmlsc.html
The text was updated successfully, but these errors were encountered: