QSGSimpleTextureNode Class | Qt Quick 6.8.3 (original) (raw)

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

Member Function Documentation

QSGSimpleTextureNode::QSGSimpleTextureNode()

Constructs a new simple texture node

[override virtual noexcept] QSGSimpleTextureNode::~QSGSimpleTextureNode()

Destroys the texture node

QSGTexture::Filtering QSGSimpleTextureNode::filtering() const

Returns the filtering currently set on this texture node

See also setFiltering().

bool QSGSimpleTextureNode::ownsTexture() const

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

See also setOwnsTexture().

QRectF QSGSimpleTextureNode::rect() const

Returns the target rect of this texture node.

See also setRect().

void QSGSimpleTextureNode::setFiltering(QSGTexture::Filtering filtering)

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

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

See also filtering().

void QSGSimpleTextureNode::setOwnsTexture(bool owns)

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

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

See also ownsTexture() and setTexture().

void QSGSimpleTextureNode::setRect(const QRectF &r)

Sets the target rect of this texture node to r.

See also rect().

void QSGSimpleTextureNode::setRect(qreal x, qreal y, qreal w, qreal h)

This is an overloaded function.

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

void QSGSimpleTextureNode::setSourceRect(const QRectF &r)

Sets the source rect of this texture node to r.

See also sourceRect().

void QSGSimpleTextureNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)

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 QSGTexture::textureSize.

void QSGSimpleTextureNode::setTexture(QSGTexture *texture)

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

void QSGSimpleTextureNode::setTextureCoordinatesTransform(QSGSimpleTextureNode::TextureCoordinatesTransformMode mode)

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.

See also textureCoordinatesTransform().

QRectF QSGSimpleTextureNode::sourceRect() const

Returns the source rect of this texture node.

See also setSourceRect().

QSGTexture *QSGSimpleTextureNode::texture() const

Returns the texture for this texture node

See also setTexture().

QSGSimpleTextureNode::TextureCoordinatesTransformMode QSGSimpleTextureNode::textureCoordinatesTransform() const

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

See also setTextureCoordinatesTransform().