QSGAbstractRenderer¶
QSGAbstractRenderer
gives 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
setViewportRect
(rect)def
setViewportRect
(size)def
viewportRect
()
Virtual functions¶
def
nodeChanged
(node, state)def
renderScene
([fboId=0])
Signals¶
def
sceneGraphChanged
()
Detailed Description¶
A
QSGAbstractRenderer
created by aQSGEngine
allows you to set yourQSGNode
tree throughsetRootNode()
and control the rendering viewport throughsetDeviceRect()
,setViewportRect()
andsetProjectionMatrixToRect()
. You can finally trigger the rendering to the desired framebuffer throughrenderScene()
.The
QSGAbstractRenderer
is only available when used with aQSGEngine
and isn’t exposed when used internally byQQuickWindow
.
-
class
QSGAbstractRenderer
([parent=None])¶ - Parameters
parent –
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.
clearColor
()¶ - Return type
QColor
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
QRect
Returns the device rect of the surface being rendered to.
See also
-
PySide2.QtQuick.QSGAbstractRenderer.
nodeChanged
(node, state)¶ - Parameters
node –
QSGNode
state –
DirtyState
-
PySide2.QtQuick.QSGAbstractRenderer.
projectionMatrix
()¶ - Return type
QMatrix4x4
Returns the projection matrix
-
PySide2.QtQuick.QSGAbstractRenderer.
renderScene
([fboId=0])¶ - Parameters
fboId –
uint
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 callswapBuffers()
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
color –
QColor
Use
color
to 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
mode
flag.See also
-
PySide2.QtQuick.QSGAbstractRenderer.
setDeviceRect
(rect)¶ - Parameters
rect –
QRect
-
PySide2.QtQuick.QSGAbstractRenderer.
setDeviceRect
(size) - Parameters
size –
QSize
-
PySide2.QtQuick.QSGAbstractRenderer.
setProjectionMatrix
(matrix)¶ - Parameters
matrix –
QMatrix4x4
Use
matrix
to project theQSGNode
coordinates onto surface pixels.
-
PySide2.QtQuick.QSGAbstractRenderer.
setProjectionMatrixToRect
(rect)¶ - Parameters
rect –
QRectF
Convenience method that calls
setProjectionMatrix()
with an orthographic matrix generated fromrect
.See also
-
PySide2.QtQuick.QSGAbstractRenderer.
setViewportRect
(rect)¶ - Parameters
rect –
QRect
-
PySide2.QtQuick.QSGAbstractRenderer.
setViewportRect
(size) - Parameters
size –
QSize
-
PySide2.QtQuick.QSGAbstractRenderer.
viewportRect
()¶ - Return type
QRect
Returns the rect of the viewport to render.
See also
© 2018 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.