En esta página

Qt3DRender::QLayer Class

class Qt3DRender::QLayer

La clase QLayer permite filtrar qué entidades se van a representar. Más información...

Encabezado: #include <qlayer.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
En QML: Layer
Heredan de: Qt3DCore::QComponent
Estado: Obsoleto

Esta clase está obsoleta. Se desaconseja encarecidamente su uso en código nuevo.

Propiedades

Funciones públicas

QLayer(Qt3DCore::QNode *parent = nullptr)
bool recursive() const
void setRecursive(bool recursive)

Señales

Descripción detallada

Qt3DRender::QLayer funciona en combinación con la función « Qt3DRender::QLayerFilter » en el FrameGraph.

Se puede aplicar un QLayer a un subárbol de entidades estableciendo la propiedad «recursive» en «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);

...

Véase también « Qt3DRender::QLayerFilter ».

Documentación de la propiedad

recursive : bool

Especifica si la capa también se aplica al subárbol de la entidad.

Funciones de acceso:

bool recursive() const
void setRecursive(bool recursive)

Señal del notificador:

void recursiveChanged()

Documentación de funciones de miembro

[explicit] QLayer::QLayer(Qt3DCore::QNode *parent = nullptr)

Crea un nuevo objeto `QLayer` con el ` parent` especificado.

© 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.