- Qt 6.6
- Qt Graphs
- C++ Classes
- QtGraphs (Technical Preview)
- Q3DLight
- Qt Graphs | Commercial or GPLv3

# Q3DLight Class

Representation of a light source in 3D space. More...

Header: | #include <Q3DLight>
CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: | QT += graphs
Instantiated By: | Light3D
Inherits: | Q3DObject
Status: | Technical Preview

- List of all members, including inherited members

## Properties

- autoPosition : bool

## Public Functions

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

## Signals

void | autoPositionChanged(bool autoPosition)

## Detailed Description

Q3DLight represents a monochrome light source in 3D space.

Note: Default light has isAutoPosition() `true`.

## Property Documentation

### autoPosition : bool

This property holds whether the light position follows the camera automatically.

Note: Has no effect if shadows are enabled. Remember to disable shadows before setting light's position, or it will be overwritten by automatic positioning if `isAutoPosition()` is `false`.

Access functions:

bool | isAutoPosition()
void | setAutoPosition(bool enabled)

Notifier signal:

void | autoPositionChanged(bool autoPosition)

## Member Function Documentation

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

Constructs a new 3D light located at origin. An optional parent parameter can be given and is then passed to QObject constructor.

### `[virtual noexcept]` Q3DLight::~Q3DLight()

Destroys the light object.