aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgsprite.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-07-04 18:15:28 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-06 10:09:09 +0200
commit29c4b643272a43022081cce063394bac823ab529 (patch)
tree10e4fe15bdf68dec90edac0d67b949a92d9204d5 /src/declarative/items/qsgsprite.cpp
parent87822d24df32311a50dc87ded55ad4d17e8226f0 (diff)
Squashed Particle System Stateful Rewrite
Add TargetAffector Fix for ParticlePainter offsets Adds a particleStates property to ParticleSystem Augment SpriteGoal to change system states as well Also add 'collidingParticles' list to affector. Particle Stochastic States Now actually working, and you can put emitters, affectors and painters inside their targeted state. Fireworks example uses states instead of delegates. Replaced the delegate example with a text thing. The examples launcher now also contains all the custom examples. Adds CumulativeDirection and working null Affector (for affected signal). Add spaces after all flow control keywords. Change-Id: I77b7e3044a9800dbfff6db833914d63127602cf5 Reviewed-on: http://codereview.qt.nokia.com/968 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgsprite.cpp')
-rw-r--r--src/declarative/items/qsgsprite.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/items/qsgsprite.cpp b/src/declarative/items/qsgsprite.cpp
index 694976a540..794ae519a3 100644
--- a/src/declarative/items/qsgsprite.cpp
+++ b/src/declarative/items/qsgsprite.cpp
@@ -40,6 +40,9 @@
****************************************************************************/
#include "qsgsprite_p.h"
+//TODO: Split out particle system dependency
+#include "qsgparticlesystem_p.h"
+#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -54,4 +57,17 @@ QSGSprite::QSGSprite(QObject *parent) :
{
}
+void redirectError(QDeclarativeListProperty<QObject> *prop, QObject *value)
+{
+ qWarning() << "Could not add " << value << " to state" << prop->object << "as it is not associated with a particle system.";
+}
+
+QDeclarativeListProperty<QObject> QSGSprite::particleChildren(){
+ QSGParticleSystem* system = qobject_cast<QSGParticleSystem*>(parent());
+ if (system)
+ return QDeclarativeListProperty<QObject>(this, 0, &QSGParticleSystem::stateRedirect);
+ else
+ return QDeclarativeListProperty<QObject>(this, 0, &redirectError);
+}
+
QT_END_NAMESPACE