QSGImageNode Class

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

Header: #include <QSGImageNode>
qmake: QT += quick
Since: Qt 5.8
Inherits: QSGGeometryNode

This class was introduced in Qt 5.8.

Public Types

enum TextureCoordinatesTransformFlag { NoTransform, MirrorHorizontally, MirrorVertically }
flags TextureCoordinatesTransformMode

Static Public Members

void rebuildGeometry(QSGGeometry *g, QSGTexture *texture, const QRectF &rect, QRectF sourceRect, QSGImageNode::TextureCoordinatesTransformMode texCoordMode)

Additional Inherited Members

Detailed Description

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

Member Type Documentation

enum QSGImageNode::TextureCoordinatesTransformFlag
flags QSGImageNode::TextureCoordinatesTransformMode

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

QSGImageNode::NoTransform0x00Texture coordinates are oriented with window coordinates i.e. with origin at top-left.
QSGImageNode::MirrorHorizontally0x01Texture coordinates are inverted in the horizontal axis with respect to window coordinates
QSGImageNode::MirrorVertically0x02Texture coordinates are inverted in the vertical axis with respect to window coordinates

The TextureCoordinatesTransformMode type is a typedef for QFlags<TextureCoordinatesTransformFlag>. It stores an OR combination of TextureCoordinatesTransformFlag values.

Member Function Documentation

[static] void QSGImageNode::rebuildGeometry(QSGGeometry *g, QSGTexture *texture, const QRectF &rect, QRectF sourceRect, QSGImageNode::TextureCoordinatesTransformMode texCoordMode)

Updates the geometry g with the texture, the coordinates in rect, and the texture coordinates from sourceRect.

g is assumed to be a triangle strip of four vertices of type QSGGeometry::TexturedPoint2D.

texCoordMode is used for normalizing the sourceRect.

© 2019 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.