Veethree D7 SDK
Loading...
Searching...
No Matches
Setup the D7 SDK to use in Qt Creator

Note
In order to use Qt libraries you must have your own Qt development and distribution licenses. Please refer to https://www.qt.io/qt-licensing for more information.

We will use the QML application from the examples/gui/qml-analog directory as an example. As seen on the Building a QML application using the D7 SDK page, this example demonstrates integrating the D7 SDK and Qt libraries into a single application.

Installing Qt Creator

Please refer to the guide for installing Qt for the necessary steps to install the Qt libraries and Qt Creator.

Please make a note of the installation directory for the Qt libraries. It will be required later.

The reference documentation for installing Qt Creator can be found here.

Adding the D7 SDK as a Kit in Qt Creator

Linux

$HOME/d7-sdk/shortcuts/sdk-qt-configurator.sh

Windows

%USERPROFILE%\d7-sdk\shortcuts\sdk-qt-configurator.bat

Follow the instructions it displays to enable the Qt Kit configuration for the device. For parameters reference, see the --help option.

The path to sdktool is required for the sdk-qt-configurator script. Qt does not provide a standardised way of determining its location, so you will have to enter the path manually.

That will normally be in Qt's installation directory, under Tools/sdktool/libexec/qtcreator/sdktool. Assuming Qt was installed in the default path, the sdktool should be at $HOME/Qt/Tools/sdktool/libexec/qtcreator/sdktool.

Note: Make sure to use the absolute path to the sdktool. It will not work with relative paths or paths that start with ~.

Please refer to Qt's documentation page for finding the path to the sdktool.

After running the script, you will need to restart Qt Creator to see the change. A Qt kit named VeethreeD7 will be created.

Removing the D7 SDK Kit from Qt Creator

If you configured a Qt Creator kit and wish to uninstall it, from the D7 SDK installation directory, navigate to the shortcuts folder and run qt-kit-uninstall, then follow the on-screen instructions to remove it.

Linux

cd $HOME/d7-sdk/shortcuts/
./qt-kit-uninstaller.sh

Windows

cd %USERPROFILE%\d7-sdk\shortcuts
.\qt-kit-uninstaller.bat

The path to Qt's sdktool is necessary for removing the kit, so please check the previous section for instructions on finding the path.

After running the qt-kit-uninstall script, you will need to restart Qt Creator to see the changes. The VeethreeD7 kit will have been removed.

Opening and building the QML example app

Open Qt Creator, click on "Open Project..." and navigate to the SDK installation directory, then into the examples/gui/qml-analog directory and double click on CMakeLists.txt.

Select QML project

Tick the option for using the VeethreeD7 kit.

VeethreeD7 Kit selection

Click on "Manage Kit" and make VeethreeD7 the default kit.

Manage kit
Make default kit

Click "Apply", then click on "Configure Project" in the bottom-right corner.

There should be no errors in configuring the project.

Running the application on the device via Qt Creator

You will need to add the device into Qt Creator. Please refer to Qt's guide for doing so: https://doc.qt.io/qtcreator/creator-how-to-add-remote-linux.html.

When prompted for the device configuration, set the D7's IP address, the port to 22 and the username to root.

Device config

Make sure the "Source /etc/profile and $HOME/.profile" option is checked.

Source environment

Click the "Play" button. The application should start running on the device.

Debugging the application while running on the device

Remarks
This will only work using the development image, as debugging on the device requires gdbserver

The release image does not contain a debugger. See the differences between release and development images.

To test that debugging the application while it's running on the target device works, open the main.cpp file and set a breakpoint on the line that loads the ui from the "Main" module (line 19 in the screenshot).

Setting a breakpoint

Then you will need to make sure that the project will run on the target device by checking that the "Run device" is set to your D7, the "Kit" is set to "VeethreeD7" and "Deploy" is set to "Deploy to Remote Linux Host":

Selecting the D7 device

You should now be able to launch the project with a debugger attached:

Launch with debug

Running the application on the host via Qt Creator

As mentioned in the host build section of the previous page, applications built for the host that use Qt libraries will use the libraries installed outside of the D7 SDK.

The Qt versions must match between the D7 SDK and the Qt libraries installed separately. Please refer to the guide for installing Qt to check the currently supported version.

Qt Creator host build kit

It is good practice to clone the default Desktop Kit from Qt Creator and modify it as described below.

Clone the desktop kit

Add the following environment variables in the Build Environment. This guide assumes the default installation directories for Qt and for the D7 SDK.

CMAKE_PREFIX_PATH=$HOME/Qt/6.8.3/gcc_64:$HOME/d7-sdk/toolchain/sysroots/x86_64-veethree-linux/usr
QT_HOST_PATH=$HOME/d7-sdk/toolchain/sysroots/x86_64-veethree-linux/usr
OECORE_NATIVE_SYSROOT=$HOME/d7-sdk/toolchain/sysroots/x86_64-veethree-linux
Edit the desktop kit

Restart Qt creator.

Configuring the project

Launch Qt Creator and open the qml-analog project by double-clicking on the CMakeLists.txt file. When prompted for a kit selection, make sure to select the cloned kit from the previous step

Select cloned kit

And click on "Configure Project".

This should run without errors.

Launching the project

Select the cloned desktop kit in the section on the bottom left:

Select cloned desktop kit for running

It should now be possible to run the application by just pressing the green "Play" button.

(Optional) Troubleshooting

If an error similar to this occurrs:

EGL not available error

Try unchecking Add build library search path to LD_LIBRARY_PATH in the "Run" configuration of the cloned desktop kit.

Cloned kit run configuration

Summary

In this section we have described setting up Qt Creator to be able to build applications for the device using the D7 SDK and deploy them to a development board.

Previous step

Building a QML application using the D7 SDK

Next step

The next step now is creating a software update image and flashing it onto the device. Next page