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.
32 lines
560 B
32 lines
560 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 activate(); |
|
void deactivate(); |
|
|
|
signals: |
|
void ticked(); |
|
|
|
private slots: |
|
void onTimer(); |
|
|
|
private: |
|
AnimTimer(); |
|
QTimer m_timer; |
|
QHash<QString, LottieIcon *> m_icons; |
|
int m_activeRef = 0; |
|
};
|
|
|