QAnimationGroup Class
QAnimationGroup 클래스는 애니메이션 그룹을 위한 추상 기본 클래스입니다. 더 보기...
| 헤더: | #include <QAnimationGroup> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 상속: | QAbstractAnimation |
| 상속받는 항목: |
- 상속받은 멤버를 포함한 모든 멤버 목록
- QAnimationGroup은 애니메이션 프레임워크의 일부입니다.
공개 함수
| 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는 QParallelAnimationGroup 와 QSequentialAnimationGroup 라는 두 가지 그룹을 제공합니다. 자세한 내용은 해당 클래스 설명을 참조하십시오.
QAnimationGroup은 QAbstractAnimation 를 상속받기 때문에, 그룹을 결합하여 복잡한 애니메이션 그래프를 쉽게 구성할 수 있습니다. QAbstractAnimation 가 속한 그룹은 group() 함수를 사용하여 조회할 수 있습니다.
최상위 애니메이션 그룹을 시작하려면 QAbstractAnimation 에서 start() 함수를 사용하기만 하면 됩니다. 여기서 최상위 애니메이션 그룹이란 다른 그룹 내에 포함되지 않은 그룹을 의미합니다. 하위 그룹을 직접 시작하는 것은 지원되지 않으며, 예상치 못한 동작을 유발할 수 있습니다.
QAnimationGroup은 애니메이션을 추가하고 가져오는 메서드를 제공합니다. 이 외에도 removeAnimation()를 호출하여 애니메이션을 제거하고, clear()를 호출하여 애니메이션 그룹을 지울 수 있습니다. QEvent::ChildAdded 및 QEvent::ChildRemoved 이벤트를 수신하여 그룹 내 애니메이션의 변경 사항을 추적할 수 있습니다.
QAnimationGroup은 관리하는 애니메이션에 대한 소유권을 가지며, 애니메이션 그룹이 삭제될 때 해당 애니메이션들이 삭제되도록 보장합니다.
QAbstractAnimation, QVariantAnimation 및 애니메이션 프레임워크도 참조하십시오 .
멤버 함수 설명서
QAnimationGroup::QAnimationGroup(QObject *parent = nullptr)
QAnimationGroup을 생성합니다. ` parent `는 ` QObject`의 생성자에 전달됩니다.
[virtual noexcept] QAnimationGroup::~QAnimationGroup()
애니메이션 그룹을 삭제합니다. 또한 해당 그룹에 속한 모든 애니메이션도 함께 삭제됩니다.
void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
이 그룹에 animation 을 추가합니다. 그러면 인덱스가 animationCount()과 동일한 insertAnimation 이 호출됩니다.
참고: 이 그룹이 해당 애니메이션의 소유권을 갖게 됩니다.
경고: 이 메서드는 애니메이션 루프를 확인하지 않습니다. 추가된 animation 이 this 애니메이션 그룹을 직간접적으로 포함하지 않도록 하는 것은 개발자의 책임입니다.
참조: 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 *event)를 재구현합니다.
int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
animation 의 인덱스를 반환합니다. 반환된 인덱스는 인덱스를 인수로 받는 다른 함수에 전달할 수 있습니다.
insertAnimation(), animationAt(), takeAnimation()도 참조하십시오 .
void QAnimationGroup::insertAnimation(int index, QAbstractAnimation *animation)
index 에서 ‘ animation ’를 이 애니메이션 그룹에 삽입합니다. index 가 0이면 애니메이션이 시작 부분에 삽입됩니다. index 가 animationCount()이면 애니메이션이 끝 부분에 삽입됩니다.
참고: 이 그룹이 애니메이션의 소유권을 갖습니다.
경고: 이 메서드는 애니메이션 루프를 확인하지 않습니다. 추가된 animation 에 this 애니메이션 그룹이 직간접적으로 포함되지 않도록 하는 것은 개발자의 책임입니다.
takeAnimation(), addAnimation(), indexOfAnimation() 및 removeAnimation()도 참조하십시오 .
void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)
이 그룹에서 animation 을 제거합니다. animation 의 소유권이 호출자에게 이전됩니다.
takeAnimation(), insertAnimation() 및 addAnimation()도 참조하십시오 .
QAbstractAnimation *QAnimationGroup::takeAnimation(int index)
index 에 있는 애니메이션을 반환하고, 해당 애니메이션을 애니메이션 그룹에서 제거합니다.
참고: 애니메이션의소유권이 호출자에게 이전됩니다.
관련 항목: removeAnimation(), addAnimation(), insertAnimation(), indexOfAnimation().
© 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.