diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-11-25 16:10:04 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-07 09:37:53 +0100 |
commit | 6d0a453f41d304239285d64b06612c36922be701 (patch) | |
tree | 36a77a421948753d9512484f04efc7744941de88 /src/particles | |
parent | 053547fba7e83e894d8af3a63d022daa6a34ce99 (diff) |
Use the extended QQmlListProperty interface in a few places
Task-number: QTBUG-79263
Change-Id: If518f644b5b9eddbacfb1cb16fbb557127ffcfb2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/particles')
-rw-r--r-- | src/particles/qquickimageparticle.cpp | 4 | ||||
-rw-r--r-- | src/particles/qquickparticlegroup.cpp | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index c6fe2f516d..4d67691771 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -1143,7 +1143,9 @@ QQuickImageParticle::~QQuickImageParticle() QQmlListProperty<QQuickSprite> QQuickImageParticle::sprites() { - return QQmlListProperty<QQuickSprite>(this, &m_sprites, spriteAppend, spriteCount, spriteAt, spriteClear); + return QQmlListProperty<QQuickSprite>(this, &m_sprites, + spriteAppend, spriteCount, spriteAt, + spriteClear, spriteReplace, spriteRemoveLast); } void QQuickImageParticle::sceneGraphInvalidated() diff --git a/src/particles/qquickparticlegroup.cpp b/src/particles/qquickparticlegroup.cpp index 052fda6eff..902c23331d 100644 --- a/src/particles/qquickparticlegroup.cpp +++ b/src/particles/qquickparticlegroup.cpp @@ -106,10 +106,15 @@ void delayedRedirect(QQmlListProperty<QObject> *prop, QObject *value) QQmlListProperty<QObject> QQuickParticleGroup::particleChildren() { QQuickParticleSystem* system = qobject_cast<QQuickParticleSystem*>(parent()); - if (system) - return QQmlListProperty<QObject>(this, nullptr, &QQuickParticleSystem::statePropertyRedirect, nullptr, nullptr, nullptr); - else - return QQmlListProperty<QObject>(this, nullptr, &delayedRedirect, nullptr, nullptr, nullptr); + if (system) { + return QQmlListProperty<QObject>(this, nullptr, + &QQuickParticleSystem::statePropertyRedirect, nullptr, + nullptr, nullptr, nullptr, nullptr); + } else { + return QQmlListProperty<QObject>(this, nullptr, + &delayedRedirect, nullptr, nullptr, + nullptr, nullptr, nullptr); + } } void QQuickParticleGroup::setSystem(QQuickParticleSystem* arg) |