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 Provides enumeration of content layers available in a QtQuick3D.
13
14 This class is used to represent a layer of content in a 3D scene. It can be used
15 to manage different layers of content, such as background, foreground, or UI elements.
16
17 The \l ContentLayer enumeration defines the available layer flags that can be used,
18 for example, to group scene nodes together or filter which nodes are rendered by the camera.
19
20 The predefined layer names are not necessarily descriptive enough for specific use cases, in
21 which case you can define your own layers by aliasing the \l ContentLayer enumeration values.
22 Consider a city scene where you have different layers for buildings, streets, and vehicles.
23 You can assign each of these layers a specific flag, such as \c layerBuildings, \c layerStreets,
24 and \c layerVehicles by aliasing the \l ContentLayer enumeration values. Once the layers are defined,
25 you can assign these flags to the nodes in the scene and have the camera filter which layers to render
26 by setting the same \l {Node::layer}{layer} property on the \l Camera.
27
28 \qml
29 readonly property int layerBuildings: ContentLayer.Layer1
30 readonly property int layerStreets: ContentLayer.Layer2
31 readonly property int layerVehicles: ContentLayer.Layer3 | ContentLayer.Layer4
32 \endqml
33
34 \sa {Qt Quick 3D - Layers Example}{Layers Example}
35
36 \note Some of the layers have special meanings:
37
38 \table
39 \header
40 \li Layer
41 \li Description
42 \row
43 \li LayerNone
44 \li No layer assigned, used to indicate that a node does not belong to any layer and should not be rendered.
45 \row
46 \li Layer0
47 \li The main layer, used for the primary content in the scene. Nodes are assigned to this layer by default.
48 \row
49 \li Layer1-23
50 \li Freely assignable layers, used for grouping nodes together based on their purpose or functionality.
51 \row
52 \li Layer24 and up
53 \li Reserved layers, used for special purposes or future extensions.
54 \row
55 \li LayerAll
56 \li Indicates that a node belongs to all layers, used for nodes that should be rendered in every layer.
57 \endtable
58
59 \note The layers are defined as flags, which means that you can combine multiple layers
60
61 \note This class is not intended to be instantiated directly. Instead, it is used as a
62 singleton in QML to access the layer flags.
63
64 */
65
67
68QQuick3DContentLayer::QQuick3DContentLayer(QObject *parent)
69 : QObject(parent)
70{
71
72}
73
74QQuick3DContentLayer::~QQuick3DContentLayer()
75{
76
77}
78
79QT_END_NAMESPACE
Combined button and popup list for selecting options.