ContentLayer QML Type
Singleton providing layer flag constants for grouping and filtering scene nodes. More...
| Import Statement: | import QtQuick3D |
| Since: | Qt 6.11 |
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: ContentLayer is a singleton and is not intended to be instantiated directly.
See also Layers Example.
© 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.