QSubtreeEnabler Class | Qt 3D 6.4.3

- Qt 6.4
- Qt 3D
- C++ Classes
- Qt3DRender
- QSubtreeEnabler
- Qt 6.4.3 Reference Documentation

# QSubtreeEnabler Class

class Qt3DRender::QSubtreeEnabler

Enables or disables entire subtrees of framegraph nodes. More...

Header: | #include <QSubtreeEnabler>
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: | QT += 3drender
Since: | Qt 5.14
Instantiated By: | SubtreeEnabler
Inherits: | Qt3DRender::QFrameGraphNode

- List of all members, including inherited members

## Public Types

enum | Enablement { Persistent, SingleShot }

## Properties

- enablement : Enablement

## Public Functions

Qt3DRender::QSubtreeEnabler::Enablement | enablement() const
void | requestUpdate()
void | setEnablement(Qt3DRender::QSubtreeEnabler::Enablement enablement)

## Signals

void | enablementChanged(Qt3DRender::QSubtreeEnabler::Enablement enablement)

## Detailed Description

While QFrameGraphNodes can be individually enabled and disabled via the `enabled` property, this can become tedious when an entire path needs to be turned on or off. QSubtreeEnabler is a convenience node that makes this use case trivial, allowing all of its children to be controlled by a single switch.

QSubtreeEnabler is enabled by default.

## Member Type Documentation

### enum QSubtreeEnabler::Enablement

Specifies whether subtree enablement is persistent or transient.

Constant | Value | Description
--- | --- | ---
`Qt3DRender::QSubtreeEnabler::Persistent` | `0` | The value of enabled is persistent. This is the default.
`Qt3DRender::QSubtreeEnabler::SingleShot` | `1` | The value of enabled will last for a single frame and then be reset to false. This might be used for a subtree drawing to an FBO, for example, to only update the FBO when the relevant portions of the scene changed.

## Property Documentation

### enablement : Enablement

Controls whether subtree enablement is persistent or transient.

Access functions:

Qt3DRender::QSubtreeEnabler::Enablement | enablement() const
void | setEnablement(Qt3DRender::QSubtreeEnabler::Enablement enablement)

Notifier signal:

void | enablementChanged(Qt3DRender::QSubtreeEnabler::Enablement enablement)

## Member Function Documentation

### `[invokable]` void QSubtreeEnabler::requestUpdate()

Requests that the subtree be enabled.

A convenience method intended to be used with `SingleShot` enablement.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.