QAnimationGroup Class

QAnimationGroup 클래스는 애니메이션 그룹을 위한 추상 베이스 클래스입니다. 더 보기...

Header: #include <QAnimationGroup>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
상속합니다: QAbstractAnimation
상속 대상

QParallelAnimationGroupQSequentialAnimationGroup

공용 함수

QAnimationGroup(QObject *parent = nullptr)
virtual ~QAnimationGroup()
void addAnimation(QAbstractAnimation *animation)
QAbstractAnimation *animationAt(int index) const
int animationCount() const
void clear()
int indexOfAnimation(QAbstractAnimation *animation) const
void insertAnimation(int index, QAbstractAnimation *animation)
void removeAnimation(QAbstractAnimation *animation)
QAbstractAnimation *takeAnimation(int index)

재구현된 보호 함수

virtual bool event(QEvent *event) override

상세 설명

애니메이션 그룹은 애니메이션( QAbstractAnimation 의 서브클래스)을 위한 컨테이너입니다. 그룹은 일반적으로 애니메이션의 state 관리, 즉 애니메이션을 시작, 중지, 재개 및 일시 중지할 시기를 결정합니다. 현재 Qt는 QParallelAnimationGroupQSequentialAnimationGroup 두 개의 그룹을 제공합니다. 자세한 내용은 해당 클래스 설명을 참조하세요.

QAnimationGroup은 QAbstractAnimation 에서 상속되므로 그룹을 결합하여 복잡한 애니메이션 그래프를 쉽게 구성할 수 있습니다. group () 함수를 사용하여 QAbstractAnimation 에 속한 그룹을 쿼리할 수 있습니다.

최상위 애니메이션 그룹을 시작하려면 QAbstractAnimation 에서 start() 함수를 사용하면 됩니다. 최상위 애니메이션 그룹이란 다른 그룹에 포함되지 않은 그룹을 의미합니다. 하위 그룹을 직접 시작하는 것은 지원되지 않으며 예기치 않은 동작이 발생할 수 있습니다.

QAnimationGroup은 애니메이션을 추가하고 검색하는 메서드를 제공합니다. 그 외에도 removeAnimation()를 호출하여 애니메이션을 제거하고 clear()를 호출하여 애니메이션 그룹을 지울 수 있습니다. QEvent::ChildAddedQEvent::ChildRemoved 이벤트를 수신하여 그룹 애니메이션의 변경 사항을 추적할 수 있습니다.

QAnimationGroup은 관리하는 애니메이션의 소유권을 가지며 애니메이션 그룹이 삭제될 때 애니메이션이 삭제되도록 합니다.

QAbstractAnimation, QVariantAnimation, 애니메이션 프레임워크도참조하세요 .

멤버 함수 문서

QAnimationGroup::QAnimationGroup(QObject *parent = nullptr)

QObject 의 생성자에 parent 을 전달합니다.

[virtual noexcept] QAnimationGroup::~QAnimationGroup()

애니메이션 그룹을 파괴합니다. 또한 모든 애니메이션을 파괴합니다.

void QAnimationGroup::addAnimation(QAbstractAnimation *animation)

animation 을 이 그룹에 추가합니다. 이렇게 하면 animationCount()와 같은 인덱스를 사용하여 insertAnimation 을 호출합니다.

참고: 이 그룹이 애니메이션의 소유권을 갖습니다.

removeAnimation()도 참조하세요 .

QAbstractAnimation *QAnimationGroup::animationAt(int index) const

이 그룹에 있는 index 애니메이션에 대한 포인터를 반환합니다. 이 함수는 특정 애니메이션에 접근해야 할 때 유용합니다. index 값은 0에서 animationCount() - 1 사이입니다.

animationCount() 및 indexOfAnimation()도 참조하세요 .

int QAnimationGroup::animationCount() const

이 그룹에서 관리하는 애니메이션의 수를 반환합니다.

indexOfAnimation(), addAnimation() 및 animationAt()도 참조하세요 .

void QAnimationGroup::clear()

이 애니메이션 그룹의 모든 애니메이션을 제거 및 삭제하고 현재 시간을 0으로 초기화합니다.

addAnimation() 및 removeAnimation()도 참조하세요 .

[override virtual protected] bool QAnimationGroup::event(QEvent *event)

다시 구현합니다: QAbstractAnimation::event(QEvent * 이벤트).

int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const

animation 의 색인을 반환합니다. 반환된 색인은 색인을 인수로 받는 다른 함수에 전달할 수 있습니다.

insertAnimation(), animationAt(), takeAnimation()도 참조하세요 .

void QAnimationGroup::insertAnimation(int index, QAbstractAnimation *animation)

index 에서 이 애니메이션 그룹에 animation 을 삽입합니다. index 이 0이면 애니메이션이 처음에 삽입됩니다. indexanimationCount()인 경우 애니메이션이 끝에 삽입됩니다.

참고: 그룹이 애니메이션의 소유권을 갖습니다.

takeAnimation(), addAnimation(), indexOfAnimation() 및 removeAnimation()도 참조하세요 .

void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)

animation 을 이 그룹에서 제거합니다. animation 의 소유권이 호출자에게 이전됩니다.

takeAnimation(), insertAnimation() 및 addAnimation()도 참조하세요 .

QAbstractAnimation *QAnimationGroup::takeAnimation(int index)

index 에서 애니메이션을 반환하고 애니메이션 그룹에서 제거합니다.

참고: 애니메이션의 소유권은 호출자에게 이전됩니다.

removeAnimation(), addAnimation(), insertAnimation() 및 indexOfAnimation()도 참조하세요 .

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