You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
625 B

#pragma once
#include <QObject>
#include <QTimer>
#include <QHash>
class LottieIcon;
class AnimTimer : public QObject {
Q_OBJECT
public:
static AnimTimer *instance();
void registerIcon(const QString &key, LottieIcon *icon);
void unregisterIcon(const QString &key);
LottieIcon *icon(const QString &key) const;
void logRegisteredIcons() const;
void activate();
void deactivate();
static void shutdown();
signals:
void ticked();
private slots:
void onTimer();
private:
AnimTimer();
QTimer m_timer;
QHash<QString, LottieIcon *> m_icons;
int m_activeRef = 0;
};