Deploying QML Applications
This page provides information on how to deploy QML applications. It covers the use of Qt Creator for deployment, and the use of the Qt Resource System to package QML files and other resources with the application executable.
Deploying applications with Qt Creator
Qt Creator deploys and packages QML applications to various platforms. For mobile devices, Qt Creator can directly bundle applications to the respective platform package formats, such as APK.
When you run your applications on the target platform, your application needs to access the location of the QML libraries. If you use qmake, the QT_INSTALL_QML environment variable points to the location of the libraries. The Qt Installers install the QML libraries in: <version>/<compiler>/qml directory.
Using the Qt Resource System with QML
The Qt resource system allows resource files to be stored as binary files in an application executable. The Qt Resource System is used for QML application as it enables QML files and other resources – such as images and sound files – to be referred to through the resource system URI scheme rather than relative or absolute paths to filesystem resources.
Note: Usage of the resource system means that the application executable usually must be re-compiled whenever a QML source file is changed, to update the resources in the package.
The CMake QML Module API automatically places your QML files in the resource system. To access them, load your main QML file as a resource or as a URL with the qrc scheme. The path in the resource system where your QML files are placed can be found by concatenating:
- the
RESOURCE_PREFIXyou have passed to qt_add_qml_module. /qt/qml, if you have not passedRESOURCE_PREFIXto qt_add_qml_module and QTP0001 policy is set toNEW./, if you have not passedRESOURCE_PREFIXto qt_add_qml_module and QTP0001 policy isnotset toNEW.- If you have not passed
NO_RESOURCE_TARGET_PATHto qt_add_qml_module: theURIyou have passed to qt_add_qml_module with dots replaced by slashes.
For example, a module called My.Own.Module is placed at:
:/qt/qml/My/Own/Module/if you have specified/qt/qmlasRESOURCE_PREFIX, or you have not passedRESOURCE_PREFIXand QTP0001 policy is set toNEW.:/My/Own/Module/if you have specified/asRESOURCE_PREFIX, or you have not passedRESOURCE_PREFIXand QTP0001 policy is not set toNEW.:/Some/Prefix/My/Own/Module/if you have specifiedSome/Prefix/asRESOURCE_PREFIX:/if you have specifiedNO_RESOURCE_TARGET_PATH
Once this is done, all files specified by relative paths in QML are loaded from the resource system. Use of the resource system is completely transparent to the QML layer; this means all QML code should refer to resource files using relative paths and should not use the qrc scheme. This scheme should only be used from C++ code to refer to resource files.
Note: When using qmake, you need to manually place your files in the resource system. See the qmake Manual and the general documentation on the resource system for how to do this. It's advisable to still follow the path naming convention outlined above.
Related Information
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.