aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-06-09 15:23:12 +1000
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-06-09 15:23:12 +1000
commit7cf421d04d19441a6e17ab9460dc4560374a5bcc (patch)
tree18873dba15650288d4b375b24b4dddc9e61e3d56
parent9bcea0318cae2f7fbfd24195ff9272cb369cb6e5 (diff)
parent283a37447b8c400957c4da7dda35a84ea86ac4ad (diff)
Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging into qtquick2
-rw-r--r--demos/declarative/minehunt/MinehuntCore/Explosion.qml2
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml2
-rw-r--r--demos/declarative/snake/content/Cookie.qml2
-rw-r--r--demos/declarative/snake/content/Link.qml2
-rw-r--r--src/declarative/particles/qsgparticleaffector.cpp2
-rw-r--r--src/declarative/particles/qsgparticleemitter.cpp2
-rw-r--r--src/declarative/particles/qsgparticlepainter.cpp4
-rw-r--r--src/declarative/particles/qsgparticlesystem.cpp10
-rw-r--r--src/declarative/particles/qsgparticlesystem_p.h1
9 files changed, 20 insertions, 7 deletions
diff --git a/demos/declarative/minehunt/MinehuntCore/Explosion.qml b/demos/declarative/minehunt/MinehuntCore/Explosion.qml
index e537350584..a5f3f1bc31 100644
--- a/demos/declarative/minehunt/MinehuntCore/Explosion.qml
+++ b/demos/declarative/minehunt/MinehuntCore/Explosion.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import QtQuick.Particles 1.0
+import Qt.labs.particles 1.0
Item {
property bool explode : false
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
index b252ac5f5e..61005382da 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -85,7 +85,7 @@ Component {
anchors.centerIn: parent; anchors.verticalCenterOffset: -30
path: Path {
PathAttribute { name: 'z'; value: 9999.0 }
- PathLineShape { x: 1; y: 1 }
+ PathLine { x: 1; y: 1 }
PathAttribute { name: 'z'; value: 0.0 }
}
}
diff --git a/demos/declarative/snake/content/Cookie.qml b/demos/declarative/snake/content/Cookie.qml
index 0974125972..29b56f9e88 100644
--- a/demos/declarative/snake/content/Cookie.qml
+++ b/demos/declarative/snake/content/Cookie.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import QtQuick.Particles 1.0
+import Qt.labs.particles 1.0
Item {
id: root
diff --git a/demos/declarative/snake/content/Link.qml b/demos/declarative/snake/content/Link.qml
index aa2b044918..ff67ad749e 100644
--- a/demos/declarative/snake/content/Link.qml
+++ b/demos/declarative/snake/content/Link.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import QtQuick.Particles 1.0
+import Qt.labs.particles 1.0
Item { id:link
property bool dying: false
diff --git a/src/declarative/particles/qsgparticleaffector.cpp b/src/declarative/particles/qsgparticleaffector.cpp
index d4b588a44f..96c5cfb25b 100644
--- a/src/declarative/particles/qsgparticleaffector.cpp
+++ b/src/declarative/particles/qsgparticleaffector.cpp
@@ -56,6 +56,8 @@ QSGParticleAffector::QSGParticleAffector(QSGItem *parent) :
void QSGParticleAffector::componentComplete()
{
+ if(!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
+ setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
if(!m_system)
qWarning() << "Affector created without a particle system specified";//TODO: useful QML warnings, like line number?
QSGItem::componentComplete();
diff --git a/src/declarative/particles/qsgparticleemitter.cpp b/src/declarative/particles/qsgparticleemitter.cpp
index c04c86cfe5..20f3c6bb4b 100644
--- a/src/declarative/particles/qsgparticleemitter.cpp
+++ b/src/declarative/particles/qsgparticleemitter.cpp
@@ -76,6 +76,8 @@ QSGParticleEmitter::~QSGParticleEmitter()
void QSGParticleEmitter::componentComplete()
{
+ if(!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
+ setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
if(!m_system)
qWarning() << "Emitter created without a particle system specified";//TODO: useful QML warnings, like line number?
QSGItem::componentComplete();
diff --git a/src/declarative/particles/qsgparticlepainter.cpp b/src/declarative/particles/qsgparticlepainter.cpp
index 8814c61b56..a5e8c0a3e6 100644
--- a/src/declarative/particles/qsgparticlepainter.cpp
+++ b/src/declarative/particles/qsgparticlepainter.cpp
@@ -54,8 +54,10 @@ QSGParticlePainter::QSGParticlePainter(QSGItem *parent) :
void QSGParticlePainter::componentComplete()
{
+ if(!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
+ setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
if(!m_system)
- qWarning() << "Particle created without a particle system specified";//TODO: useful QML warnings, like line number?
+ qWarning() << "ParticlePainter created without a particle system specified";//TODO: useful QML warnings, like line number?
QSGItem::componentComplete();
}
diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp
index a2aa377c82..4a8f75bb04 100644
--- a/src/declarative/particles/qsgparticlesystem.cpp
+++ b/src/declarative/particles/qsgparticlesystem.cpp
@@ -67,7 +67,9 @@ QSGParticleData::QSGParticleData()
}
QSGParticleSystem::QSGParticleSystem(QSGItem *parent) :
- QSGItem(parent), m_particle_count(0), m_running(true) , m_startTime(0), m_overwrite(false)
+ QSGItem(parent), m_particle_count(0), m_running(true)
+ , m_startTime(0), m_overwrite(false)
+ , m_componentComplete(false)
{
m_groupIds = QHash<QString, int>();
}
@@ -111,7 +113,9 @@ void QSGParticleSystem::setRunning(bool arg)
void QSGParticleSystem::componentComplete()
{
QSGItem::componentComplete();
- reset();
+ m_componentComplete = true;
+ if(!m_emitters.isEmpty() && !m_particles.isEmpty())
+ reset();
}
void QSGParticleSystem::initializeSystem()
@@ -191,6 +195,8 @@ void QSGParticleSystem::initializeSystem()
void QSGParticleSystem::reset()
{
+ if(!m_componentComplete)
+ return;//Batch starting reset()s a little
//Clear guarded pointers which have been deleted
int cleared = 0;
cleared += m_emitters.removeAll(0);
diff --git a/src/declarative/particles/qsgparticlesystem_p.h b/src/declarative/particles/qsgparticlesystem_p.h
index aab3c5d50f..9730ff35e8 100644
--- a/src/declarative/particles/qsgparticlesystem_p.h
+++ b/src/declarative/particles/qsgparticlesystem_p.h
@@ -163,6 +163,7 @@ private:
qint64 m_startTime;
int m_nextGroupId;
bool m_overwrite;
+ bool m_componentComplete;
};
//TODO: Clean up all this into ParticleData