C
Building for QNX
In Qt Safe Renderer 2.0, Qt Safe Renderer binaries built with Qt 5.15.13 are included to the installation. However, if you like to build Qt Safe Renderer for QNX yourself, follow instructions in this topic.
Qt Safe Renderer and its tools are built via the following projects:
Project | Description | .pro file name | .pro file path | Build with Qt version |
---|---|---|---|---|
Qt Safe Layout Tool | Qt Safe Layout Tool generates safe layout data for Qt Safe Renderer. | qtsafelayouttool.pro | <Qt installation directory>/Src/QtSafeRenderer-<version>/tools/qtsafelayouttool | Qt that is compiled for your host platform. |
Qt Safe Resource Compiler Tool | Qt Safe Resource Compiler Tool generates safe resource files for Qt Safe Renderer. | qtsafercctool.pro | <Qt installation directory>/Src/QtSafeRenderer-<version>/tools/qtsafercctool | Qt that is compiled for your host platform. |
Qt Safe Renderer | When you build Qt Safe Renderer, the Qt Safe Renderer plugins are built and installed under the current kit in Qt Creator (that is, the Qt version that you use for building the projects). | qtsaferenderer.pro | <Qt installation directory>/Src/QtSafeRenderer-<version> | Qt compiled for QNX. |
For QNX, Qt Safe Renderer provides the following examples:
Project | Description | .pro file name | .pro file path | Build with Qt version |
---|---|---|---|---|
The Qt Cluster example | Qt Cluster demonstrates rendering on QNX and recovery from the main UI failure. | qtcluster.pro | <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/qtcluster | Qt compiled for QNX |
The Telltales example | When you build Telltales, you must use the Qt compiled for QNX. Then the QNX specific part of the project is built. The Process Watcher project is built together with the QNX specific Telltales. Telltales uses layout files from the Qt Cluster example. | examples.pro | <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer | Qt compiled for QNX |
The Indicators example | Indicators demonstrates the Qt Quick Designer related functionality. | indicators.pro | <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/indicators/indicators.pro | |
The Monitor example | Monitor demonstrates how you can verify the rendering output of the Indicators example. | Monitor.pro | <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/monitor/monitor.pro | |
The Localization example | Localization demonstrates how you can localize content in safety-critical elements. | localization.pro | <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/localization/localization.pro |
Building Qt Safe Tools
Note: Since Qt Safe Renderer release 1.1.2 Qt Safe Layout and Qt Safe Renderer Compiler Tools are available as a pre-built package in <Qt installation directory>/Tools/QSR-<version>/bin. You can skip this step if you do not intend to build the tool yourself.
To build Qt Safe Tools in Qt Creator, execute the steps listed in the following topics for qtsaferenderer.pro
. Build the project with a Qt version that is compiled for your host platform. After a successful build, qtsafelayouttool and qtsafercctool are generated under <Qt installation directory>/<Qt version>/<compiler>/bin.
Opening Project to Edit Mode
Open the project to Qt Creator's Edit mode:
- Start Qt Creator.
- Select File > Open File or Project and browse to a .pro file.
- Select Open.
- In the Configure Project page, choose a kit for building the project and select Configure Project.
The project is now open in Qt Creator's Edit mode.
Adding a Custom Build Step <make install>
Note: If you are building some of the examples in Qt Safe Renderer, you can skip this step.
Before building Qt Safe Renderer, add a custom build step that installs the binary file under <Qt installation directory>/<Qt version/<compiler>/bin in the Qt version that is used for building the project:
- Select a Projects mode.
- In the kit, select Build.
- Select Build Settings > Build Steps > Add Build Step > Make.
- In Make arguments, add install.
- Select the Edit mode. Your custom build step is automatically saved.
Building the Project
Build the project in the Edit mode by selecting Build > Build Project "<project name>".
Setting Up Cross Compiling Environment
Copy the Qt Safe Layout Tool binary file (qtsafelayouttool) and Qt Safe Resource Compiler Tool binary file (qtsafercctool) to the directory in your cross compiling environment that contains the qmake executable.
You find the pre-built qtsafelayouttool and qtsafercctool in <Qt installation directory>/Tools/QSR-<version>/bin or, when self-built, in <Qt installation directory>/<Qt version>/<compiler>/bin.
For example, copy the Qt Safe Tool binary files under /opt/qt15.5.13/install/qnx7-armle-v7/bin/.
Setting Up QNX Environment
To build Qt Safe Renderer and its examples for QNX, you must modify your environment for QNX.
To ensure the proper functioning of Qt Safe Renderer and Qt applications, configure the pipelines and layers in the graphics.conf file. Each application should have its own pipeline to avoid interference between Qt Safe Renderer and the Qt application.
Set up the pipeline for the Qt application on the background layer as follows:
begin class framebuffer display = 1 pipeline = 1 format = rgba8888 usage = gles2 end class
Set up the pipeline for Qt Safe Renderer on the foreground layer as follows:
begin class framebuffer display = 1 pipeline = 2 format = rgba8888 usage = inteldrm end class
For more information, see Configuring Screen in QNX.
Setting QNX Pipeline for Qt Safe Renderer
From Qt Safe Renderer 1.2 onwards, to set the pipeline for Qt Safe Renderer, you need to set the QSR_QNX_SCREEN_PIPELINE
environment value as follows:
export QSR_QNX_SCREEN_PIPELINE = 2
Setting QNX Pipeline for Qt Applications
From Qt 5.15.3 onwards, you must define the QNX pipeline for Qt applications by setting the _q_platform_qnxPipeline
window property as follows:
if defined(Q_OS_QNX) view.setProperty("_q_platform_qnxPipeline", 1); endif
The pipeline value 1 is the default value for the background layer.
You find the full example code under saferenderer/qtcluster/main.cpp.
Enabling OpenWFD platform adaptation
It is possible to use the OpenWFD platform adaption instead of QNX Screen with the Qualcomm Snapdragon hardware. You can enable the OpenWFD plugin by setting following environment variables when building the Qt Safe Renderer:
WFD_INCLUDE WFD_LIB
The WFD_INCLUDE
path must point to the folder where the OpenWFD headers are located. The WFD_LIB
path must point to the folder where the OpenWFD libraries are located.
Note: When you use the OpenWFD platform adaptation, the surface width must be divisible by 64.
Building Qt Safe Renderer and Examples
To build Qt Safe Renderer and its examples for QNX, you must first configure and build Qt from sources.
Getting Qt Sources
You can download the Qt source code via your Qt Account. This step is optional as you can use the QNX binaries from the Qt Online Installer instead.
You can also get the Qt sources via the Git version control system. Qt Wiki has instructions for getting Qt sources via Git, see https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_source_code.
Configuring and Building Qt for QNX
Configure Qt for QNX by running the following command in a terminal (note that the following example configures Qt 5.15.13:
./configure -confirm-license -commercial -release -xplatform \ qnx-aarch64le-qcc -opengl es2 -nomake tools -skip qtactiveqt \ -skip qtandroidextras -skip qtconnectivity -skip qtdoc \ -skip qtlocation -skip qtmacextras -skip qtsensors -skip qtserialport \ -skip qtwinextras -skip qtx11extras -no-openssl -nomake examples -nomake tests \ -force-debug-info -separate-debug-info -skip qtwebengine -no-fontconfig \ -prefix /opt/qt5.15.13/install/qnx7_armv8
Build Qt with the make command in the terminal. You can run make with as many cores on your host machine as you desire:
make -j
Setting up Qt Creator
In Qt Creator, you must set the path to the QNX environment script as follows:
- Select Tools > Options > Devices > QNX.
- Select Add.
- Enter the path for the file qnxsdp-env.sh that is included in QNX Software Development Platform (SDP). By default, the path is /opt/qnx700 in Linux and C:\qnx700 in Windows.
- Select Open.
- Select Generate kits.
After you have set the path, it appears to Host and Target fields under Configuration information.
To enable a QNX build in Qt Creator, you must set the Qt version with Qt Safe Renderer related QNX modifications to your kit. See Adding Kits.
Building Examples for QNX
You can build Qt Safe Renderer, Telltales, and Qt Cluster for QNX with the same steps that are described in Building Qt Safe Tools. Just remember that in Opening Project to Edit Mode, you must select the kit that contains the Qt Safe Renderer changes for QNX. The kit is selected from the Configure Project page.
When you build the Telltales example, also a Process Watcher project is built.
Deploying to Target Device
You need to deploy Qt Cluster and Telltales to your QNX target device. When you deploy Telltales, also Process Watcher is deployed. You can deploy the projects in Qt Creator with the following steps:
- Connect your target device to Qt Creator.
- In Qt Creator, select Tools > Options > Devices > Devices.
- Under Device, select your QNX device.
- Select Deploy Qt libraries.
After you have deployed the Qt libraries to your QNX device, also all Qt Safe Renderer libraries are copied to the device.
Available under certain Qt licenses.
Find out more.