diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-03-04 13:36:45 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-03-08 12:04:48 +0000 |
commit | 6c923498cd89e3fb1b4d92f27a9d7c840cee5971 (patch) | |
tree | 85f799199807d6785b96a11a218617cea68dfb3c /src/particles/qquickparticlesystem.cpp | |
parent | 562fc162014f78146bd407438512501419ac089b (diff) |
Particles: half the number of calls to emittersChanged.
When a particle emitter is not yet complete, calling emittersChanged
through both groupChanged and systemChanged is unnecessary. Only connect
to those signals once after the component is complete, and then call
emittersChanged.
Also do not call emittersChanged when the particle system component is
not complete yet.
Change-Id: I67543ce80c9235bd5f72d95352ec96e97a1cf66b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/particles/qquickparticlesystem.cpp')
-rw-r--r-- | src/particles/qquickparticlesystem.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp index 5109375f43..17d9e49d63 100644 --- a/src/particles/qquickparticlesystem.cpp +++ b/src/particles/qquickparticlesystem.cpp @@ -618,11 +618,16 @@ void QQuickParticleSystem::registerParticleEmitter(QQuickParticleEmitter* e) if (m_debugMode) qDebug() << "Registering Emitter" << e << "to" << this; m_emitters << QPointer<QQuickParticleEmitter>(e);//###How to get them out? +} + +void QQuickParticleSystem::finishRegisteringParticleEmitter(QQuickParticleEmitter* e) +{ connect(e, SIGNAL(particleCountChanged()), this, SLOT(emittersChanged())); connect(e, SIGNAL(groupChanged(QString)), this, SLOT(emittersChanged())); - emittersChanged(); + if (m_componentComplete) + emittersChanged(); e->reset();//Start, so that starttime factors appropriately } |