Qt3DAnimation::QKeyframeAnimation Class
class Qt3DAnimation::QKeyframeAnimationQTransform 에 간단한 키프레임 애니메이션을 구현하는 클래스입니다. 더 보기...
| 헤더: | #include <qkeyframeanimation.h> |
| 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 에 애니메이션을 적용하는 데 사용할 수 있는 간단한 키프레임 애니메이션을 구현합니다. 키프레임은 여러 개의 시간 지정된 QTransforms로 구성되며, 이들은 보간되어 대상 QTransform 에 적용됩니다. 키프레임 간에는 QEasingCurve 가 사용되어 보간기를 제어합니다. QKeyframeAnimation에 설정된 위치가 키프레임 위치에 정의된 값보다 낮거나 높을 때를 대비하여 RepeatMode 을 설정할 수 있습니다.
멤버 유형 문서
enum QKeyframeAnimation::RepeatMode
이 열거형은 키프레임 값 범위를 벗어난 위치 값을 어떻게 처리할지 지정합니다.
| 상수 | 값 | 설명 |
|---|---|---|
Qt3DAnimation::QKeyframeAnimation::None | 0 | 애니메이션이 대상 변환에 적용되지 않습니다. |
Qt3DAnimation::QKeyframeAnimation::Constant | 1 | 엣지 키프레임 값이 사용됩니다. |
Qt3DAnimation::QKeyframeAnimation::Repeat | 2 | 애니메이션이 반복됩니다. |
속성 설명
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)
parent 을 사용하여 QKeyframeAnimation을 생성합니다.
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 ’을 설정합니다. 기존 키프레임은 삭제됩니다.
© 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.