From f88ac80a28467648f5e0c5c3d7dc978c4967af4c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 12 Jan 2017 13:02:35 +0100 Subject: QQuickGravityAffector: Properly deprecate the acceleration property in docs While we're here, deduplicate the implementation (just forward to the "right" setter), and change qWarning to qmlWarning to get context information on the source of the setter. Change-Id: I32acfee10dd34905bb2c472408e3abc6fa56a386 Reviewed-by: Shawn Rutledge --- src/particles/qquickgravity.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/particles') diff --git a/src/particles/qquickgravity.cpp b/src/particles/qquickgravity.cpp index 835790ce7d..a2a2ad7e0e 100644 --- a/src/particles/qquickgravity.cpp +++ b/src/particles/qquickgravity.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "qquickgravity_p.h" #include QT_BEGIN_NAMESPACE @@ -81,17 +82,14 @@ qreal QQuickGravityAffector::magnitude() const /*! \qmlproperty real QtQuick.Particles::Gravity::acceleration + \deprecated - Name changed to magnitude, will be removed soon. + \warning The name for this property has changed to magnitude, use it instead. */ void QQuickGravityAffector::setAcceleration(qreal arg) { - qWarning() << "Gravity::acceleration has been renamed Gravity::magnitude"; - if (m_magnitude != arg) { - m_magnitude = arg; - m_needRecalc = true; - emit magnitudeChanged(arg); - } + qmlWarning(this) << "The acceleration property is deprecated. Please use magnitude instead."; + setMagnitude(arg); } /*! -- cgit v1.2.3