QSGItem(parent),
m_system(0), m_count(0), m_sentinel(new QSGParticleData(0))
{
- connect(this, SIGNAL(parentChanged(QSGItem*)),
- this, SLOT(calcSystemOffset()));
- connect(this, SIGNAL(xChanged()),
- this, SLOT(calcSystemOffset()));
- connect(this, SIGNAL(yChanged()),
- this, SLOT(calcSystemOffset()));
}
void QSGParticlePainter::componentComplete()
m_system = arg;
if (m_system){
m_system->registerParticlePainter(this);
- connect(m_system, SIGNAL(xChanged()),
- this, SLOT(calcSystemOffset()));
- connect(m_system, SIGNAL(yChanged()),
- this, SLOT(calcSystemOffset()));
reset();
}
emit systemChanged(arg);
void QSGParticlePainter::reset()
{
- calcSystemOffset(true);//In case an ancestor changed in some way
}
void QSGParticlePainter::setCount(int c)//### TODO: some resizeing so that particles can reallocate on size change instead of recreate
typedef QPair<int,int> intPair;
void QSGParticlePainter::performPendingCommits()
{
+ calcSystemOffset();
foreach (intPair p, m_pendingCommits)
commit(p.first, p.second);
m_pendingCommits.clear();
void groupsChanged(QStringList arg);
public slots:
-void setSystem(QSGParticleSystem* arg);
+ void setSystem(QSGParticleSystem* arg);
-void setGroups(QStringList arg)
-{
- if (m_groups != arg) {
- m_groups = arg;
- emit groupsChanged(arg);
+ void setGroups(QStringList arg)
+ {
+ if (m_groups != arg) {
+ m_groups = arg;
+ emit groupsChanged(arg);
+ }
}
-}
-private slots:
void calcSystemOffset(bool resetPending = false);
protected: