Adding the QRC file

To make it easier to deploy and run the application on the target, you can include the main QML file in a Qt resource (QRC) file. A resource file packages many components including QML files, images, and fonts into the binary so you don't have to deploy them alongside the binary on the target.

Note: In addition to compiling resources into their binaries, applications can access resources directly from the target's filesystem. Deciding whether to use a resource file is a design decision. More information about resource files and how to package Qt binaries can be found on Digia's Qt website: http://qt-project.org/doc/qt-5/resources.html.
To add a QRC file and include the main QML file in it:
  1. In the Project view, right-click the QtHmi folder and click Add New...
  2. In the New File dialog, select Qt in the Files and Classes list, then Qt Resource file in the list of file types (shown in the middle), then click Choose...
  3. In the Location page of the resulting dialog, name the file resources, then click Next.
  4. In the Summary page, click Finish.

    A new file, resources.qrc, has been added to the project and opened in Qt Creator for editing.

  5. In the configuration area near the bottom, click Add, then choose Add Prefix.
  6. In the Prefix field, enter qml.

    Prefixes add structure to the resource file. Any prefix scheme can be used, as long as you organize your resources in a way that makes sense for the developers working on the project.

  7. Click the Add button again, then choose Add Files.
  8. In the file selector that the IDE opens, navigate to and select main.qml, then click Open.

    This QML file is found in the folder specified on the Create in line in the Empty Qt Project dialog, which was opened when the project was created.

The QML file is now part of the Qt resource file that will be compiled into the binary.