|
Veethree D7 SDK
|
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.
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.
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.
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.
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.
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.
Tick the option for using the VeethreeD7 kit.
Click on "Manage Kit" and make VeethreeD7 the default kit.
Click "Apply", then click on "Configure Project" in the bottom-right corner.
There should be no errors in configuring the project.
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.
Make sure the "Source /etc/profile and $HOME/.profile" option is checked.
Click the "Play" button. The application should start running on the device.
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).
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":
You should now be able to launch the project with a debugger attached:
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.
It is good practice to clone the default Desktop Kit from Qt Creator and modify it as described below.
Add the following environment variables in the Build Environment. This guide assumes the default installation directories for Qt and for the D7 SDK.
Restart Qt creator.
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
And click on "Configure Project".
This should run without errors.
Select the cloned desktop kit in the section on the bottom left:
It should now be possible to run the application by just pressing the green "Play" button.
If an error similar to this occurrs:
Try unchecking Add build library search path to LD_LIBRARY_PATH in the "Run" configuration of the cloned desktop kit.
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.
Building a QML application using the D7 SDK
The next step now is creating a software update image and flashing it onto the device. Next page