QTextureImage Class

class Qt3DRender::QTextureImage

Encapsulates the necessary information to create an OpenGL texture image from an image source. More...

Header: #include <QTextureImage>
qmake: QT += 3drender
Since: Qt 5.5
Instantiated By: TextureImage
Inherits: Qt3DRender::QAbstractTextureImage

This class was introduced in Qt 5.5.

Public Types

enum Status { None, Loading, Ready, Error }

Public Functions

QTextureImage(Qt3DCore::QNode *parent = nullptr)
bool isMirrored() const
void setMirrored(bool mirrored)
void setSource(const QUrl &source)
Qt3DRender::QTextureImage::Status status() const

Protected Functions

void setStatus(Qt3DRender::QTextureImage::Status status)

Reimplemented Protected Functions

virtual void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) override

Detailed Description

It contains the necessary information mipmap level, layer, cube face and source URL to load at the proper place data into an OpenGL texture.

Member Type Documentation

enum QTextureImage::Status

This enumeration specifies the status values for texture image loading.

ConstantValueDescription
Qt3DRender::QTextureImage::None0The texture image loading has not been started yet.
Qt3DRender::QTextureImage::Loading1The texture image loading has started, but not finised.
Qt3DRender::QTextureImage::Ready2The texture image loading has finished.
Qt3DRender::QTextureImage::Error3The texture image loading confronted an error.

Member Function Documentation

QTextureImage::QTextureImage(Qt3DCore::QNode *parent = nullptr)

Constructs a new Qt3DRender::QTextureImage instance with parent as parent.

bool QTextureImage::isMirrored() const

Returns whether mirroring is enabled or not.

[override virtual protected] void QTextureImage::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change)

Sets the scene change event to change. change

void QTextureImage::setMirrored(bool mirrored)

Sets mirroring to mirrored.

Note: This internally triggers a call to update the data generator.

See also isMirrored().

void QTextureImage::setSource(const QUrl &source)

Sets the source url of the texture image to source.

Note: This internally triggers a call to update the data generator.

[protected] void QTextureImage::setStatus(Qt3DRender::QTextureImage::Status status)

Sets the status to status. status

See also status().

Qt3DRender::QTextureImage::Status QTextureImage::status() const

Returns the current status.

See also setStatus().