本页内容

Qt3DAnimation::QAnimationGroup Class

class Qt3DAnimation::QAnimationGroup

一个将动画聚合在一起的类。更多...

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

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

属性

公共函数

QAnimationGroup(QObject *parent = nullptr)
void addAnimation(Qt3DAnimation::QAbstractAnimation *animation)
QList<Qt3DAnimation::QAbstractAnimation *> animationList()
float duration() const
QString name() const
float position() const
void removeAnimation(Qt3DAnimation::QAbstractAnimation *animation)
void setAnimations(const QList<Qt3DAnimation::QAbstractAnimation *> &animations)

公共槽位

void setName(const QString &name)
void setPosition(float position)

信号

void durationChanged(float duration)
void nameChanged(const QString &name)
void positionChanged(float position)

详细说明

Qt3DAnimation::QAnimationGroup 该类用于将多个动画组合成一个动画组,使其能够作为一个整体运行。设置给该组的位移值将同时应用于组内所有动画。持续时间取各动画中时间最长者。这些动画可以是任何受支持的动画类型,且名称不必相同。

属性文档

[read-only] duration : float

存储该组中动画的最长持续时间。

访问函数:

float duration() const

通知信号:

void durationChanged(float duration)

name : QString

存储动画组的名称。

访问函数:

QString name() const
void setName(const QString &name)

通知器信号:

void nameChanged(const QString &name)

position : float

保存动画位置。

访问函数:

float position() const
void setPosition(float position)

通知器信号:

void positionChanged(float position)

成员函数文档

[explicit] QAnimationGroup::QAnimationGroup(QObject *parent = nullptr)

使用parent 创建一个 QAnimationGroup。

void QAnimationGroup::addAnimation(Qt3DAnimation::QAbstractAnimation *animation)

将新的animation 添加到该组中。

QList<Qt3DAnimation::QAbstractAnimation *> QAnimationGroup::animationList()

返回该组中的动画列表。

void QAnimationGroup::removeAnimation(Qt3DAnimation::QAbstractAnimation *animation)

将animation 从该组中移除。

void QAnimationGroup::setAnimations(const QList<Qt3DAnimation::QAbstractAnimation *> &animations)

将animations 设置为该组。旧的动画将被移除。

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