C

Qt Safe Renderer Tools

Qt Safe Renderer provides Qt Safe Layout Tool and Qt Resource Compiler Tool that generate safe data for your project. Qt Safe Config Tool post-processes the safe data asset and generates the C structure from the data for output verification.

Qt Safe Layout Tool

The Qt Safe Layout Tool generates safe layout data for Qt Safe Renderer.

The command to start the tool is: qtsafelayouttool [options] source.

The following table summarizes the available options for the Qt Safe Layout Tool:

OptionsDescription
-h, --helpDisplay help on command line options.
-v, --versionDisplay the Qt Safe Renderer version.
-o, --target-directory <directory>Copy generated layouts to the specified directory.
-r, --resource-file <resource>Parse image data from the specified resource file.
-f, --font-directory <directory>Set the font directory.
-fps <frame-rate>Set the target animation <frame-rate>. The default frame rate per second is 64.
-dEnable debug information.
ArgumentsDescription
sourceSpecify a QML file that is parsed.

Generating Safe Layout Data

After you have enabled Qt Safe Layout Tool in your Qt Quick project, the following safe layout data is generated when you build the project:

  • 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 that Qt Safe Renderer requires for rendering the UI element defined with the safe QML type.
  • An .srt file is generated for each dynamic SafeText QML type that you have added to the canvas. The file contains the following metadata for a layout: text layout width and height, a file name of a font, Cyclic redundancy check (CRC) in a font file, a horizontal and vertical alignment, a text and a text color.
  • 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 each Qt Quick UI form that contains safe QML types. The file contains the raw layout data.

Qt Safe Resource Compiler Tool

The Qt Safe Resource Compiler Tool generates safe resource files for Qt Safe Renderer.

The command to start the tool is: qtsafercctool [options] inputs.

The following table summarizes the available options for the Qt Safe Resource Compiler Tool:

OptionsDescription
-h, --helpDisplay help on command line options.
-v, --versionDisplay the Qt Safe Renderer version.
-o, --output <file>Write output to file rather than stdout.
-t, --temp <file>Use the specified temporary file for big resources.
--name <name>Create an external initialization function with the specified name.
--root <path>Prefix resource access path with root path.
--compress <level>Compress input files by the specified level.
--no-compressDisable all compression.
--threshold <level>Threshold to consider compressing files.
--binaryOutput a binary file for use as a dynamic resource.
--pass <number>Pass the specified number for big resources.
--namespaceDisable the namespace macros.
--verboseEnable the verbose mode.
--listList only .qrc file entries, do not generate code.
--list-mappingOutput only a mapping of resource paths to file system paths defined in the .qrc file, do not generate code.
--projectOutput a resource file containing all files from the current directory.
--format-version <number>The RCC format version to write.
--safetyThe RCC format is specific to Qt Safe Renderer. Sets compression and binary off.
ArgumentsDescription
inputsInput files (*.qrc).

Qt Safe Config Tool

Qt Safe Config Tool post-processes the safe data asset and generates the C structure from the data for output verification.

The command to start the tool is: qtsafeconfigtool [options] inputs.

The following table summarizes the available options for the Qt Safe Config Tool:

OptionsDescription
-?, -h, --helpDisplay help on command line options.
--help-allDisplays help including Qt specific options.
-v, --versionDisplays version information.
-o, --outputdir <dir>Write output to <dir>.
--xmlGenerate the XML file from the data.
ArgumentsDescription
inputsInput layout files (*.srl).

Available under certain Qt licenses.
Find out more.