QLayerFilter Class


Controls layers drawn in a frame graph branch. More...

Header: #include <QLayerFilter>
qmake: QT += 3drender
Since: Qt 5.5
Instantiated By: LayerFilter
Inherits: Qt3DRender::QFrameGraphNode

Public Types

enum FilterMode { AcceptAnyMatchingLayers, AcceptAllMatchingLayers, DiscardAnyMatchingLayers, DiscardAllMatchingLayers }


Public Functions

QLayerFilter(Qt3DCore::QNode *parent = nullptr)
void addLayer(QLayer *layer)
FilterMode filterMode() const
QVector<QLayer *> layers() const
void removeLayer(QLayer *layer)
void setFilterMode(FilterMode filterMode)


void filterModeChanged(FilterMode filterMode)

Protected Functions

QLayerFilter(QLayerFilterPrivate &dd, Qt3DCore::QNode *parent = nullptr)

Additional Inherited Members

Detailed Description

Controls layers drawn in a frame graph branch.

A Qt3DRender::QLayerFilter can be used to instruct the renderer as to which layer(s) to draw in that branch of the frame graph. QLayerFilter selects which entities to draw based on the QLayer instance(s) added to the QLayerFilter and as components to Qt3DCore::QEntity.

QLayerFilter can be configured to select or discard entities with a specific QLayer depending on the filterMode property. By default, entities referencing one of the QLayer objects that are also being referenced by the QLayerFilter are selected (AcceptAnyMatchingLayers).

Within the FrameGraph tree, multiple QLayerFilter nodes can be nested within a branch going from root to a leaf. In that case the filtering will first operate on all entities of the scene using the filtering method specified by the first declared QLayerFilter. Then the filtered subset of entities will be filtered again based on the filtering method set on the second QLayerFilter declared. This is then repeated until all QLayerFilter nodes of the branch have been consumed.

Member Type Documentation

enum QLayerFilter::FilterMode

Specifies the rules for selecting entities to draw.

Qt3DRender::QLayerFilter::AcceptAnyMatchingLayers0Accept entities that reference one or more QLayer objects added to this QLayerFilter. This is the default
Qt3DRender::QLayerFilter::AcceptAllMatchingLayers1Accept entities that reference all the QLayer objects added to this QLayerFilter
Qt3DRender::QLayerFilter::DiscardAnyMatchingLayers2Discard entities that reference one or more QLayer objects added to this QLayerFilter
Qt3DRender::QLayerFilter::DiscardAllMatchingLayers3Discard entities that reference all QLayer objects added to this QLayerFilter

Property Documentation

filterMode : FilterMode

Holds the filter mode specifying the entities to select for drawing.

The default value is AcceptMatchingLayers.

Access functions:

FilterMode filterMode() const
void setFilterMode(FilterMode filterMode)

Notifier signal:

void filterModeChanged(FilterMode filterMode)

Member Function Documentation

QLayerFilter::QLayerFilter(Qt3DCore::QNode *parent = nullptr)

Default constructs an instance of QLayerFilter.

[protected] QLayerFilter::QLayerFilter(QLayerFilterPrivate &dd, Qt3DCore::QNode *parent = nullptr)

Copy constructor.

void QLayerFilter::addLayer(QLayer *layer)

Add layer to the current list of layers

QVector<QLayer *> QLayerFilter::layers() const

Returns the current list of layers

void QLayerFilter::removeLayer(QLayer *layer)

Remove layer from the current list of layers

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