On this page

C

Building for Qt Quick Ultralite

This page provides general build steps for configuring and building projects that use Qt Safe Renderer and Qt Safe Monitor with Qt Quick Ultralite.

For a complete, step-by-step example for Infineon Traveo II, see: Qt Safe Monitor: Qt Quick Ultralite Example on Bare-Metal Traveo II.

The recommended approach is to structure the Qt Safe Monitor adaptation and Qt Quick Ultralite application as separate projects. You should build the Qt Safe Monitor adaptation first as an independent project, followed by the Qt Quick Ultralite application. The build instructions on this page are also divided into two parts accordingly. In this documentation, the Qt Safe Monitor adaptation project is called Monitor. Projects use CMake for building.

Building the Monitor

This section explains how to build the Qt Safe Monitor adaptation.

Build Configuration

The build configuration requires the following CMake variables:

  • QSR_SOURCE_DIR: Path to Qt Safe Renderer Runtime sources (typically <Qt installation directory>/Src/QtSafeRenderer-runtime-2.2.0).
  • SAFE_QMLS: One or more paths to safety-critical QML files. You can pass a single main QML file or a list.
  • SAFE_LAYOUT_FONTS: Directory containing the font files of the application.
  • SAFE_LAYOUT_CRC_ALGORITHM: CRC algorithm (crc32 for Renesas, mpeg2 for Traveo II).

To ensure Qt Safe Layout generation works correctly with Qt Quick Ultralite, place the following files in the same directory:

  • The main QML file.
  • QML files that contain safe items.

The build configuration requires the following environment variable:

Including Qt Safe Renderer Build Logic in CMake

Add the following to your main CMakeLists.txt to include the necessary Qt Safe Renderer modules and paths.

include(${QSR_SOURCE_DIR}/cmake/qsr_build.cmake)

Generating Monitor Data with CMake

Use the following CMake content in a dedicated target (a subdirectory of your project) to generate the monitor data library from the safe QML files:

include(${QSR_SOURCE_DIR}/cmake/qsr_generate_datalib.cmake)

add_qsr_monitor_data_library(qsrmonitordata
  SAFE_QMLS ${SAFE_QMLS}
  SAFE_LAYOUT_FONTS "${SAFE_LAYOUT_FONTS}"
  CRC_ALGORITHM "${SAFE_LAYOUT_CRC_ALGORITHM}"
  INSTALL ON
)

Build Process

The build process includes:

  • Building Qt Safe Renderer libraries (SafeRenderer, OutputVerifier, Monitor) into ${CMAKE_BINARY_DIR}/lib.
  • Generating monitor data from QML using the Qt Safe Renderer Monitor Config Tool.
  • Creating a data library with CRC values for verification.
  • Exporting header files to ${CMAKE_BINARY_DIR}/include for use in Qt Quick Ultralite application.

To build the project, run:

mkdir build
cd build
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=<Qt installation directory>/Src/QtSafeRenderer-runtime-2.2.0/cmake/<toolchain file for your target device> -DQSR_TARGET_TOOLCHAIN_DIR="<GHS compiler installation>" -DQSR_SOURCE_DIR=<Qt installation directory>/Src/QtSafeRenderer-runtime-2.2.0
cmake --build .

Use one of the following for the toolchain file:

  • Infineon Traveo II: ghs-armv7m.cmake
  • Renesas RH850 or similar: ghs.cmake

If you modify the QML layout, rebuild the project to regenerate the CRC data.

To enable hardware CRC calculation, add the CRC checking driver module to the Qt Safe Monitor adaptation. Refer to the following resources for guidance:

Building the Qt Quick Ultralite Project

This section explains how to build the Qt Quick Ultralite application with Qt Safe Renderer.

To get started with Qt Quick Ultralite, see: Getting Started with Qt Safe Renderer and Qt Quick Ultralite.

Build Configuration

The build configuration requires the following CMake variables:

  • QSR_SOURCE_DIR: Path to Qt Safe Renderer Runtime sources (typically <Qt installation directory>/Src/QtSafeRenderer-runtime-2.2.0).
  • MONITOR_BUILD_DIR: Path to the build directory of the Monitor project.

The build configuration requires the following environment variable:

Linking Qt Safe Monitor Libraries

After creating the Qt Quick Ultralite application, add the following lines to your CMakeLists.txt to enable monitoring support:

target_include_directories(<project_name> PRIVATE
    ${MONITOR_BUILD_DIR}/include
)

target_link_libraries(<project_name> PRIVATE
    ${MONITOR_BUILD_DIR}/lib/libSafeMonitor.a
    ${MONITOR_BUILD_DIR}/lib/libOutputVerifier.a
    ${MONITOR_BUILD_DIR}/lib/libqsrmonitordata.a
    ${MONITOR_BUILD_DIR}/lib/libSafeRenderer.a
)

For an example Qt Quick Ultralite application with safe items, see: Qt Safe Monitor: Qt Quick Ultralite Example on Bare-Metal Traveo II.

Available under certain Qt licenses.
Find out more.