内容表

上一话题

QQuickWindow

下一话题

QSGBasicGeometryNode

QSGAbstractRenderer

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

Inheritance diagram of PySide2.QtQuick.QSGAbstractRenderer

详细描述

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() .

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

class QSGAbstractRenderer ( [ parent=None ] )
参数

parent QObject

PySide2.QtQuick.QSGAbstractRenderer. ClearModeBit

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

常量

描述

QSGAbstractRenderer.ClearColorBuffer

Clear the color buffer using clearColor() .

QSGAbstractRenderer.ClearDepthBuffer

Clear the depth buffer.

QSGAbstractRenderer.ClearStencilBuffer

Clear the stencil buffer.

PySide2.QtQuick.QSGAbstractRenderer. MatrixTransformFlag

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

常量

描述

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.

New in version 5.14.

PySide2.QtQuick.QSGAbstractRenderer. clearColor ( )
返回类型

QColor

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

PySide2.QtQuick.QSGAbstractRenderer. clearMode ( )
返回类型

ClearMode

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

PySide2.QtQuick.QSGAbstractRenderer. deviceRect ( )
返回类型

QRect

Returns the device rect of the surface being rendered to.

另请参阅

setDeviceRect()

PySide2.QtQuick.QSGAbstractRenderer. nodeChanged ( node , state )
参数
PySide2.QtQuick.QSGAbstractRenderer. projectionMatrix ( )
返回类型

QMatrix4x4

Returns the projection matrix

PySide2.QtQuick.QSGAbstractRenderer. projectionMatrixWithNativeNDC ( )
返回类型

QMatrix4x4

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

fboId uint

Render the scene to the specified fboId

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.

另请参阅

swapBuffers() handle()

PySide2.QtQuick.QSGAbstractRenderer. sceneGraphChanged ( )
PySide2.QtQuick.QSGAbstractRenderer. setClearColor ( color )
参数

color QColor

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

PySide2.QtQuick.QSGAbstractRenderer. setClearMode ( mode )
参数

mode ClearMode

Defines which attachment of the framebuffer should be cleared before each scene render with the mode 标志。

PySide2.QtQuick.QSGAbstractRenderer. setDeviceRect ( rect )
参数

rect QRect

PySide2.QtQuick.QSGAbstractRenderer. setDeviceRect ( size )
参数

size QSize

PySide2.QtQuick.QSGAbstractRenderer. setProjectionMatrix ( matrix )
参数

matrix QMatrix4x4

使用 matrix to project the QSGNode coordinates onto surface pixels.

PySide2.QtQuick.QSGAbstractRenderer. setProjectionMatrixToRect ( rect )
参数

rect QRectF

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

注意

This function assumes that the graphics API uses Y up in its normalized device coordinate system.

PySide2.QtQuick.QSGAbstractRenderer. setProjectionMatrixToRect ( rect , flags )
参数
  • rect QRectF

  • flags MatrixTransformFlags

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

Set MatrixTransformFlipY in flags when the graphics API uses Y down in its normalized device coordinate system (for example, Vulkan).

PySide2.QtQuick.QSGAbstractRenderer. setProjectionMatrixWithNativeNDC ( matrix )
参数

matrix QMatrix4x4

PySide2.QtQuick.QSGAbstractRenderer. setViewportRect ( rect )
参数

rect QRect

PySide2.QtQuick.QSGAbstractRenderer. setViewportRect ( size )
参数

size QSize

PySide2.QtQuick.QSGAbstractRenderer. viewportRect ( )
返回类型

QRect

Returns the rect of the viewport to render.

另请参阅

setViewportRect()