Rename PointAttractor x,y to pointX,pointY
authorAlan Alpert <alan.alpert@nokia.com>
Tue, 30 Aug 2011 02:58:45 +0000 (12:58 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 31 Aug 2011 08:11:56 +0000 (10:11 +0200)
Avoid hiding the Item properties, which still have an effect.

Change-Id: I2449c376fe0f2c769792e4bb7b23899672cce5e1
Reviewed-on: http://codereview.qt.nokia.com/3837
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>

examples/declarative/particles/asteroid/blackhole.qml
examples/declarative/particles/modelparticles/stream.qml
examples/declarative/particles/spaceexplorer/spaceexplorer.qml
src/declarative/particles/qsgpointattractor_p.h

index 441f4c3..57474f9 100644 (file)
@@ -146,7 +146,7 @@ Rectangle{
         colorVariation: 0.2
     }
     PointAttractor{
-        id: gs; x: root.width/2; y: root.height/2; strength: 4000000;
+        id: gs; pointX: root.width/2; pointY: root.height/2; strength: 4000000;
         system: particles
         physics: PointAttractor.Acceleration
         proportionalToDistance: PointAttractor.InverseQuadratic
index 15280f7..0938f17 100644 (file)
@@ -149,8 +149,8 @@ Item{
     PointAttractor{
         id: force
         system: sys
-        x: root.width/2
-        y: root.height/2
+        pointX: root.width/2
+        pointY: root.height/2
         strength: -10000
         active: false
         anchors.centerIn: parent
index 727d711..cb8acb8 100644 (file)
@@ -275,51 +275,51 @@ Rectangle{
         system: foreground
     }
     PointAttractor{
-        id: gs1; x: vorteX; y: vorteY; strength: 800000;
         proportionalToDistance: PointAttractor.InverseQuadratic;
+        id: gs1; pointX: vorteX; pointY: vorteY; strength: 800000;
         system: foreground
     }
     Kill{
-        x: gs1.x - holeSize;
-        y: gs1.y - holeSize;
+        x: gs1.pointX - holeSize;
+        y: gs1.pointY - holeSize;
         width: holeSize * 2
         height: holeSize * 2
         system: foreground
     }
 
     PointAttractor{
-        id: gs2; x: vorteX2; y: vorteY2; strength: 800000;
         proportionalToDistance: PointAttractor.InverseQuadratic;
+        id: gs2; pointX: vorteX2; pointY: vorteY2; strength: 800000;
         system: foreground
     }
     Kill{
-        x: gs2.x - holeSize;
-        y: gs2.y - holeSize;
+        x: gs2.pointX - holeSize;
+        y: gs2.pointY - holeSize;
         width: holeSize * 2
         height: holeSize * 2
         system: foreground
     }
 
     PointAttractor{
-        id: gs3; x: vorteX3; y: vorteY3; strength: 800000;
         proportionalToDistance: PointAttractor.InverseQuadratic;
+        id: gs3; pointX: vorteX3; pointY: vorteY3; strength: 800000;
         system: foreground
     }
     Kill{
-        x: gs3.x - holeSize;
-        y: gs3.y - holeSize;
+        x: gs3.pointX - holeSize;
+        y: gs3.pointY - holeSize;
         width: holeSize * 2
         height: holeSize * 2
         system: foreground
     }
     PointAttractor{
-        id: gs4; x: vorteX4; y: vorteY4; strength: 800000;
-        proportionalToDistance: PointAttractor.Quadratic;
+        id: gs4; pointX: vorteX4; pointY: vorteY4; strength: 800000;
+        proportionalToDistance: PointAttractor.InverseQuadratic;
         system: foreground
     }
     Kill{
-        x: gs4.x - holeSize;
-        y: gs4.y - holeSize;
+        x: gs4.pointX - holeSize;
+        y: gs4.pointY - holeSize;
         width: holeSize * 2
         height: holeSize * 2
         system: foreground
index 298965a..e2cdd0f 100644 (file)
@@ -52,11 +52,9 @@ QT_MODULE(Declarative)
 class QSGPointAttractorAffector : public QSGParticleAffector
 {
     Q_OBJECT
-    //Like Gravitational singularity, but linear to distance instead of quadratic
-    //And affects ds/dt, not da/dt
     Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged)
-    Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)//TODO: Change to pointX, pointY
-    Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
+    Q_PROPERTY(qreal pointX READ pointX WRITE setPointX NOTIFY pointXChanged)
+    Q_PROPERTY(qreal pointY READ pointY WRITE setPointY NOTIFY pointYChanged)
     Q_PROPERTY(PhysicsAffects physics READ physics WRITE setPhysics NOTIFY physicsChanged)
     Q_PROPERTY(Proportion proportionalToDistance READ proportionalToDistance WRITE setProportionalToDistance NOTIFY proportionalToDistanceChanged)
     Q_ENUMS(PhysicsAffects)
@@ -84,12 +82,12 @@ public:
         return m_strength;
     }
 
-    qreal x() const
+    qreal pointX() const
     {
         return m_x;
     }
 
-    qreal y() const
+    qreal pointY() const
     {
         return m_y;
     }
@@ -108,9 +106,9 @@ signals:
 
     void strengthChanged(qreal arg);
 
-    void xChanged(qreal arg);
+    void pointXChanged(qreal arg);
 
-    void yChanged(qreal arg);
+    void pointYChanged(qreal arg);
 
     void physicsChanged(PhysicsAffects arg);
 
@@ -125,19 +123,19 @@ void setStrength(qreal arg)
     }
 }
 
-void setX(qreal arg)
+void setPointX(qreal arg)
 {
     if (m_x != arg) {
         m_x = arg;
-        emit xChanged(arg);
+        emit pointXChanged(arg);
     }
 }
 
-void setY(qreal arg)
+void setPointY(qreal arg)
 {
     if (m_y != arg) {
         m_y = arg;
-        emit yChanged(arg);
+        emit pointYChanged(arg);
     }
 }
 void setPhysics(PhysicsAffects arg)