QKeyframeAnimation Class

class Qt3DAnimation::QKeyframeAnimation

シンプルなキーフレームアニメーションを実装したクラスで、QTransform...続きを読む

ヘッダー #include <QKeyframeAnimation>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake QT += 3danimation
QML で KeyframeAnimation
を継承しています: Qt3DAnimation::QAbstractAnimation
ステータス非推奨

パブリックな型

enum RepeatMode { None, Constant, Repeat }

プロパティ

パブリック機能

QKeyframeAnimation(QObject *parent = nullptr)
void addKeyframe(Qt3DCore::QTransform *keyframe)
QEasingCurve easing() const
Qt3DAnimation::QKeyframeAnimation::RepeatMode endMode() const
QList<float> framePositions() const
QList<Qt3DCore::QTransform *> keyframeList() const
void removeKeyframe(Qt3DCore::QTransform *keyframe)
void setKeyframes(const QList<Qt3DCore::QTransform *> &keyframes)
Qt3DAnimation::QKeyframeAnimation::RepeatMode startMode() const
Qt3DCore::QTransform *target() const
QString targetName() const

パブリックスロット

void setEasing(const QEasingCurve &easing)
void setEndMode(Qt3DAnimation::QKeyframeAnimation::RepeatMode mode)
void setFramePositions(const QList<float> &positions)
void setStartMode(Qt3DAnimation::QKeyframeAnimation::RepeatMode mode)
void setTarget(Qt3DCore::QTransform *target)
void setTargetName(const QString &name)

シグナル

void easingChanged(const QEasingCurve &easing)
void endModeChanged(Qt3DAnimation::QKeyframeAnimation::RepeatMode endMode)
void framePositionsChanged(const QList<float> &positions)
void startModeChanged(Qt3DAnimation::QKeyframeAnimation::RepeatMode startMode)
void targetChanged(Qt3DCore::QTransform *target)
void targetNameChanged(const QString &name)

詳しい説明

Qt3DAnimation::QKeyframeAnimation クラスは、QTransform をアニメーション化するために使用できる、シンプルなキーフレームアニメーションを実装しています。キーフレームは、補間され、ターゲットQTransform に適用される、複数の時間指定された QTransforms で構成されます。QEasingCurve は、補間器を制御するためにキーフレーム間で使用されます。RepeatMode は、QKeyframeAnimation に設定された位置が、キーフレームの位置で定義された値より下または上にある場合に設定できます。

メンバタイプのドキュメント

enum QKeyframeAnimation::RepeatMode

この列挙は、キーフレーム値以外の位置値がどのように扱われるかを指定します。

定数説明
Qt3DAnimation::QKeyframeAnimation::None0アニメーションはターゲットのトランスフォームに適用されません。
Qt3DAnimation::QKeyframeAnimation::Constant1エッジキーフレーム値が使用されます。
Qt3DAnimation::QKeyframeAnimation::Repeat2アニメーションは繰り返される。

プロパティの説明

easing : QEasingCurve

キーフレーム間のインターポレーターのイージングカーブを保持します。

アクセス関数:

QEasingCurve easing() const
void setEasing(const QEasingCurve &easing)

通知シグナル:

void easingChanged(const QEasingCurve &easing)

endMode : RepeatMode

最後のフレーム位置より大きい位置値のリピートモードを保持する。

アクセス機能

Qt3DAnimation::QKeyframeAnimation::RepeatMode endMode() const
void setEndMode(Qt3DAnimation::QKeyframeAnimation::RepeatMode mode)

通知信号

void endModeChanged(Qt3DAnimation::QKeyframeAnimation::RepeatMode endMode)

framePositions : QList<float>

キーフレームの位置を保持します。リストの各位置は、同じインデックスを持つ対応するキーフレームの位置を指定します。値は昇順でなければなりません。値は正でも負でもよく、定義済みの単位はありません。

アクセス関数:

QList<float> framePositions() const
void setFramePositions(const QList<float> &positions)

通知シグナル:

void framePositionsChanged(const QList<float> &positions)

startMode : RepeatMode

最初のフレーム位置より小さい位置の繰り返しモードを保持する。

アクセス機能

Qt3DAnimation::QKeyframeAnimation::RepeatMode startMode() const
void setStartMode(Qt3DAnimation::QKeyframeAnimation::RepeatMode mode)

通知信号

void startModeChanged(Qt3DAnimation::QKeyframeAnimation::RepeatMode startMode)

target : Qt3DCore::QTransform*

アニメーションを適用するターゲットQTransform を保持します。

アクセス関数:

Qt3DCore::QTransform *target() const
void setTarget(Qt3DCore::QTransform *target)

通知シグナル

void targetChanged(Qt3DCore::QTransform *target)

targetName : QString

ターゲットトランスフォームの名前を保持します。これは、キーフレーム アニメーションにターゲット トランスフォームを簡単に一致させるための便利なプロパティです。名前は通常、ターゲットトランスフォームの親エンティティの名前と同じですが、そうである必要はありません。

アクセス関数:

QString targetName() const
void setTargetName(const QString &name)

通知シグナル

void targetNameChanged(const QString &name)

メンバ関数ドキュメント

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

QKeyframeAnimation をparent で構築します。

void QKeyframeAnimation::addKeyframe(Qt3DCore::QTransform *keyframe)

アニメーションの最後に新しいkeyframe を追加する。QTransform は複数回アニメーションに追加できる。

QList<Qt3DCore::QTransform *> QKeyframeAnimation::keyframeList() const

キーフレームのリストを返す。

void QKeyframeAnimation::removeKeyframe(Qt3DCore::QTransform *keyframe)

アニメーションからkeyframe を削除します。同じQTransform が複数回キーフレームとして設定された場合、すべての設定が削除されます。

void QKeyframeAnimation::setKeyframes(const QList<Qt3DCore::QTransform *> &keyframes)

アニメーションのkeyframes を設定します。古いキーフレームはクリアされます。

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