C
Building for QNX
To use Qt Safe Renderer with QNX, you need to build Qt and Qt Safe Renderer yourself from sources. When you build Qt Safe Renderer, you must build Qt Safe Renderer Runtime before building Qt Safe Renderer Tooling.
Note: Qt Safe Renderer 2.1.0 RC 2 supports building with Qt 6.5.6 onwards.
Preconditions
Install Qt Safe Renderer and Qt sources as instructed in Installing Qt Safe Renderer. In Qt Online Installer Select component page, select the QNX target to the get pre-built CalcCRC library:
Note: You can also get the Qt sources via the Git version control system. Qt Wiki provides instructions for getting Qt sources via Git, see https://wiki.qt.io/Building_Qt_6_from_Git#Getting_the_source_code.
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
To set the pipeline for Qt Safe Renderer, set the QSR_QNX_SCREEN_PIPELINE
environment value as follows:
export QSR_QNX_SCREEN_PIPELINE = 2
Configuring Display Index for Qt Safe Renderer
To specify the display index used by Qt Safe Renderer, set the QSR_QNX_SCREEN_DISPLAY
environment variable. The display index determines which screen the renderer outputs to. For instance:
export QSR_QNX_SCREEN_DISPLAY=1
Make sure this environment variable is set according to your system configuration to ensure that Qt Safe Renderer renders on the correct display.
Setting Z-Order for Qt Safe Renderer Windows
Adjust the stacking order of your Qt Safe Renderer window by setting the QSR_QNX_SCREEN_ZORDER
environment variable. A higher z-order value places the window above others with lower values. Example:
export QSR_QNX_SCREEN_ZORDER=3
Properly configuring the z-order ensures that your Qt Safe Renderer window is correctly layered in relation to other windows on the screen.
Setting QNX Pipeline for Qt Applications
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 the following environment variables when building 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.
After you have successfully enabled the OpenWFD plugin, you see OpenWFD graphics adaptation in the CMake output log.
Building Qt from Sources
See Building Qt for QNX for detailed instructions about how to build Qt for host and for QNX.
Note: In the toolchain file, set arch
value to gcc_ntoaarch64le
.
Building Qt Safe Renderer from Sources
When you build Qt Safe Renderer for QNX, you must build Qt Safe Renderer Runtime before building Qt Safe Renderer Tooling. Build both components for your host environment and QNX.
Building Qt Safe Renderer for Host Environment
First, build Qt Safe Renderer Runtime for host as follows:
mkdir <build directory> cd <build directory> <Qt installation directory>/host/bin/qt-cmake <path to QSR Runtime sources> cmake --build . cmake --build . --target install
Build Qt Safe Renderer Tooling for host as follows:
mkdir <build directory> cd <build directory> <Qt installation directory>/host/bin/qt-cmake <path to QSR Tooling sources> cmake --build . cmake --build . --target install
Building Qt Safe Renderer for QNX
First, build Qt Safe Renderer Runtime for QNX as follows:
<Qt installation directory>/<QNX target>/bin/qt-cmake <path to QSR Runtime sources> cmake --build . cmake --build . --target install
Build Qt Safe Renderer Tooling for host as follows:
<Qt installation directory>/<QNX target>/bin/qt-cmake <path to QSR Tooling sources> cmake --build . cmake --build . --target install
Available under certain Qt licenses.
Find out more.