QSGAbstractRenderer¶
QSGAbstractRenderergives access to the scene graph nodes and rendering of aQSGEngine. More…

Synopsis¶
Functions¶
def
clearColor()def
clearMode()def
deviceRect()def
projectionMatrix()def
setClearColor(color)def
setClearMode(mode)def
setDeviceRect(rect)def
setDeviceRect(size)def
setProjectionMatrix(matrix)def
setProjectionMatrixToRect(rect)def
setProjectionMatrixToRect(rect, flags)def
setProjectionMatrixWithNativeNDC(matrix)def
setViewportRect(rect)def
setViewportRect(size)def
viewportRect()
Virtual functions¶
def
nodeChanged(node, state)def
renderScene([fboId=0])
Signals¶
def
sceneGraphChanged()
Detailed Description¶
A
QSGAbstractRenderercreated by aQSGEngineallows you to set yourQSGNodetree throughsetRootNode()and control the rendering viewport throughsetDeviceRect(),setViewportRect()andsetProjectionMatrixToRect(). You can finally trigger the rendering to the desired framebuffer throughrenderScene().The
QSGAbstractRendereris only available when used with aQSGEngineand isn’t exposed when used internally byQQuickWindow.
- class PySide2.QtQuick.QSGAbstractRenderer([parent=None])¶
- Parameters:
parent –
PySide2.QtCore.QObject
- 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.
See also
- PySide2.QtQuick.QSGAbstractRenderer.MatrixTransformFlag¶
Used with
setProjectionMatrixToRect()to indicate the expectations towards the generated projection matrix.Constant
Description
QSGAbstractRenderer.MatrixTransformFlipY
The 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.
See also
New in version 5.14.
- PySide2.QtQuick.QSGAbstractRenderer.clearColor()¶
- Return type:
Returns the color that clears the framebuffer at the beginning of the rendering.
See also
- PySide2.QtQuick.QSGAbstractRenderer.clearMode()¶
- Return type:
ClearMode
Flags defining which attachment of the framebuffer will be cleared before each scene render.
See also
- PySide2.QtQuick.QSGAbstractRenderer.deviceRect()¶
- Return type:
Returns the device rect of the surface being rendered to.
See also
- PySide2.QtQuick.QSGAbstractRenderer.nodeChanged(node, state)¶
- Parameters:
node –
PySide2.QtQuick.QSGNodestate –
DirtyState
- PySide2.QtQuick.QSGAbstractRenderer.projectionMatrix()¶
- Return type:
Returns the projection matrix
- PySide2.QtQuick.QSGAbstractRenderer.projectionMatrixWithNativeNDC()¶
- Return type:
- PySide2.QtQuick.QSGAbstractRenderer.renderScene([fboId=0])¶
- Parameters:
fboId –
uint
Render the scene to the specified
fboIdIf
fboIdisn’t specified, the scene graph will be rendered to the default framebuffer. You will have to callswapBuffers()yourself afterward.The framebuffer specified by
fboIdwill be bound automatically.See also
swapBuffers()handle()
- PySide2.QtQuick.QSGAbstractRenderer.sceneGraphChanged()¶
- PySide2.QtQuick.QSGAbstractRenderer.setClearColor(color)¶
- Parameters:
color –
PySide2.QtGui.QColor
Use
colorto clear the framebuffer whenclearMode()is set toClearColorBuffer.See also
- PySide2.QtQuick.QSGAbstractRenderer.setClearMode(mode)¶
- Parameters:
mode –
ClearMode
Defines which attachment of the framebuffer should be cleared before each scene render with the
modeflag.See also
- PySide2.QtQuick.QSGAbstractRenderer.setDeviceRect(rect)¶
- Parameters:
rect –
PySide2.QtCore.QRect
- PySide2.QtQuick.QSGAbstractRenderer.setDeviceRect(size)
- Parameters:
size –
PySide2.QtCore.QSize
- PySide2.QtQuick.QSGAbstractRenderer.setProjectionMatrix(matrix)¶
- Parameters:
matrix –
PySide2.QtGui.QMatrix4x4
Use
matrixto project theQSGNodecoordinates onto surface pixels.
- PySide2.QtQuick.QSGAbstractRenderer.setProjectionMatrixToRect(rect)¶
- Parameters:
rect –
PySide2.QtCore.QRectF
Convenience method that calls
setProjectionMatrix()with an orthographic matrix generated fromrect.Note
This function assumes that the graphics API uses Y up in its normalized device coordinate system.
See also
- PySide2.QtQuick.QSGAbstractRenderer.setProjectionMatrixToRect(rect, flags)
- Parameters:
rect –
PySide2.QtCore.QRectFflags –
MatrixTransformFlags
Convenience method that calls
setProjectionMatrix()with an orthographic matrix generated fromrect.Set
MatrixTransformFlipYinflagswhen the graphics API uses Y down in its normalized device coordinate system (for example, Vulkan).See also
- PySide2.QtQuick.QSGAbstractRenderer.setProjectionMatrixWithNativeNDC(matrix)¶
- Parameters:
matrix –
PySide2.QtGui.QMatrix4x4
- PySide2.QtQuick.QSGAbstractRenderer.setViewportRect(rect)¶
- Parameters:
rect –
PySide2.QtCore.QRect
- PySide2.QtQuick.QSGAbstractRenderer.setViewportRect(size)
- Parameters:
size –
PySide2.QtCore.QSize
- PySide2.QtQuick.QSGAbstractRenderer.viewportRect()¶
- Return type:
Returns the rect of the viewport to render.
See also
© 2022 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.