Building for QNX

To use Qt Safe Renderer and its examples on QNX target devices, you need to set up and build the following projects:

ProjectDescription.pro file name.pro file pathBuild with Qt version
Qt Safe Layout ToolQt Safe Layout Tool generates safe layout data for Qt Safe Renderer.qtsafelayouttool.pro<Qt installation directory>/Src/QtSafeRenderer-<version>/tools/qtsafelayouttoolQt that is compiled for your host platform.
Qt Safe Resource Compiler ToolQt Safe Resource Compiler Tool generates safe resource files for Qt Safe Renderer.qtsafercctool.pro<Qt installation directory>/Src/QtSafeRenderer-<version>/tools/qtsafercctoolQt that is compiled for your host platform.
Qt Safe RendererWhen 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:

ProjectDescription.pro file name.pro file pathBuild with Qt version
The Qt Cluster exampleQt Cluster demonstrates rendering on QNX and recovery from the main UI failure.qtcluster.pro<Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/qtclusterQt compiled for QNX
The Telltales exampleWhen 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.examples.pro<Qt installation directory>/Examples/QtSafeRenderer-<version>/saferendererQt compiled for QNX

Building Qt Safe Tools

Note: Since Qt Safe Renderer release 1.1.2 Qt Safe Layout and Qt Safe Resource 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:

  1. Start Qt Creator.
  2. Select File > Open File or Project and browse to a .pro file.
  3. Select Open.
  4. 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:

  1. Select a Projects mode.
  2. In the kit, select Build.
  3. Select Build Settings > Build Steps > Add Build Step > Make.
  4. In Make arguments, add install.
  5. 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/qt5.9.2/install/qnx7-armle-v7/bin/.

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. You must also add some modifications to the Qt Base source code so that it supports Qt Safe Renderer for QNX. The following topics describe how you get Qt sources, how you should modify them, and how you build Qt from sources:

Getting Qt Sources

You can download the Qt source code via your Qt Account.

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.

Modifying Qt Base for Qt Safe Renderer

To add Qt Safe Renderer support in the qtbase repository, you need to modify the QNX platform plugin code file qqnxwindow.cpp under the path qtbase/src/plugins/platforms/qnx/. Add an include of QDebug as follows:

#include <QtCore/QDebug>
#include <QDebug> // add this line to qqnxwindow.cpp
#include <errno.h>

Update QQnxWindow::setBufferSize(const QSize &size) as follows:

if (nonEmptySize == m_bufferSize || format == -1)

int pipeline = 1; // add this line
screen_set_window_property_iv(m_window, SCREEN_PROPERTY_PIPELINE, &pipeline); // add this line

        screen_set_window_property_iv(m_window, SCREEN_PROPERTY_FORMAT, &format),
        "Failed to set window format");

The following code provides all the required updates in a .patch file format:

 src/plugins/platforms/qnx/qqnxwindow.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 30288cc..c2702b1 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -52,7 +52,7 @@
 #include "private/qguiapplication_p.h"

 #include <QtCore/QDebug>
+#include <QDebug>
 #include <errno.h>

 #if defined(QQNXWINDOW_DEBUG)
@@ -355,6 +355,9 @@ void QQnxWindow::setBufferSize(const QSize &size)
     if (nonEmptySize == m_bufferSize || format == -1)

+    int pipeline = 1;
+    screen_set_window_property_iv(m_window, SCREEN_PROPERTY_PIPELINE, &pipeline);
             screen_set_window_property_iv(m_window, SCREEN_PROPERTY_FORMAT, &format),
             "Failed to set window format");

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.9.3)):

./configure -confirm-license -commercial -release -xplatform \
qnx-armle-v7-qcc -opengl es2 -nomake tools -skip qtactiveqt \
-skip qtandroidextras -skip qtconnectivity -skip qtdoc -skip qtenginio \
-skip qtlocation -skip qtmacextras -skip qtsensors -skip qtserialport \
-skip qtwinextras -skip qtx11extras -openssl -nomake examples -nomake tests \
-force-debug-info -separate-debug-info -skip qtwebengine -no-fontconfig \
-prefix /opt/qt5.9.3/install/qnx7-armle-v7

Build Qt with the make command in the terminal. You can run make with as many cores on your host machine as you desire. In our example we use six cores:

make -j6

Building Qt Safe Renderer and Examples

After you have built Qt, you can start Qt Creator and build the Qt Safe Renderer and its QNX specific examples, Telltales and Qt Cluster.

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.

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:

  1. Connect your target device to Qt Creator.
  2. In Qt Creator, select Tools > Options > Devices > Devices.
  3. Under Device, select your QNX device.
  4. 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.