- Qt 6.12
- Qt 3D
- C++ Classes
- Qt3DLogic (Deprecated)
- QFrameAction
- Qt 6.12.0 Reference Documentation

# Qt3DLogic::QFrameAction Class

class Qt3DLogic::QFrameAction

Provides a way to have a synchronous function executed each frame. More...

Header: | `#include <qframeaction.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS 3dlogic)` `target_link_libraries(mytarget PRIVATE Qt6::3dlogic)`
qmake: | `QT += 3dlogic`
In QML: | FrameAction
Inherits: | Qt3DCore::QComponent
Status: | Deprecated

This class is deprecated. We strongly advise against using it in new code.

- List of all members, including inherited members

## Public Functions

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

## Signals

void | triggered(float dt)

## Detailed Description

The QFrameAction provides a way to perform tasks each frame in a synchronized way with the Qt3D backend. This is useful to implement some aspects of application logic and to prototype functionality that can later be folded into an additional Qt3D aspect.

For example, the QFrameAction can be used to animate a property in sync with the Qt3D engine where a Qt Quick animation element is not perfectly synchronized and may lead to stutters in some cases.

To execute your own code each frame connect to the QFrameAction::triggered signal.

## Member Function Documentation

### `[explicit]` QFrameAction::QFrameAction(Qt3DCore::QNode *parent = nullptr)

Constructs a new QFrameAction instance with parent parent.

### `[signal]` void QFrameAction::triggered(float dt)

This signal is emitted each frame with dt being the time (in seconds) since the last triggering.