QQuickRenderTarget Class

The QQuickRenderTarget class provides an opaque container for native graphics resources specifying a render target, and associated metadata. More...

Header: #include <QQuickRenderTarget>
CMake: find_package(Qt6 COMPONENTS Quick REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Since: Qt 6.0

Public Functions

QQuickRenderTarget()
~QQuickRenderTarget()
bool isNull() const

Static Public Members

QQuickRenderTarget fromD3D11Texture(void *texture, const QSize &pixelSize, int sampleCount = 1)
QQuickRenderTarget fromMetalTexture(MTLTexture *texture, const QSize &pixelSize, int sampleCount = 1)
QQuickRenderTarget fromOpenGLTexture(uint textureId, const QSize &pixelSize, int sampleCount = 1)
QQuickRenderTarget fromVulkanImage(VkImage image, VkImageLayout layout, const QSize &pixelSize, int sampleCount = 1)
bool operator!=(const QQuickRenderTarget &a, const QQuickRenderTarget &b)
bool operator==(const QQuickRenderTarget &a, const QQuickRenderTarget &b)

Detailed Description

See also QQuickWindow::setRenderTarget() and QQuickGraphicsDevice.

Member Function Documentation

QQuickRenderTarget::QQuickRenderTarget()

Constructs a default QQuickRenderTarget that does not reference any native objects.

QQuickRenderTarget::~QQuickRenderTarget()

Destructor.

[static] QQuickRenderTarget QQuickRenderTarget::fromD3D11Texture(void *texture, const QSize &pixelSize, int sampleCount = 1)

Returns a new QQuickRenderTarget referencing an D3D11 texture object specified by texture.

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

Note: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

See also QQuickWindow::setRenderTarget() and QQuickRenderControl.

[static] QQuickRenderTarget QQuickRenderTarget::fromMetalTexture(MTLTexture *texture, const QSize &pixelSize, int sampleCount = 1)

Returns a new QQuickRenderTarget referencing an Metal texture object specified by texture.

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

Note: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

See also QQuickWindow::setRenderTarget() and QQuickRenderControl.

[static] QQuickRenderTarget QQuickRenderTarget::fromOpenGLTexture(uint textureId, const QSize &pixelSize, int sampleCount = 1)

Returns a new QQuickRenderTarget referencing an OpenGL texture object specified by textureId.

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

Note: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

See also QQuickWindow::setRenderTarget() and QQuickRenderControl.

[static] QQuickRenderTarget QQuickRenderTarget::fromVulkanImage(VkImage image, VkImageLayout layout, const QSize &pixelSize, int sampleCount = 1)

Returns a new QQuickRenderTarget referencing an Vulkan image object specified by image. The current layout of the image must be provided as well.

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

Note: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

See also QQuickWindow::setRenderTarget() and QQuickRenderControl.

bool QQuickRenderTarget::isNull() const

Returns true if this QQuickRenderTarget is default constructed, referencing no native objects.

Related Non-Members

bool operator!=(const QQuickRenderTarget &a, const QQuickRenderTarget &b)

Returns true if a and b refer to a different set of native objects, or the associated data (size, sample count) does not match.

bool operator==(const QQuickRenderTarget &a, const QQuickRenderTarget &b)

Returns true if a and b refer to the same set of native objects and have matching associated data (size, sample count).

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.0/qquickrendertarget.html