aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickgravity.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-01-12 13:02:35 +0100
committerRobin Burchell <robin.burchell@crimson.no>2017-01-17 19:45:03 +0000
commitf88ac80a28467648f5e0c5c3d7dc978c4967af4c (patch)
treee4ec4462f069cfd47a99ae91e517eaae5f3a5ac3 /src/particles/qquickgravity.cpp
parent66c2513f2abceb38fd5770bb915b35b1b15bb69a (diff)
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'src/particles/qquickgravity.cpp')
-rw-r--r--src/particles/qquickgravity.cpp12
1 files changed, 5 insertions, 7 deletions
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 <QtQml/qqmlinfo.h>
#include "qquickgravity_p.h"
#include <cmath>
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);
}
/*!