本页内容

Qt3DRender::QAbstractLight Class

class Qt3DRender::QAbstractLight

将一个 QAbstractLight 对象封装到一个Qt 3D 场景中。更多内容...

头文件: #include <qabstractlight.h>
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 : Type

光的类型。

访问函数:

Qt3DRender::QAbstractLight::Type type() const

成员函数文档

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

保存当前的QAbstractLight 类型。

注意: 该属性type的获取 函数。

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