Scene Graph Adaptations
Scene Graph Adaptations in Qt Quick
Originally, Qt Quick always relied on OpenGL (OpenGL ES 2.0 or OpenGL 2.0) to parse the scene graph and render the results to a render target. From Qt 5.8 onwards, Qt Quick also supports rendering in software and with Direct3D 12.
Switch Between Adaptations in Your Application
The default rendering backend is still OpenGL, but in Qt builds with OpenGL support disabled, the default is the software renderer. You can override this in one of two ways:
- Use an environment variable - Set the
QT_QUICK_BACKEND
or the legacyQMLSCENE_DEVICE
environment variable before launching applications. - Use a C++ API - Call QQuickWindow::setSceneGraphBackend() early on in the application's main() function.
The following backends are supported:
- OpenGL - Request with the
""
string or the QSGRendererInterface::OpenGL enum value. - Software - Request with the
"software"
string or the QSGRendererInterface::Software enum value. - Direct3D 12 - Request with the
"d3d12"
string or the QSGRendererInterface::Direct3D12 enum value. -
OpenVG - Request with the
"openvg"
string or the QSGRendererInterface::OpenVG enum value.
To find out which backend is in use, you can enable basic scene graph information logging via the QSG_INFO
environment variable or the qt.scenegraph.general
logging category. This results in some information being printed onto the debug output, during application startup.
Note: Typically, adaptations other than OpenGL come with a set of limitations as they are unlikely to provide a feature set that's 100% compatible with OpenGL. However, these adaptations may provide their own specific advantages in certain areas. For more information on the various adaptations, refer to the sections below.
OpenGL ES 2.0 and OpenGL 2.0 Adaptation
The OpenGL adaptation is the default adaptation, which is capable of providing the full Qt Quick 2 feature set. For more details, see 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. For more details, see 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. For more details, see Direct3D 12 Adaptation.
OpenVG
The OpenVG adaptation is an alternative renderer for Qt Quick 2 that renders the contents of the scene graph using OpenVG commands to provide hardware-accelerated 2D vector and raster graphics. For more details, see OpenVG Adaptation.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.12/qtquick-visualcanvas-adaptations.html