QSGAbstractRenderer Class

QSGAbstractRenderer gives access to the scene graph nodes and rendering of a QSGEngine. More...

Header: #include <QSGAbstractRenderer>
qmake: QT += quick
Since: Qt 5.4
Inherits: QObject

This class was introduced in Qt 5.4.

Public Types

enum ClearModeBit { ClearColorBuffer, ClearDepthBuffer, ClearStencilBuffer }
enum MatrixTransformFlag { MatrixTransformFlipY }

Detailed Description

A QSGAbstractRenderer created by a QSGEngine allows you to set your QSGNode tree through setRootNode() and control the rendering viewport through setDeviceRect(), setViewportRect() and setProjectionMatrixToRect(). You can finally trigger the rendering to the desired framebuffer through renderScene().

The QSGAbstractRenderer is only available when used with a QSGEngine and isn't exposed when used internally by QQuickWindow.

See also QSGEngine and QSGNode.

Member Type Documentation

enum QSGAbstractRenderer::ClearModeBit

Used with setClearMode() to indicate which buffer should be cleared before the scene render.

ConstantValueDescription
QSGAbstractRenderer::ClearColorBuffer0x0001Clear the color buffer using clearColor().
QSGAbstractRenderer::ClearDepthBuffer0x0002Clear the depth buffer.
QSGAbstractRenderer::ClearStencilBuffer0x0004Clear the stencil buffer.

See also setClearMode() and setClearColor().

enum QSGAbstractRenderer::MatrixTransformFlag

Used with setProjectionMatrixToRect() to indicate the expectations towards the generated projection matrix.

ConstantValueDescription
QSGAbstractRenderer::MatrixTransformFlipY0x01The traditional assumption in Qt Quick is that Y points up in the normalized device coordinate system. There is at least one modern graphics API where this is not the case (Vulkan). This flag can then be used to get a projection that is appropriate for such an API.

This enum was introduced or modified in Qt 5.14.

See also setProjectionMatrixToRect().