diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-03-11 07:59:23 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-03-11 07:59:23 (GMT) |
commit | af7e91af39ea6e9bb64794d7be2f4ade52c17be2 (patch) | |
tree | e7f4759a5df9bac7fb57dc2932c00a38c1d6f2b8 /src/imports/particles/qdeclarativeparticles.cpp | |
parent | 0e9bb332eec2bee29fe736aea76c30c66c69a9d0 (diff) | |
download | Qt-af7e91af39ea6e9bb64794d7be2f4ade52c17be2.zip Qt-af7e91af39ea6e9bb64794d7be2f4ade52c17be2.tar.gz Qt-af7e91af39ea6e9bb64794d7be2f4ade52c17be2.tar.bz2 |
fix particles plugin
Diffstat (limited to 'src/imports/particles/qdeclarativeparticles.cpp')
-rw-r--r-- | src/imports/particles/qdeclarativeparticles.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp index caa0754..9adf780 100644 --- a/src/imports/particles/qdeclarativeparticles.cpp +++ b/src/imports/particles/qdeclarativeparticles.cpp @@ -411,6 +411,20 @@ public: QDeclarativeParticlesPrivate* d; }; +//an animation that just gives a tick +template<class T, void (T::*method)(int)> +class TickAnimationProxy : public QAbstractAnimation +{ +public: + TickAnimationProxy(T *p, QObject *parent = 0) : QAbstractAnimation(parent), m_p(p) {} + virtual int duration() const { return -1; } +protected: + virtual void updateCurrentTime(int msec) { (m_p->*method)(msec); } + +private: + T *m_p; +}; + //--------------------------------------------------------------------------- class QDeclarativeParticlesPrivate : public QDeclarativeItemPrivate { @@ -463,7 +477,7 @@ public: QList<QPair<int, int> > bursts;//countLeft, emissionRate pairs QList<QDeclarativeParticle> particles; - QTickAnimationProxy<QDeclarativeParticlesPrivate, &QDeclarativeParticlesPrivate::tick> clock; + TickAnimationProxy<QDeclarativeParticlesPrivate, &QDeclarativeParticlesPrivate::tick> clock; }; |