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.

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

  1. Add a Safe Renderer QML module to your project
  2. 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.

  3. 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 fixed width and height for each safe item. Set fillColor 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.

    Note: Safe items support RGB332, RGB565, RGB888, and ARGB8888 as framebuffer formats.

  4. 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.
  5. Add the .srb (Safe Renderer Bitmap) files to ImageFiles with MCU.resourceKeepRawData as true.
    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 be images/iso_grs_7000_4_0238_30x30_e41e25_000000.srb, and the layoutData/safeUnitText_72x40_8ae234_000000.srb resource URI would be safeUnitText_72x40_8ae234_000000.srb.

  6. 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 be safeText.srt, and the layoutData/lato_32_400.qpf2 resource URI would be lato_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.

Note: Monitoring supports RGB565, RGB888, and ARGB8888 as framebuffer formats.

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.