本页内容

Qt3DLogic::QFrameAction Class

class Qt3DLogic::QFrameAction

提供了一种在每个帧中执行同步函数的方法。更多内容...

头文件: #include <qframeaction.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dlogic)
target_link_libraries(mytarget PRIVATE Qt6::3dlogic)
qmake: QT += 3dlogic
在 QML 中: FrameAction
继承自: Qt3DCore::QComponent
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

公共函数

QFrameAction(Qt3DCore::QNode *parent = nullptr)

信号

void triggered(float dt)

详细说明

QFrameAction 提供了一种方法,可在每个帧中以与 Qt3D 后端同步的方式执行任务。这对于实现应用程序逻辑的某些方面以及原型设计功能非常有用,这些功能随后可整合到 Qt3D 的其他方面中。

例如,当Qt Quick 动画元素无法实现完美同步,并在某些情况下可能导致卡顿时,可以使用 QFrameAction 使属性动画与 Qt3D 引擎保持同步。

若要在每一帧执行自定义代码,请连接到QFrameAction::triggered 信号。

成员函数文档

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

创建一个新的 QFrameAction 实例,其父对象为parent 。

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

该信号在每个帧中都会发出,其中dt 表示自上次触发以来经过的时间(单位为秒)。

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