diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-09-23 08:52:54 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-10-19 09:30:53 +0200 |
| commit | c85695369c065d3735dc58d7e50c901c20f4bb35 (patch) | |
| tree | 2055354fef65bbb8bffbc4ad21abf53031e1dc40 /src/particles/qquickparticlesystem.cpp | |
| parent | 742fba7d7a60de1f81c15d442e510946abaaefcf (diff) | |
Make QQuickV4ParticleData a value type
We don't need all the QJSValue wrangling.
Change-Id: I683e3edc55de2cf3457cb86f952cf1eb717ae395
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge (away) <shawn.rutledge@qt.io>
Diffstat (limited to 'src/particles/qquickparticlesystem.cpp')
| -rw-r--r-- | src/particles/qquickparticlesystem.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp index 5d7ef12ed6..003cea4da6 100644 --- a/src/particles/qquickparticlesystem.cpp +++ b/src/particles/qquickparticlesystem.cpp @@ -14,6 +14,7 @@ #include "qquicktrailemitter_p.h"//###For auto-follow on states, perhaps should be in emitter? #include <private/qqmlengine_p.h> #include <private/qqmlglobal_p.h> +#include <private/qqmlvaluetypewrapper_p.h> #include <cmath> #include <QDebug> @@ -392,7 +393,6 @@ QQuickParticleData::QQuickParticleData() , rotationOwner(nullptr) , deformationOwner(nullptr) , animationOwner(nullptr) - , v4Datum(nullptr) { x = 0; y = 0; @@ -427,11 +427,6 @@ QQuickParticleData::QQuickParticleData() delegate = nullptr; } -QQuickParticleData::~QQuickParticleData() -{ - delete v4Datum; -} - QQuickParticleData::QQuickParticleData(const QQuickParticleData &other) { *this = other; @@ -445,7 +440,6 @@ QQuickParticleData &QQuickParticleData::operator=(const QQuickParticleData &othe index = other.index; systemIndex = other.systemIndex; // Lazily initialized - v4Datum = nullptr; return *this; } @@ -486,11 +480,9 @@ void QQuickParticleData::clone(const QQuickParticleData& other) animationOwner = other.animationOwner; } -QV4::ReturnedValue QQuickParticleData::v4Value(QQuickParticleSystem* particleSystem) +QQuickV4ParticleData QQuickParticleData::v4Value(QQuickParticleSystem *particleSystem) { - if (!v4Datum) - v4Datum = new QQuickV4ParticleData(qmlEngine(particleSystem)->handle(), this, particleSystem); - return v4Datum->v4Value(); + return QQuickV4ParticleData(this, particleSystem); } void QQuickParticleData::debugDump(QQuickParticleSystem* particleSystem) const |
