Q3DLight Class

三维空间中的光源表示。更多

头文件: #include <Q3DLight>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
QtDataVisualization 1.0
在 QML 中: Light3D
继承: Q3DObject

属性

公共功能

Q3DLight(QObject *parent = nullptr)
virtual ~Q3DLight()
bool isAutoPosition()
void setAutoPosition(bool enabled)

信号

void autoPositionChanged(bool autoPosition)

详细说明

Q3DLight 表示三维空间中的单色光源。

注: 默认光源为isAutoPosition()true

属性文档

[since QtDataVisualization 5.9] autoPosition : bool

该属性表示灯光位置是否自动跟随摄像机。

注: 如果启用了阴影,则该属性无效。请记住在设置灯光位置前禁用阴影,否则如果isAutoPosition()false ,它将被自动定位覆盖。

此属性在 QtDataVisualization 5.9 中引入。

访问功能:

bool isAutoPosition()
void setAutoPosition(bool enabled)

Notifier 信号:

void autoPositionChanged(bool autoPosition)

成员函数文档

[explicit] Q3DLight::Q3DLight(QObject *parent = nullptr)

构造一个位于原点的新 3D 光源。可以给出一个可选的parent 参数,然后将其传递给QObject 构造函数。

[virtual noexcept] Q3DLight::~Q3DLight()

摧毁灯光物体。

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