QLayer Class | Qt 3D 5.9

Qt 5.9 | Qt 3D | C++ Classes | QLayer

Qt 5.9.9 Reference Documentation

# QLayer Class

(Qt3DRender::QLayer)

The QLayer class provides a way of filtering which entities will be rendered. More...

Header: | #include <QLayer>
qmake: | QT += 3drender
Since: | Qt 5.5
Instantiated By: | Layer
Inherits: | Qt3DCore::QComponent

- List of all members, including inherited members

## Public Functions

| QLayer(Qt3DCore::QNode *parent = nullptr)

- 2 public functions inherited from Qt3DCore::QComponent
- 11 public functions inherited from Qt3DCore::QNode

## Protected Functions

| QLayer(QLayerPrivate &dd, Qt3DCore::QNode *parent = nullptr)

- 2 protected functions inherited from Qt3DCore::QNode

### Additional Inherited Members

- 1 property inherited from Qt3DCore::QComponent
- 3 properties inherited from Qt3DCore::QNode
- 1 public slot inherited from Qt3DCore::QComponent
- 3 public slots inherited from Qt3DCore::QNode
- 3 signals inherited from Qt3DCore::QComponent
- 4 signals inherited from Qt3DCore::QNode

## Detailed Description

The QLayer class provides a way of filtering which entities will be rendered.

Qt3DRender::QLayer works in conjunction with the Qt3DRender::QLayerFilter in the FrameGraph.

Qt3DRender::QLayer doesn't define any new properties but is supposed to only be referenced.

       #include <Qt3DCore/QEntity>
       #include <Qt3DRender/QGeometryRenderer>
       #include <Qt3DRender/QLayer>
       #include <Qt3DRender/QLayerFilter>
       #include <Qt3DRender/QViewport>

      // Scene
      Qt3DCore::QEntity *rootEntity = new Qt3DCore::Qt3DCore::QEntity;

      Qt3DCore::QEntity *renderableEntity = new Qt3DCore::Qt3DCore::QEntity(rootEntity);
      Qt3DRender::QGeometryRenderer *geometryRenderer = new Qt3DCore::QGeometryRenderer(renderableEntity);
      Qt3DRender::QLayer *layer1 = new Qt3DCore::QLayer(renderableEntity);
      renderableEntity->addComponent(geometryRenderer);
      renderableEntity->addComponent(layer1);

      ...

      // FrameGraph
      Qt3DRender::QViewport *viewport = new Qt3DRender::QViewport;
      Qt3DRender::QLayerFilter *layerFilter = new Qt3DRender::QLayerFilter(viewport);
      layerFilter->addLayer(layer1);

      ...

See also Qt3DRender::QLayerFilter.

## Member Function Documentation

### QLayer::QLayer(Qt3DCore::QNode *parent = nullptr)

Constructs a new QLayer with the specified parent.

### `[protected]` QLayer::QLayer(QLayerPrivate &dd, Qt3DCore::QNode *parent = nullptr)

Copy constructor.