QSGSimpleTextureNode#

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

Inheritance diagram of PySide6.QtQuick.QSGSimpleTextureNode

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

Warning

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

Warning

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 via createImageNode() . However, this standalone class is still useful when used via subclassing and the application knows that no special scenegraph backends will be involved.

class PySide6.QtQuick.QSGSimpleTextureNode#

Constructs a new simple texture node

PySide6.QtQuick.QSGSimpleTextureNode.TextureCoordinatesTransformFlag#

(inherits enum.Flag) The TextureCoordinatesTransformFlag enum is used to specify the mode used to generate texture coordinates for a textured quad.

Constant

Description

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

PySide6.QtQuick.QSGSimpleTextureNode.filtering()#
Return type:

Filtering

Returns the filtering currently set on this texture node

See also

setFiltering()

PySide6.QtQuick.QSGSimpleTextureNode.ownsTexture()#
Return type:

bool

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

See also

setOwnsTexture()

PySide6.QtQuick.QSGSimpleTextureNode.rect()#
Return type:

PySide6.QtCore.QRectF

Returns the target rect of this texture node.

See also

setRect()

PySide6.QtQuick.QSGSimpleTextureNode.setFiltering(filtering)#
Parameters:

filteringFiltering

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

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

See also

filtering()

PySide6.QtQuick.QSGSimpleTextureNode.setOwnsTexture(owns)#
Parameters:

owns – bool

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

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

PySide6.QtQuick.QSGSimpleTextureNode.setRect(rect)#
Parameters:

rectPySide6.QtCore.QRectF

Sets the target rect of this texture node to r.

See also

rect()

PySide6.QtQuick.QSGSimpleTextureNode.setRect(x, y, w, h)
Parameters:
  • x – float

  • y – float

  • w – float

  • h – float

This is an overloaded function.

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

PySide6.QtQuick.QSGSimpleTextureNode.setSourceRect(r)#
Parameters:

rPySide6.QtCore.QRectF

Sets the source rect of this texture node to r.

See also

sourceRect()

PySide6.QtQuick.QSGSimpleTextureNode.setSourceRect(x, y, w, h)
Parameters:
  • x – float

  • y – float

  • w – float

  • h – float

This is an overloaded function.

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 .

PySide6.QtQuick.QSGSimpleTextureNode.setTexture(texture)#
Parameters:

texturePySide6.QtQuick.QSGTexture

Sets the texture of this texture node to texture.

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

Warning

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

See also

texture()

PySide6.QtQuick.QSGSimpleTextureNode.setTextureCoordinatesTransform(mode)#
Parameters:

mode – Combination of QSGSimpleTextureNode.TextureCoordinatesTransformFlag

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.

PySide6.QtQuick.QSGSimpleTextureNode.sourceRect()#
Return type:

PySide6.QtCore.QRectF

Returns the source rect of this texture node.

See also

setSourceRect()

PySide6.QtQuick.QSGSimpleTextureNode.texture()#
Return type:

PySide6.QtQuick.QSGTexture

Returns the texture for this texture node

See also

setTexture()

PySide6.QtQuick.QSGSimpleTextureNode.textureCoordinatesTransform()#
Return type:

Combination of QSGSimpleTextureNode.TextureCoordinatesTransformFlag

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