diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-28 13:04:16 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-28 13:04:17 +0100 |
commit | afec9016d0fd51345ea93a1bbadb99b5c3fdf629 (patch) | |
tree | 39aa0d02457c643065fbfb298645b2f3877c92bb /src/particles | |
parent | bb1acc24587ebdecc4051ef4b573ef32cfb8a8c5 (diff) | |
parent | ba68c325688acf3072715757480497524f61c425 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I92b13a9c1727644d63e125c1e6f1fdac72720ad7
Diffstat (limited to 'src/particles')
-rw-r--r-- | src/particles/qquickcustomparticle_p.h | 1 | ||||
-rw-r--r-- | src/particles/qquickparticlesystem.cpp | 13 | ||||
-rw-r--r-- | src/particles/qquickparticlesystem_p.h | 5 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/particles/qquickcustomparticle_p.h b/src/particles/qquickcustomparticle_p.h index 1d48786a41..e2292cb33b 100644 --- a/src/particles/qquickcustomparticle_p.h +++ b/src/particles/qquickcustomparticle_p.h @@ -53,7 +53,6 @@ #include "qquickparticlepainter_p.h" #include <private/qquickopenglshadereffectnode_p.h> #include <private/qquickopenglshadereffect_p.h> -#include <QSignalMapper> QT_BEGIN_NAMESPACE diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp index b60180b2ed..99e278238b 100644 --- a/src/particles/qquickparticlesystem.cpp +++ b/src/particles/qquickparticlesystem.cpp @@ -575,9 +575,6 @@ QQuickParticleSystem::QQuickParticleSystem(QQuickItem *parent) : m_paused(false), m_empty(true) { - connect(&m_painterMapper, SIGNAL(mapped(QObject*)), - this, SLOT(loadPainter(QObject*))); - m_debugMode = qmlParticlesDebug(); } @@ -615,8 +612,8 @@ void QQuickParticleSystem::registerParticlePainter(QQuickParticlePainter* p) qDebug() << "Registering Painter" << p << "to" << this; //TODO: a way to Unregister emitters, painters and affectors m_painters << QPointer<QQuickParticlePainter>(p);//###Set or uniqueness checking? - connect(p, SIGNAL(groupsChanged(QStringList)), - &m_painterMapper, SLOT(map())); + + connect(p, &QQuickParticlePainter::groupsChanged, this, [this, p] { this->loadPainter(p); }, Qt::QueuedConnection); loadPainter(p); } @@ -802,13 +799,11 @@ void QQuickParticleSystem::reset() } -void QQuickParticleSystem::loadPainter(QObject *p) +void QQuickParticleSystem::loadPainter(QQuickParticlePainter *painter) { - if (!m_componentComplete || !p) + if (!m_componentComplete || !painter) return; - QQuickParticlePainter* painter = qobject_cast<QQuickParticlePainter*>(p); - Q_ASSERT(painter);//XXX for (QQuickParticleGroupData* sg : groupData) { sg->painters.removeOne(painter); } diff --git a/src/particles/qquickparticlesystem_p.h b/src/particles/qquickparticlesystem_p.h index de39b436e2..92dca40419 100644 --- a/src/particles/qquickparticlesystem_p.h +++ b/src/particles/qquickparticlesystem_p.h @@ -56,7 +56,6 @@ #include <QVector> #include <QHash> #include <QPointer> -#include <QSignalMapper> #include <private/qquicksprite_p.h> #include <QAbstractAnimation> #include <QtQml/qqml.h> @@ -393,7 +392,7 @@ protected: private Q_SLOTS: void emittersChanged(); - void loadPainter(QObject* p); + void loadPainter(QQuickParticlePainter *p); void createEngine(); //Not invoked by sprite engine, unlike Sprite uses void particleStateChange(int idx); @@ -461,8 +460,6 @@ private: QSet<int> m_reusableIndexes; bool m_componentComplete; - QSignalMapper m_painterMapper; - QSignalMapper m_emitterMapper; bool m_paused; bool m_allDead; bool m_empty; |