Qt 5.8 | Qt Quick | Scene Graph Adaptations

Qt 5.8.0 Reference Documentation

# Scene Graph Adaptations

## Scene Graph Adaptations in Qt Quick

Originally Qt Quick only had one available renderer for parsing the scene graph and rendering the results to a render target. This renderer is now the default OpenGL Renderer which supports rendering either using the OpenGL ES 2.0 or OpenGL 2.0 (with framebuffer object extensions) APIs. The Qt Quick APIs have originally been designed with the assumption that OpenGL is always available. However, it is now possible to use other graphics API's to render Qt Quick scenes using the scene graph APIs.

## Switching between the adaptation used by the application

The default of the OpenGL, or - in Qt builds with disabled OpenGL support - the software adaptation, can be overridden either by using an environment variable or a C++ API. The former consists of setting the `QT_QUICK_BACKEND` or the legacy `QMLSCENE_DEVICE` environment variable before launching applications. The latter is done by calling QQuickWindow::setSceneGraphBackend() early in the application's main() function.

The supported backends are the following

- OpenGL - Requested by the string `""` or the enum value QSGRendererInterface::OpenGL.
- Software - Requested by the string `"software"` or the enum value QSGRendererInterface::Software.
- Direct3D 12 - Requested by the string `"d3d12"` or the enum value QSGRendererInterface::Direct3D12.

When in doubt which backend is in use, enable basic scenegraph information logging via the `QSG_INFO` environment variable or the `qt.scenegraph.general` logging category. This will result in printing some information during application startup onto the debug output.

Note: Adaptations other than OpenGL will typically come with a set of limitations since they are unlikely to provide a feature set 100% compatible with OpenGL. However, they may provide their own specific advantages in certain areas. Refer to the sections below for more information on the various adaptations.

## OpenGL ES 2.0 and OpenGL 2.0 Adaptation

The default adaptation capable of providing the full Qt Quick 2 feature set is the OpenGL adaptation. All of the details of the OpenGL adpatation can are available here: OpenGL Adaptation

## Software Adaptation

The Software adaptation is an alternative renderer for Qt Quick 2 that uses the raster paint engine to render the contents of the scene graph. The details for this adaptation are available here: Software Adaptation

## Direct3D 12 (experimental)

The Direct3D 12 adaptation is an alternative renderer for Qt Quick 2 when running on Windows 10, both for Win32 and UWP applications. The details for this adaptation are available here: Direct3D 12 Adaptation