本页内容

Qt3DAnimation::QAnimationClipLoader Class

class Qt3DAnimation::QAnimationClipLoader

支持从文件中加载关键帧动画数据。更多内容...

标题: #include <qanimationcliploader.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
继承自: Qt3DAnimation::QAbstractAnimationClip
状态: 技术预览

该类处于技术预览阶段,内容可能会有变动。

公共类型

enum Status { NotReady, Ready, Error }

属性

公共函数

QUrl source() const
Qt3DAnimation::QAnimationClipLoader::Status status() const

公共插槽

void setSource(const QUrl &source)

信号

void sourceChanged(const QUrl &source)
void statusChanged(Qt3DAnimation::QAnimationClipLoader::Status status)

详细说明

成员类型文档

enum QAnimationClipLoader::Status

此枚举用于标识动画片段的状态。

常量值描述
Qt3DAnimation::QAnimationClipLoader::NotReady0该剪辑尚未加载
Qt3DAnimation::QAnimationClipLoader::Ready1剪辑已成功加载
Qt3DAnimation::QAnimationClipLoader::Error2加载片段时发生错误

属性文档

source : QUrl

存储用于加载动画片段的源 URL。目前支持 glTF2 以及原生Qt 3D JSON 动画文件格式。

如果文件中包含多个动画,可以通过源 URL 中的查询参数来选择要加载的动画。支持的查询参数包括 animationIndex 和 animationName。如果同时指定了这两个参数,则会忽略 animationName。

如果文件中仅包含一个动画,则无需指定 animationIndex 或 animationName。系统将直接使用该文件中唯一的动画。

访问函数:

QUrl source() const
void setSource(const QUrl &source)

通知器信号:

void sourceChanged(const QUrl &source)

[read-only] status : Status

该属性包含动画片段的状态。

访问函数:

Qt3DAnimation::QAnimationClipLoader::Status status() const

通知器信号:

void statusChanged(Qt3DAnimation::QAnimationClipLoader::Status status)

成员函数文档

Qt3DAnimation::QAnimationClipLoader::Status QAnimationClipLoader::status() const

返回动画片段的状态。

注意: 此为 status 属性的获取 函数。

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