summaryrefslogtreecommitdiffstats
path: root/src/imports/particles/qdeclarativeparticles.cpp
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-11 07:59:23 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-11 07:59:23 (GMT)
commitaf7e91af39ea6e9bb64794d7be2f4ade52c17be2 (patch)
treee7f4759a5df9bac7fb57dc2932c00a38c1d6f2b8 /src/imports/particles/qdeclarativeparticles.cpp
parent0e9bb332eec2bee29fe736aea76c30c66c69a9d0 (diff)
downloadQt-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.cpp16
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;
};