C

Deploying Qt Projects with Boot to Qt

After you have flashed the Boot to Qt Software Stack to your target device, you can deploy all kinds of Qt applications into your device via Qt Creator. Deploying is done when you run the application. See Tutorial: Deploying Your First Project with Boot to Qt for detailed steps that are related to deploying applications via Qt Creator.

The following sections provide general information about deploying with the Boot to Qt Software Stack:

Target Path of Deployed Application

Qt Creator deploys the application binaries and resources to the /opt/$${TARGET}/bin directory. Therefore, the path variable for the INSTALLS target needs to be adjusted accordingly in an application's project (.pro) file.

When you create a new Qt Quick application project with Qt's project wizard, the generated project automatically contains a path variable for INSTALLS targets. Thus you can deploy the generated Qt Quick project without any further modifications.

In the following situations, you must manually add the path variable for the INSTALLS target to a .pro file:

  • You create a new widget project with Qt's project wizard.
  • You create a new console project with Qt's project wizard.
  • You want to deploy an existing project that does not yet set the path variable for the INSTALLS target.

Setting Path Variable for INSTALLS Target

If you need to manually update your application's .pro file with the path variable for the INSTALLS target, add the following lines to the .pro file:

target.path = /opt/$${TARGET}/bin
INSTALLS   += target

Above, $$TARGET expands to the application target (executable) name.

Deploying Application Resources

The QML files, images, and other resource files used by an application can be stored into the application executable using the Qt resource system. This way, simply deploying the application binary is all that is required for deploying also the resources.

Alternatively, you can list the files in an application's .pro file as follows:

appFiles.files = \
    image1.png \
    image2.png \
    qml
appFiles.path = /data/user/qt/$$TARGET
INSTALLS += appFiles

Above, two PNG images from the application source directory, and the entire qml subdirectory are included in the deployment.

Note: From Qt Creator 4.2.0 onwards, wildcards are not supported.

Custom Deployment Steps

Qt Creator allows you to execute custom commands on the embedded device connected to the development host. You can add the custom commands to the deployment phase of your project.

To add a custom step to be executed during deployment:

  1. In Qt Creator, go to Projects > Run for the Boot to Qt version you want to customize.
  2. Click Add Deploy Step and select Run custom remote command.
  3. Enter the command to be executed.

Using Squish with Boot to Qt

Embedded Squish hook binaries, also known as Squish hooks, provide interaction between Squish and Application Under Test (AUT) during software testing. Squish hooks are built in to the Boot to Qt image.

Before using Squish, make sure that you define the development target IP address and port in your development host. The port needs to be the same in target and host. For instructions on how to define IP address and port, see Manage AUTs pane in Squish documentation.

To start your application in Squish, refer to instructions in Attaching to Running Applications in Squish documentation. To start your application in Qt Creator, give the Squish port-number as a parameter:

  • In Qt Creator, go to Projects > Build & Run > Run > and add -plugin squish:port-number in Command line arguments field.

For more information on Squish, see Squish documentation.

Available under certain Qt licenses.
Find out more.