- Qt 6.12
- Qt Quick 3D
- QML Types
- ContentLayer
- Qt Quick 3D | Commercial or GPLv3

# ContentLayer QML Type

Singleton providing layer flag constants for grouping and filtering scene nodes. More...

Import Statement: | `import QtQuick3D`
Since: | Qt 6.11

- List of all members, including inherited members

## Detailed Description

ContentLayer is a singleton that exposes the `LayerFlag` enumeration, which provides bit flag constants for assigning nodes to named content layers. Layers can be used to group scene nodes together or to filter which nodes are rendered by a camera.

The predefined layer names are not necessarily descriptive for specific use cases. You can define your own semantic layer names by aliasing the ContentLayer values. For example, in a city scene with buildings, streets, and vehicles:

     readonly property int layerBuildings: ContentLayer.Layer1
     readonly property int layerStreets: ContentLayer.Layer2
     readonly property int layerVehicles: ContentLayer.Layer3 | ContentLayer.Layer4

Once defined, assign these flags to nodes via Node.layers and set the matching flags on a Camera to control which layers it renders.

Note: Some layers have special meanings:

Layer | Description
--- | ---
LayerNone | No layer assigned. Nodes with this value do not belong to any layer and are not rendered.
Layer0 | The default main layer. Nodes are assigned to this layer by default.
Layer1–Layer23 | Freely assignable user layers for grouping nodes by purpose or functionality.
Layer24 and above | Reserved for internal use by Qt Quick 3D.
LayerAll | Matches all layers; nodes with this value are rendered by every camera.

Note: Layers are bit flags and can be combined with the `|` operator.

Note: Layer assignment is not inherited; setting Node.layers on a node does not propagate the value from parent to child. Each node keeps its own layer assignment and must be set individually.

Note: ContentLayer is a singleton and is not intended to be instantiated directly.

See also Layers Example.