Qt3DRender::QAbstractLight Class

class Qt3DRender::QAbstractLight

Qt 3D 场景中封装 QAbstractLight 对象。更多

头文件: #include <QAbstractLight>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: Light
继承: Qt3DCore::QComponent
继承于

Qt3DRender::QDirectionalLight,Qt3DRender::QPointLight, 和Qt3DRender::QSpotLight

状态:已废弃

公共类型

enum Type { PointLight, DirectionalLight, SpotLight }

属性

公共功能

QColor color() const
float intensity() const
Qt3DRender::QAbstractLight::Type type() const

公共插槽

void setColor(const QColor &color)
void setIntensity(float intensity)

信号

void colorChanged(const QColor &color)
void intensityChanged(float intensity)

详细说明

成员类型文档

enum QAbstractLight::Type

识别特定类型的光。

常数
Qt3DRender::QAbstractLight::PointLight0
Qt3DRender::QAbstractLight::DirectionalLight1
Qt3DRender::QAbstractLight::SpotLight2

属性文件

color : QColor

保存当前QAbstractLight 颜色。

访问功能:

QColor color() const
void setColor(const QColor &color)

通知信号:

void colorChanged(const QColor &color)

intensity : float

保存当前QAbstractLight 的强度。

访问功能:

float intensity() const
void setIntensity(float intensity)

通知信号:

void intensityChanged(float intensity)

[read-only] type : const Type

灯的类型。

访问函数:

Qt3DRender::QAbstractLight::Type type() const

成员函数文档

Qt3DRender::QAbstractLight::Type QAbstractLight::type() const

保存当前QAbstractLight 类型。

注: 属性类型的获取函数。

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