C

Building for Host Platform

To use Qt Safe Renderer and its examples on your host platform, you need to build the following projects:

ProjectDescription.pro file namePath
Qt Safe RendererWhen you build Qt Safe Renderer, the Qt Safe Renderer plugins and Qt Safe Layout Tool 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 Safe Renderer installation directory>/Src/QtSafeRenderer-<version>
The Telltales exampleWhen you build Telltales for a host platform, the desktop part of the project is built.examples.pro<Qt Safe Renderer installation directory>/Examples/QtSafeRenderer-<version>/
The Indicators exampleIndicators demonstrates the Qt Quick Designer related functionality.indicators.pro<Qt Safe Renderer installation directory>/Examples/QtSafeRenderer-<version>/indicators/indicators.pro

For building, you must use a Qt version that is compiled for your host platform.

Note: It is a known issue that if you use Qt Safe Renderer with Qt 5.9.3, you need to build Qt from the sources. See Building Qt Sources.

To build Qt Safe Renderer and its examples for a host platform, execute the steps in Building Projects with Qt Creator for qtsaferenderer.pro and examples.pro. Qt Safe Renderer Binaries lists the binaries that are generated in the Qt Safe Renderer build.

You must also configure Qt Creator for Qt Safe Renderer. See Configuring Qt Creator for Qt Safe Renderer.

Building Projects with Qt Creator

When you build a project in Qt Creator, execute the following steps:

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>".

Qt Safe Renderer Binaries

After a successful Qt Safe Renderer build, you have the following binaries under your Qt installation:

FileLocationDescription
qtsafelayouttool<Qt installation directory>/<Qt version>/<compiler>/binQt Safe Layout Tool that is used for generating the safe layout data for Qt Safe Renderer.
libqtsaferendererplugin.so (on Linux) / qtsaferendererplugin.dll (on Windows)<Qt installation directory>/<Qt version>/<compiler>/qml/Qt/SafeRendererA plugin that enables Qt Quick Designer related Qt Safe Renderer functionality.

Configuring Qt Creator for Qt Safe Renderer

In Qt Creator, the Qt Safe Renderer plugins require that you use a QML emulator layer that is built with the currently selected Qt. To enable the QML emulator layer, launch Qt Creator and select Tools > Options > Qt Quick > Qt Quick Designer > Use QML emulation layer that is built with the selected Qt radio button.

Qt Creator builds the emulation layer when you select the Design mode while creating the first new project with the kit. Building the emulation layer takes a while but it is done only once. For more information, see Running QML Modules in Qt Quick Designer.

Available under certain Qt licenses.
Find out more.