Use the qmlprojectexporter to export the QML sources, image assets and fonts into compilable c++ code. It parses a
.qmlproject file listing the assets with exporting options, and converts them. In addition, qmlprojectexporter also exports plain-text lists of the imported and exported files, for convenient automatic use by a 3rd party build system, such as CMake.
qmlprojectexporter with a CMake build system is straightforward and the custom CMake macro qul_add_target already takes care of calling
qmlprojectexporter with the right parameters, and it requires defining the "QML_PROJECT" argument followed by a qmlproject file as shown next.
qul_add_target(my_project QML_PROJECT my_project.qmlproject)
qmlprojectexporter, the following CMake macros are not needed as calling
qmlprojectexporter implies the same logic:
Also setting the following target properties from CMake is not required
app_target_setup_os(myproject) // With a \c Main.qml (specified only as Main) being the entrypoint app_target_default_entrypoint(swipe_game_qmlproject Main)
When using a build system other than CMake it is still possible to use
qmlprojectexporter directly. It generates the asset files, which you could use with a build system of your choice.
qmlprojectexporter --outdir output_directory myproject.qmlproject
To simplify Qt for MCUs project integration either with a workflow using the GHS Multi IDE or other build systems,
qmlprojectexporter can export project files containing the generated UI sources together with exported platform sources for the targeted platform.
For more information about this feature, refer to Exporting a Qt for MCUs project with platform sources
This executable was introduced in QmlProject API 1.3.
Available under certain Qt licenses.
Find out more.