class QLayer#

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

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QLayer

Synopsis#

Properties#

Methods#

Signals#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

QLayer works in conjunction with the QLayerFilter in the FrameGraph.

A QLayer can be applied to a subtree of entities by setting the recursive property to true.

 #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);
layer1->setRecursive(true);
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

QLayerFilter

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property recursiveᅟ: bool#

Specifies if the layer is also applied to the entity subtree.

Access functions:
__init__([parent=None])#
Parameters:

parentQNode

Constructs a new QLayer with the specified parent.

recursive()#
Return type:

bool

See also

setRecursive()

Getter of property recursiveᅟ .

recursiveChanged()#

Notification signal of property recursiveᅟ .

setRecursive(recursive)#
Parameters:

recursive – bool

See also

recursive()

Setter of property recursiveᅟ .