C
Building for Host Platform
The Qt Safe Renderer binaries built with Qt 6.5.7 are included in the installation.
You need to build Qt Safe Renderer yourself from sources if you like to use Qt Safe Renderer with some later Qt version than Qt 6.5.7.
Note: From Qt Safe Renderer 2.1 onwards, you must build the Qt Safe Renderer Runtime component before the Tooling component.
Building Qt Safe Renderer Runtime
You must build Qt Safe Renderer Runtime before building Qt Safe Renderer Tooling.
The Qt Safe Renderer Runtime sources are installed under <Qt installation directory>/Src/QtSafeRenderer-runtime-<version>. You can build sources via the command line or Qt Creator.
Building via Command Line
First, set the following tools to your PATH environment variable:
- Qt, that is, <Qt installation directory>/<Qt version>/<compiler>/bin
- CMake
- C++ compiler
- Ninja
Build Qt Safe Renderer Runtime via the command line as follows:
cd <runtime build dir> # windows: <Qt installation directory>\<Qt version>\<compiler>\bin\qt-configure-module.bat <path>\<QSR Runtime sources> # linux and macOS: <Qt installation directory>/<Qt version>/<compiler>/bin/qt-configure-module <path>/<QSR Runtime sources> cmake --build . cmake --build . --target install
Building via Qt Creator
Build Qt Safe Renderer Runtime as instructed in Building Projects with Qt Creator.
Note: Building Qt Safe Renderer Runtime with Microsoft Visual C++ (MSVC) compiler is not supported in Qt Creator.
Building Qt Safe Renderer Tooling
After you have built QSR Runtime, build Qt Safe Renderer Tooling.
The Qt Safe Renderer Tooling sources are installed under <Qt installation directory>/Src/QtSafeRenderer-<version>. You can build sources via the command line or Qt Creator.
Building via Command Line
First, set the following tools to your PATH environment variable:
- Qt, that is, <Qt installation directory>/<Qt version>/<compiler>/bin
- CMake
- C++ compiler
- Ninja
Build Qt Safe Renderer Tooling as follows:
cd <tooling build dir> # windows: <Qt installation directory>\<Qt version>\<compiler>\bin\qt-configure-module.bat <path>\<QSR Tooling sources> # linux and macOS: <Qt installation directory>/<Qt version>/<compiler>/bin/qt-configure-module <path>/<QSR Tooling sources> cmake --build . cmake --build . --target install
Building via Qt Creator
Build Qt Safe Renderer Tooling as instructed in Building Projects with Qt Creator.
Qt Safe Renderer Binaries lists the binaries that are generated in the Qt Safe Renderer Tooling build.
Note: Building Qt Safe Renderer Tooling with Microsoft Visual C++ (MSVC) compiler is not supported in Qt Creator.
Building Qt Safe Renderer Examples
Qt Safe Renderer Examples lists the examples included into the Qt Safe Renderer installation.
For building, you must use a Qt version that is compiled for your host platform.
To build Qt Safe Renderer examples for a host platform, execute the steps in Building Projects with Qt Creator.
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:
- Start Qt Creator.
- Select File > Open File or Project and browse to a CMakeLists.txt file.
- Select Open.
- 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:
- Select a Projects mode.
- In the kit, select Build.
- Select Build Settings > Build Steps > Add Build Step > Cmake Build.
- In Targets, select install.
- 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 Tooling build, you have the following binaries under your Qt installation:
File | Location | Description |
---|---|---|
qtsafelayouttool | <Qt installation directory>/<Qt version>/<compiler>/bin | Qt Safe Layout Tool that is used for generating the safe layout data for Qt Safe Renderer. |
qtsafercctool | <Qt installation directory>/<Qt version>/<compiler>/bin | Qt Safe Resource Compiler Tool that is used for generating the safe resource files for Qt Safe Renderer. |
Available under certain Qt licenses.
Find out more.