Scene Graph Adaptations
Scene Graph Adaptations in Qt Quick
Originally Qt Quick always relied on OpenGL (OpenGL ES 2.0 or OpenGL 2.0) for parsing the scene graph and rendering the results to a render target. From Qt 5.8 onwards Qt Quick also supports rendering in software and with Direct3D 12.
Switching between the adaptation used by the application
The default rendering backend is still OpenGL, or - in Qt builds with disabled OpenGL support - the software renderer. This 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.
- OpenVG - Requested by the string
"openvg"or the enum value QSGRendererInterface::OpenVG.
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
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
The OpenVG adaptation is an alternative renderer for Qt Quick 2 that will renderer the contents of the scene graph using OpenVG commands to provide hardware-acclerated 2D vector and raster graphics. The details for this adaptation are available here: OpenVG Adaptation
© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.