C
Qt Quick Ultralite application with safety-critical items
This topic provides instructions on how to create a Qt Quick Ultralite application with safety-critical items.
Note: Qt Safe Renderer is currently in Technical Preview status for Qt Quick Ultralite. A full Qt Safe Renderer support for Qt Quick Ultralite comes in the QSR 2.2 release.
Functional safety
The objective of functional safety is to avoid an unacceptable risk of injury or damage to the health of people.
- In the automotive industry, it is essential that safety-critical information in the digital displays is rendered correctly.
- In the medical industry, nurses, doctors, and technicians use safety-critical medical devices that must be safe to use.
- In the automation industry, there is a need for well-placed, prominent error indicators.
For more information about functional safety, see the Qt Safe Renderer documentation.
Safety-critical QML items
The Qt Quick Ultralite Safe Renderer QML module provides safety-critical QML items whose integrity can be monitored using Qt Safe Renderer's output verification. This involves verifying that the visual output matches what is expected.
Creating an application with safety-critical QML items
- Add a Safe Renderer QML module to your project
- Set a fixed size for the application root element, for example:
Rectangle { width: 480 height: 272 // ... }
The Qt Safe Layout Tool requires this for the item offset calculation.
- Add the SafeRenderer QML items to the QML application:
SafePicture { id: handbrake objectName: "handbrake" source: "images/iso_grs_7000_4_0238.dat" color: "#e41e25" fillColor: "#000000" width: 30 height: 30 }
Set
objectName
and a fixedwidth
andheight
for each safe item. SetfillColor
to fully opaque for items whose integrity will be monitored with Qt Safe Renderer's output verification.Note: An invisible safe item appears as a visible rectangle with the color of
fillColor
.Note: The parent items of a safe item will appear normally even when they are set to be invisible.
Note: Safe items can't be positioned using Column, Row, GridLayout, ColumnLayout, or RowLayout.
- Run Qt Safe Layout Tool to generate safe layout data, for example:
qtsafelayouttool.exe safe_items.qml -o layoutData
The following safe layout data is generated:
- An
.srb
file is generated for each static safe QML type that you have added to the canvas. The file contains the compressed bitmap data. - An
.srt
file is generated for each dynamic SafeText QML type that you have added to the canvas. The.srt
file contains the following metadata for the layout:- Text layout width and height.
- The file name of the font.
- Cyclic redundancy check (CRC) in the font file.
- Horizontal and vertical alignment details.
- Text and a text color details.
- A
.qpf2
file is generated for each font type that you use in the dynamic SafeText QML type. The file contains the font data. - An
.srl
file is generated for the Qt Quick Ultralite application. The file contains the raw layout data.
- An
- Add the
.srb
(Safe Renderer Bitmap) files to ImageFiles with MCU.resourceKeepRawData astrue
.- For the SafeImage and SafePicture resources set MCU.base and MCU.prefix so that the path prefix matches with the SafePicture instance's
source
property. - For the SafeText resources set MCU.base so that the URI contains only the file name without the path.
ImageFiles { files: [ "layoutData/drive_40x50_000000.srb", // SafeImage image data "layoutData/iso_grs_7000_4_0238_30x30_e41e25_000000.srb", // SafePicture image data ] MCU.base: "layoutData" MCU.prefix: "images" MCU.resourceKeepRawData: true } ImageFiles { files: [ "layoutData/safeUnitText_72x40_8ae234_000000.srb" // SafeText image data (runtimeEditable as false) ] MCU.base: "layoutData" MCU.resourceKeepRawData: true }
In this example the
layoutData/iso_grs_7000_4_0238_30x30_e41e25_000000.srb
resource URI would beimages/iso_grs_7000_4_0238_30x30_e41e25_000000.srb
, and thelayoutData/safeUnitText_72x40_8ae234_000000.srb
resource URI would besafeUnitText_72x40_8ae234_000000.srb
. - For the SafeImage and SafePicture resources set MCU.base and MCU.prefix so that the path prefix matches with the SafePicture instance's
- Add the
.srt
and.qpf2
files to BinaryFiles:BinaryFiles { files: [ "layoutData/safeText.srt", "layoutData/lato_32_400.qpf2" ] MCU.base: "layoutData" }
For the SafeText resources set MCU.base so that the URI contains only the file name without the path.
In this example the
layoutData/safeText.srt
resource URI would besafeText.srt
, and thelayoutData/lato_32_400.qpf2
resource URI would belato_32_400.qpf2
.
Monitoring the UI elements
Monitoring the integrity of the UI elements is done with the Qt Safe Renderer's output verification library that runs parallel with the Qt Quick Ultralite.
Reference project for a safety-critical application
For more information and a reference AUTOSAR project for the Renesas RH850-D1M1A platform, contact the Qt Company.
Available under certain Qt licenses.
Find out more.