diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-01-12 12:55:32 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-01-17 19:45:00 +0000 |
commit | 66c2513f2abceb38fd5770bb915b35b1b15bb69a (patch) | |
tree | f0036f84d98009d5cb8e7d3262a7d844b13d619f /src/particles/qquickgravity_p.h | |
parent | 0412de08fd65c5fef9d010a68b40a256f521ef61 (diff) |
QQuickGravityAffector: Move implementations from header to cpp
These are not performance-critical, so it's cleaner to do this.
Change-Id: I6a876636d50e2bfe25f9e6e882d9a98dc032101e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/particles/qquickgravity_p.h')
-rw-r--r-- | src/particles/qquickgravity_p.h | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/src/particles/qquickgravity_p.h b/src/particles/qquickgravity_p.h index d3a7f6665c..333d3d1534 100644 --- a/src/particles/qquickgravity_p.h +++ b/src/particles/qquickgravity_p.h @@ -62,52 +62,20 @@ class QQuickGravityAffector : public QQuickParticleAffector Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged) public: explicit QQuickGravityAffector(QQuickItem *parent = 0); - qreal magnitude() const - { - return m_magnitude; - } + qreal magnitude() const; + qreal angle() const; - qreal angle() const - { - return m_angle; - } protected: bool affectParticle(QQuickParticleData *d, qreal dt) override; Q_SIGNALS: - void magnitudeChanged(qreal arg); - void angleChanged(qreal arg); public Q_SLOTS: -void setAcceleration(qreal arg) -{ - qWarning() << "Gravity::acceleration has been renamed Gravity::magnitude"; - if (m_magnitude != arg) { - m_magnitude = arg; - m_needRecalc = true; - Q_EMIT magnitudeChanged(arg); - } -} - -void setMagnitude(qreal arg) -{ - if (m_magnitude != arg) { - m_magnitude = arg; - m_needRecalc = true; - Q_EMIT magnitudeChanged(arg); - } -} - -void setAngle(qreal arg) -{ - if (m_angle != arg) { - m_angle = arg; - m_needRecalc = true; - Q_EMIT angleChanged(arg); - } -} + void setMagnitude(qreal arg); + void setAcceleration(qreal arg); + void setAngle(qreal arg); private: qreal m_magnitude; |