跳转至

ui/components/animation_group.h

Animation Group Interface. More...

Namespaces

Name
cf
cf::ui
cf::ui::components

Classes

Name
class cf::ui::components::ICFAnimationGroup
Animation group for combining multiple animations.

Detailed Description

Animation Group Interface.

Author: Charliechen114514 (chengh1922@mails.jlu.edu.cn)

Version: 0.1

Date: 2026-02-28

Copyright: Copyright © 2026

Defines the animation group interface for running multiple animations together either in parallel or sequentially.

Source code

#pragma once

#include "animation.h"
#include "base/weak_ptr/weak_ptr.h"
#include "export.h"
#include <QObject>
#include <unordered_set>

namespace cf::ui::components {

class CF_UI_EXPORT ICFAnimationGroup : public ICFAbstractAnimation {
    Q_OBJECT
  public:
    enum class Mode { Parallel, Sequential };
    Q_ENUM(Mode);

    ICFAnimationGroup(QObject* parent = nullptr) : ICFAbstractAnimation(parent) {}

    void addAnimation(cf::WeakPtr<ICFAbstractAnimation> animation) { animations.insert(animation); }

    void removeAnimation(cf::WeakPtr<ICFAbstractAnimation> animation) {
        animations.erase(animation);
    }

  private:
    std::unordered_set<cf::WeakPtr<ICFAbstractAnimation>> animations;
};

} // namespace cf::ui::components

Updated on 2026-03-09 at 10:14:01 +0000