内容表

上一话题

QSGSimpleRectNode

下一话题

QSGTexture

QSGSimpleTextureNode

QSGSimpleTextureNode class is provided for convenience to easily draw textured content using the QML scene graph. 更多

Inheritance diagram of PySide2.QtQuick.QSGSimpleTextureNode

概要

函数

详细描述

警告

The simple texture node class must have a texture before being added to the scene graph to be rendered.

警告

This utility class is only functional when running with the default or software backends of the Qt Quick scenegraph. As an alternative, prefer using QSGImageNode 凭借 createImageNode() or createImageNode() .

class QSGSimpleTextureNode

Constructs a new simple texture node

PySide2.QtQuick.QSGSimpleTextureNode. TextureCoordinatesTransformFlag

The enum is used to specify the mode used to generate texture coordinates for a textured quad.

常量

描述

QSGSimpleTextureNode.NoTransform

Texture coordinates are oriented with window coordinates i.e. with origin at top-left.

QSGSimpleTextureNode.MirrorHorizontally

Texture coordinates are inverted in the horizontal axis with respect to window coordinates

QSGSimpleTextureNode.MirrorVertically

Texture coordinates are inverted in the vertical axis with respect to window coordinates

PySide2.QtQuick.QSGSimpleTextureNode. filtering ( )
返回类型

过滤

Returns the filtering currently set on this texture node

另请参阅

setFiltering()

PySide2.QtQuick.QSGSimpleTextureNode. ownsTexture ( )
返回类型

bool

返回 true if the node takes ownership of the texture; otherwise returns false .

另请参阅

setOwnsTexture()

PySide2.QtQuick.QSGSimpleTextureNode. rect ( )
返回类型

QRectF

Returns the target rect of this texture node.

另请参阅

setRect()

PySide2.QtQuick.QSGSimpleTextureNode. setFiltering ( filtering )
参数

filtering 过滤

Sets the filtering to be used for this texture node to filtering .

For smooth scaling, use Linear ; for normal scaling, use Nearest .

另请参阅

filtering()

PySide2.QtQuick.QSGSimpleTextureNode. setOwnsTexture ( owns )
参数

owns bool

Sets whether the node takes ownership of the texture to owns .

By default, the node does not take ownership of the texture.

PySide2.QtQuick.QSGSimpleTextureNode. setRect ( rect )
参数

rect QRectF

Sets the target rect of this texture node to r .

另请参阅

rect()

PySide2.QtQuick.QSGSimpleTextureNode. setRect ( x , y , w , h )
参数
  • x qreal

  • y qreal

  • w qreal

  • h qreal

这是重载函数。

Sets the rectangle of this texture node to begin at ( x , y ) and have width w and height h .

PySide2.QtQuick.QSGSimpleTextureNode. setSourceRect ( r )
参数

r QRectF

Sets the source rect of this texture node to r .

另请参阅

sourceRect()

PySide2.QtQuick.QSGSimpleTextureNode. setSourceRect ( x , y , w , h )
参数
  • x qreal

  • y qreal

  • w qreal

  • h qreal

这是重载函数。

Sets the rectangle of this texture node to show its texture from ( x , y ) and have width w and height h relatively to the textureSize .

PySide2.QtQuick.QSGSimpleTextureNode. setTexture ( texture )
参数

texture QSGTexture

Sets the texture of this texture node to texture .

使用 setOwnsTexture() to set whether the node should take ownership of the texture. By default, the node does not take ownership.

警告

A texture node must have a texture before being added to the scenegraph to be rendered.

另请参阅

texture()

PySide2.QtQuick.QSGSimpleTextureNode. setTextureCoordinatesTransform ( mode )
参数

mode TextureCoordinatesTransformMode

Sets the method used to generate texture coordinates to mode . This can be used to obtain correct orientation of the texture. This is commonly needed when using a third party OpenGL library to render to texture as OpenGL has an inverted y-axis relative to Qt Quick.

PySide2.QtQuick.QSGSimpleTextureNode. sourceRect ( )
返回类型

QRectF

Returns the source rect of this texture node.

另请参阅

setSourceRect()

PySide2.QtQuick.QSGSimpleTextureNode. texture ( )
返回类型

QSGTexture

Returns the texture for this texture node

另请参阅

setTexture()

PySide2.QtQuick.QSGSimpleTextureNode. textureCoordinatesTransform ( )
返回类型

TextureCoordinatesTransformMode

Returns the mode used to generate texture coordinates for this node.