本页内容

Qt3DRender::QRenderCapture Class

class Qt3DRender::QRenderCapture

用于渲染捕获的帧图节点。更多...

标题: #include <Qt3DRender/QRenderCapture>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: RenderCapture
继承自: Qt3DRender::QFrameGraphNode
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

公共函数

QRenderCapture(Qt3DCore::QNode *parent = nullptr)
Qt3DRender::QRenderCaptureReply *requestCapture()
Qt3DRender::QRenderCaptureReply *requestCapture(const QRect &rect)

详细说明

QRenderCapture 用于在任何渲染阶段将渲染结果捕获到图像中。捕获操作必须由用户发起,每次捕获请求将返回一张图像。用户可以同时发出多个渲染捕获请求,但每个帧内,每个 QRenderCapture 实例仅处理一个请求。

成员函数文档

[explicit] QRenderCapture::QRenderCapture(Qt3DCore::QNode *parent = nullptr)

该构造函数会根据指定的parent 创建一个实例。

[invokable] Qt3DRender::QRenderCaptureReply *QRenderCapture::requestCapture()

用于请求渲染捕获。即使帧图中有多个叶节点,每次调用 requestCapture 也会仅生成一个渲染捕获结果。该函数返回一个 QRenderCaptureReply 对象,该对象会在捕获完成后接收捕获到的图像。用户需通过调用 deleterLater() 来释放返回的对象。

注意: 可通过元对象系统和 QML 调用此 函数。参见Q_INVOKABLE 。

[invokable] Qt3DRender::QRenderCaptureReply *QRenderCapture::requestCapture(const QRect &rect)

用于向指定的rect 请求渲染捕获。即使帧图中有多个叶节点,每次调用 requestCapture 也会仅生成一个渲染捕获结果。该函数返回一个 QRenderCaptureReply 对象,该对象会在捕获完成后接收捕获到的图像。用户需通过调用deleteLater() 来释放该返回对象。

注意: 可通过元对象系统和 QML 调用此 函数。参见Q_INVOKABLE 。

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