本页内容

Qt3DRender::QColorMask Class

class Qt3DRender::QColorMask

允许指定应将哪些颜色分量写入当前绑定的帧缓冲区。更多...

头文件: #include <qcolormask.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: ColorMask
继承自: Qt3DRender::QRenderState
状态: 已弃用

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

属性

公共函数

QColorMask(Qt3DCore::QNode *parent = nullptr)
bool isAlphaMasked() const
bool isBlueMasked() const
bool isGreenMasked() const
bool isRedMasked() const

公共槽位

void setAlphaMasked(bool alphaMasked)
void setBlueMasked(bool blueMasked)
void setGreenMasked(bool greenMasked)
void setRedMasked(bool redMasked)

信号

void alphaMaskedChanged(bool alphaMasked)
void blueMaskedChanged(bool blueMasked)
void greenMaskedChanged(bool greenMasked)
void redMaskedChanged(bool redMasked)

详细说明

默认情况下,每个颜色分量(红、绿、蓝、Alpha)的属性都设置为true ,这意味着它们将被写入帧缓冲区。将任何颜色分量设置为false 将阻止其被写入帧缓冲区。

属性文档

alphaMasked : bool

用于控制是否应将 alphaMasked 组件写入帧缓冲区。

访问函数:

bool isAlphaMasked() const
void setAlphaMasked(bool alphaMasked)

通知信号:

void alphaMaskedChanged(bool alphaMasked)

blueMasked : bool

用于控制是否应将蓝色色分量写入帧缓冲区。

访问函数:

bool isBlueMasked() const
void setBlueMasked(bool blueMasked)

通知信号:

void blueMaskedChanged(bool blueMasked)

greenMasked : bool

用于控制是否应将绿色色分量写入帧缓冲区。

访问函数:

bool isGreenMasked() const
void setGreenMasked(bool greenMasked)

通知器信号:

void greenMaskedChanged(bool greenMasked)

redMasked : bool

用于控制是否应将红色色成分写入帧缓冲区。

访问函数:

bool isRedMasked() const
void setRedMasked(bool redMasked)

通知信号:

void redMaskedChanged(bool redMasked)

成员函数文档

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

创建一个新的 Qt3DCore::QColorMask 实例,其父对象为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.