Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dcontentlayer.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
7
8/*!
9 \qmltype ContentLayer
10 \inqmlmodule QtQuick3D
11 \since 6.11
12 \brief Singleton providing layer flag constants for grouping and filtering scene nodes.
13
14 ContentLayer is a singleton that exposes the \c LayerFlag enumeration, which provides
15 bit flag constants for assigning nodes to named content layers. Layers can be used to
16 group scene nodes together or to filter which nodes are rendered by a camera.
17
18 The predefined layer names are not necessarily descriptive for specific use cases. You
19 can define your own semantic layer names by aliasing the \l ContentLayer values. For
20 example, in a city scene with buildings, streets, and vehicles:
21
22 \qml
23 readonly property int layerBuildings: ContentLayer.Layer1
24 readonly property int layerStreets: ContentLayer.Layer2
25 readonly property int layerVehicles: ContentLayer.Layer3 | ContentLayer.Layer4
26 \endqml
27
28 Once defined, assign these flags to nodes via \l {Node::layers}{Node.layers} and set
29 the matching flags on a \l Camera to control which layers it renders.
30
31 \sa {Qt Quick 3D - Layers Example}{Layers Example}
32
33 \note Some layers have special meanings:
34
35 \table
36 \header
37 \li Layer
38 \li Description
39 \row
40 \li LayerNone
41 \li No layer assigned. Nodes with this value do not belong to any layer and are not rendered.
42 \row
43 \li Layer0
44 \li The default main layer. Nodes are assigned to this layer by default.
45 \row
46 \li Layer1–Layer23
47 \li Freely assignable user layers for grouping nodes by purpose or functionality.
48 \row
49 \li Layer24 and above
50 \li Reserved for internal use by Qt Quick 3D.
51 \row
52 \li LayerAll
53 \li Matches all layers; nodes with this value are rendered by every camera.
54 \endtable
55
56 \note Layers are bit flags and can be combined with the \c | operator.
57
58 \note ContentLayer is a singleton and is not intended to be instantiated directly.
59*/
60
62
63QQuick3DContentLayer::QQuick3DContentLayer(QObject *parent)
64 : QObject(parent)
65{
66
67}
68
69QQuick3DContentLayer::~QQuick3DContentLayer()
70{
71
72}
73
74QT_END_NAMESPACE
Combined button and popup list for selecting options.