C
Building and Running Embedded Applications
Building and Running an Example
After you complete the installation and configuration steps for Qt for Device Creation and the target devices, you can test the setup by creating a simple Qt Quick application and running it on the device:
- Make sure that your device is powered on and connected to the development host.
- In Qt Creator, select File > New File or Project > Applications > Qt Quick Application > Choose.
- Choose a location for your new project.
- In the Qt Quick Component Set dialog, select Qt Quick 2.2 or Qt Quick 2.2 Boot2Qt.
- In the Kit Selection dialog, select the kits for your devices. You can also select the emulator kit to test running the project in the emulator.
- Click Next and finish the wizard.
- In Projects > Build & Run, select the correct kit for your connected device.
- To build and run the project, click
Building and Running Boot to Qt Demos
You can find the Boot to Qt demo applications in Qt Creator.
- Go to Welcome > Examples.
- Select a Boot2Qt Qt version from the drop-down list.
- Select a demo you want to build.
- In Projects > Build & Run, select the correct kit for your connected device or emulator.
- To build and run the project, click
Setting Up an Already Existing Project for Deployment
New Qt Quick application projects generated by Qt Creator always have the correct settings for deployment on the device or emulator. However, other projects need some changes. This includes projects created using the File > New File or Project > Applications > Qt Widget Application template.
As a general rule, application binaries and resources are deployed to the /data/user/qt/<APPLICATION_NAME>
directory. Therefore, the path
variable for the INSTALLS
targets needs to be adjusted accordingly in .pro files.
Open the .pro file and define the target.path
and INSTALLS
variables as follows:
target.path = /data/user/qt/$$TARGET INSTALLS += target
Above, $$TARGET
expands to the application target (executable) name.
Deploying Application Resources
If the application depends on additional resources (such as QML files and images), you need to deploy them as well. For example:
appFiles.files = *.png qml appFiles.path = /data/user/qt/$$TARGET INSTALLS += appFiles
Above, all PNG images from the application source directory, and the entire qml subdirectory are included in the deployment.
Alternatively, the files used by the application can be stored into the application executable using the Qt resource system. This way, simply deploying the application binary is all that's required.
Using Qt Quick Controls
The Boot to Qt stack supports the full set of Qt modules, including Qt Quick Controls. However, a number of UI controls from that module are implemented in a way that's currently not supported:
These controls attempt to open a new top-level window, while in Boot to Qt, Qt Quick applications can only have a single fullscreen window existing at a time.
See the related entry in Troubleshooting.
Available under certain Qt licenses.
Find out more.