Qt3DRender::QClearBuffers Class
class Qt3DRender::QClearBuffers用于清空缓冲区的类。更多...
| 头文件: | #include <qclearbuffers.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| 在 QML 中: | ClearBuffers |
| 继承自: | Qt3DRender::QFrameGraphNode |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议不要在新代码中使用它。
公共类型
| enum | BufferType { None, ColorBuffer, DepthBuffer, StencilBuffer, DepthStencilBuffer, …, AllBuffers } |
| flags | BufferTypeFlags |
属性
|
|
公共函数
| QClearBuffers(Qt3DCore::QNode *parent = nullptr) | |
| Qt3DRender::QClearBuffers::BufferType | buffers() const |
| QColor | clearColor() const |
| float | clearDepthValue() const |
| int | clearStencilValue() const |
| Qt3DRender::QRenderTargetOutput * | colorBuffer() const |
公共槽位
| void | setBuffers(Qt3DRender::QClearBuffers::BufferType buffers) |
| void | setClearColor(const QColor &color) |
| void | setClearDepthValue(float clearDepthValue) |
| void | setClearStencilValue(int clearStencilValue) |
| void | setColorBuffer(Qt3DRender::QRenderTargetOutput *buffer) |
信号
| void | buffersChanged(Qt3DRender::QClearBuffers::BufferType buffers) |
| void | clearColorChanged(const QColor &color) |
| void | clearDepthValueChanged(float clearDepthValue) |
| void | clearStencilValueChanged(int clearStencilValue) |
| void | colorBufferChanged(Qt3DRender::QRenderTargetOutput *buffer) |
详细说明
Qt3DRender::QClearBuffers 的FrameGraph节点支持使用特定值清空特定的渲染目标缓冲区。
成员类型文档
enum QClearBuffers::BufferType
flags QClearBuffers::BufferTypeFlags
此枚举类型描述了待清空的缓冲区类型。
| 常量 | 值 | 描述 |
|---|---|---|
Qt3DRender::QClearBuffers::None | 0 | 不会清除任何缓冲区 |
Qt3DRender::QClearBuffers::ColorBuffer | (1 << 0) | 清除颜色缓冲区 |
Qt3DRender::QClearBuffers::DepthBuffer | (1 << 1) | 清除深度缓冲区 |
Qt3DRender::QClearBuffers::StencilBuffer | (1 << 2) | 清除模板缓冲区 |
Qt3DRender::QClearBuffers::DepthStencilBuffer | DepthBuffer | StencilBuffer | 清除深度和模板缓冲区 |
Qt3DRender::QClearBuffers::ColorDepthBuffer | ColorBuffer | DepthBuffer | 清除颜色和深度缓冲区 |
Qt3DRender::QClearBuffers::ColorDepthStencilBuffer | ColorBuffer | DepthStencilBuffer | 清除颜色、深度和模板缓冲区 |
Qt3DRender::QClearBuffers::AllBuffers | 0xFFFFFFFF | 清除所有缓冲区 |
BufferTypeFlags 类型是QFlags<BufferType> 的 typedef 定义。它存储 BufferType 值的按“或”运算组合。
属性文档
buffers : BufferType
指定要使用的缓冲区类型。
访问函数:
| Qt3DRender::QClearBuffers::BufferType | buffers() const |
| void | setBuffers(Qt3DRender::QClearBuffers::BufferType buffers) |
通知信号:
| void | buffersChanged(Qt3DRender::QClearBuffers::BufferType buffers) |
clearColor : QColor
指定要使用的清除颜色。
访问函数:
| QColor | clearColor() const |
| void | setClearColor(const QColor &color) |
通知信号:
| void | clearColorChanged(const QColor &color) |
clearDepthValue : float
指定要使用的清除深度值。
访问函数:
| float | clearDepthValue() const |
| void | setClearDepthValue(float clearDepthValue) |
通知信号:
| void | clearDepthValueChanged(float clearDepthValue) |
clearStencilValue : int
指定要使用的模板值。
访问函数:
| int | clearStencilValue() const |
| void | setClearStencilValue(int clearStencilValue) |
通知信号:
| void | clearStencilValueChanged(int clearStencilValue) |
colorBuffer : Qt3DRender::QRenderTargetOutput*
指定要清空的特定颜色缓冲区。如果设置为 NULL(默认值),且ColorBuffer 标志已启用,则将清空所有颜色缓冲区。
访问函数:
| Qt3DRender::QRenderTargetOutput * | colorBuffer() const |
| void | setColorBuffer(Qt3DRender::QRenderTargetOutput *buffer) |
通知信号:
| void | colorBufferChanged(Qt3DRender::QRenderTargetOutput *buffer) |
成员函数文档
[explicit] QClearBuffers::QClearBuffers(Qt3DCore::QNode *parent = nullptr)
该构造函数会根据指定的parent 创建一个实例。
© 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.