diff options
author | Fabio Falsini <falsinsoft@gmail.com> | 2019-11-20 20:04:30 +0100 |
---|---|---|
committer | Fabio Falsini <falsinsoft@gmail.com> | 2020-01-06 15:17:45 +0100 |
commit | 9d9c5a786c1c3c5986461fc9d885ca7c5ef06b83 (patch) | |
tree | e4ee4b867945d46a5aba7b9e38533db61231b37e /src/particles/qquickitemparticle_p.h | |
parent | 0c2eaad357e555ccaf4fecf42aef03576bbae133 (diff) |
Add QQuickItemParticle give() method body
The current version of QQuickItemParticle give() method was not
implemented and a simple TODO comment was present instead.
I added a working body and add also a reparent feature when an
added item is released.
Fixes: QTBUG-76827
Change-Id: Ib7d289cad2ff0cd166e766eb7f07e92437e7681b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/particles/qquickitemparticle_p.h')
-rw-r--r-- | src/particles/qquickitemparticle_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/particles/qquickitemparticle_p.h b/src/particles/qquickitemparticle_p.h index 70cfe2a446..ea46c67db7 100644 --- a/src/particles/qquickitemparticle_p.h +++ b/src/particles/qquickitemparticle_p.h @@ -130,13 +130,14 @@ class QQuickItemParticleAttached : public QObject Q_PROPERTY(QQuickItemParticle* particle READ particle CONSTANT); public: QQuickItemParticleAttached(QObject* parent) - : QObject(parent), m_mp(0) + : QObject(parent), m_mp(0), m_parentItem(nullptr) {;} QQuickItemParticle* particle() const { return m_mp; } void detach(){Q_EMIT detached();} void attach(){Q_EMIT attached();} private: QQuickItemParticle* m_mp; + QPointer<QQuickItem> m_parentItem; friend class QQuickItemParticle; Q_SIGNALS: void detached(); |