QSGAbstractRenderer

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

Inheritance diagram of PySide2.QtQuick.QSGAbstractRenderer

Synopsis

Functions

Virtual functions

Signals

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 QSGNode

class QSGAbstractRenderer([parent=None])
Parameters

parentQObject

PySide2.QtQuick.QSGAbstractRenderer.ClearModeBit

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

Constant

Description

QSGAbstractRenderer.ClearColorBuffer

Clear the color buffer using clearColor() .

QSGAbstractRenderer.ClearDepthBuffer

Clear the depth buffer.

QSGAbstractRenderer.ClearStencilBuffer

Clear the stencil buffer.

PySide2.QtQuick.QSGAbstractRenderer.clearColor()
Return type

QColor

Returns the color that clears the framebuffer at the beginning of the rendering.

PySide2.QtQuick.QSGAbstractRenderer.clearMode()
Return type

ClearMode

Flags defining which attachment of the framebuffer will be cleared before each scene render.

PySide2.QtQuick.QSGAbstractRenderer.deviceRect()
Return type

QRect

Returns the device rect of the surface being rendered to.

See also

setDeviceRect()

PySide2.QtQuick.QSGAbstractRenderer.nodeChanged(node, state)
Parameters
  • nodeQSGNode

  • stateDirtyState

PySide2.QtQuick.QSGAbstractRenderer.projectionMatrix()
Return type

QMatrix4x4

Returns the projection matrix

PySide2.QtQuick.QSGAbstractRenderer.renderScene([fboId=0])
Parameters

fboIduint

Render the scene to the specified fboId

If fboId isn’t specified, the scene graph will be rendered to the default framebuffer. You will have to call swapBuffers() yourself afterward.

The framebuffer specified by fboId will be bound automatically.

See also

swapBuffers() handle()

PySide2.QtQuick.QSGAbstractRenderer.sceneGraphChanged()
PySide2.QtQuick.QSGAbstractRenderer.setClearColor(color)
Parameters

colorQColor

Use color to clear the framebuffer when clearMode() is set to ClearColorBuffer .

PySide2.QtQuick.QSGAbstractRenderer.setClearMode(mode)
Parameters

modeClearMode

Defines which attachment of the framebuffer should be cleared before each scene render with the mode flag.

PySide2.QtQuick.QSGAbstractRenderer.setDeviceRect(rect)
Parameters

rectQRect

PySide2.QtQuick.QSGAbstractRenderer.setDeviceRect(size)
Parameters

sizeQSize

PySide2.QtQuick.QSGAbstractRenderer.setProjectionMatrix(matrix)
Parameters

matrixQMatrix4x4

Use matrix to project the QSGNode coordinates onto surface pixels.

PySide2.QtQuick.QSGAbstractRenderer.setProjectionMatrixToRect(rect)
Parameters

rectQRectF

Convenience method that calls setProjectionMatrix() with an orthographic matrix generated from rect .

PySide2.QtQuick.QSGAbstractRenderer.setViewportRect(rect)
Parameters

rectQRect

PySide2.QtQuick.QSGAbstractRenderer.setViewportRect(size)
Parameters

sizeQSize

PySide2.QtQuick.QSGAbstractRenderer.viewportRect()
Return type

QRect

Returns the rect of the viewport to render.