##// END OF EJS Templates
Minor: extra colons, commented out code
Tero Ahola -
r1782:3a2daa7222eb
parent child
Show More
@@ -39,14 +39,14 SplineAnimation::~SplineAnimation()
39 39
40 40 void SplineAnimation::setup(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, QVector<QPointF> &oldControlPoints, QVector<QPointF> &newControlPoints, int index)
41 41 {
42 if(newPoints.count() * 2 - 2 != newControlPoints.count() || newControlPoints.count() < 2){
43 m_valid=false;
44 m_dirty=false;
45 m_item->setGeometryPoints(newPoints);
46 m_item->setControlGeometryPoints(newControlPoints);
47 m_item->setDirty(false);
48 m_item->updateGeometry();
49 return;
42 if (newPoints.count() * 2 - 2 != newControlPoints.count() || newControlPoints.count() < 2) {
43 m_valid=false;
44 m_dirty=false;
45 m_item->setGeometryPoints(newPoints);
46 m_item->setControlGeometryPoints(newControlPoints);
47 m_item->setDirty(false);
48 m_item->updateGeometry();
49 return;
50 50 }
51 51
52 52 m_type = NewAnimation;
@@ -200,8 +200,6 QVector<qreal> QSplineSeriesPrivate::firstControlPoints(const QVector<qreal>& ve
200 200
201 201 QPointF QSplineSeriesPrivate::controlPoint(int index) const
202 202 {
203 // Q_D(const QSplineSeries);
204 // return d->m_controlPoints[index];
205 203 return m_controlPoints[index];
206 204 }
207 205
@@ -84,12 +84,11 void SplineChartItem::updateChart(QVector<QPointF> &oldPoints, QVector<QPointF>
84 84 controlPoints[2 * i + 1] = calculateGeometryControlPoint(2 * i + 1);
85 85 }
86 86
87 if (m_animation) {
88 m_animation->setup(oldPoints,newPoints,m_controlPoints,controlPoints,index);
89 }
87 if (m_animation)
88 m_animation->setup(oldPoints, newPoints, m_controlPoints, controlPoints, index);
90 89
91 setGeometryPoints(newPoints);
92 setControlGeometryPoints(controlPoints);
90 m_points = newPoints;
91 m_controlPoints = controlPoints;
93 92 setDirty(false);
94 93
95 94 if (m_animation) {
@@ -106,8 +105,8 QPointF SplineChartItem::calculateGeometryControlPoint(int index) const
106 105
107 106 void SplineChartItem::updateGeometry()
108 107 {
109 const QVector<QPointF> &points = geometryPoints();
110 const QVector<QPointF> &controlPoints = controlGeometryPoints();
108 const QVector<QPointF> &points = m_points;
109 const QVector<QPointF> &controlPoints = m_controlPoints;
111 110
112 111 if ((points.size()<2) || (controlPoints.size()<2)) {
113 112 prepareGeometryChange();
@@ -224,7 +224,6 void QXYSeries::replace(const QPointF &oldPoint,const QPointF &newPoint)
224 224 int index = d->m_points.indexOf(oldPoint);
225 225 if(index==-1) return;
226 226 d->m_points[index] = newPoint;
227 // emit d->pointReplaced(index);
228 227 emit pointReplaced(index);
229 228 }
230 229
@@ -41,13 +41,10 m_series(series),
41 41 m_animation(0),
42 42 m_dirty(true)
43 43 {
44 // QObject::connect(series->d_func(),SIGNAL(pointReplaced(int)),this,SLOT(handlePointReplaced(int)));
45 // QObject::connect(series->d_func(),SIGNAL(pointAdded(int)),this,SLOT(handlePointAdded(int)));
46 // QObject::connect(series->d_func(),SIGNAL(pointRemoved(int)),this,SLOT(handlePointRemoved(int)));
47 QObject::connect(series, SIGNAL(pointReplaced(int)), this,SLOT(handlePointReplaced(int)));
48 QObject::connect(series, SIGNAL(pointAdded(int)), this,SLOT(handlePointAdded(int)));
49 QObject::connect(series, SIGNAL(pointRemoved(int)), this,SLOT(handlePointRemoved(int)));
50 QObject::connect(this, SIGNAL(clicked(QPointF)), series,SIGNAL(clicked(QPointF)));
44 QObject::connect(series, SIGNAL(pointReplaced(int)), this, SLOT(handlePointReplaced(int)));
45 QObject::connect(series, SIGNAL(pointAdded(int)), this, SLOT(handlePointAdded(int)));
46 QObject::connect(series, SIGNAL(pointRemoved(int)), this, SLOT(handlePointRemoved(int)));
47 QObject::connect(this, SIGNAL(clicked(QPointF)), series, SIGNAL(clicked(QPointF)));
51 48 }
52 49
53 50 void XYChart::setGeometryPoints(const QVector<QPointF>& points)
@@ -120,12 +117,12 void XYChart::updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoin
120 117
121 118 if (m_animation) {
122 119 m_animation->setup(oldPoints, newPoints, index);
123 setGeometryPoints(newPoints);
120 m_points = newPoints;
124 121 setDirty(false);
125 122 presenter()->startAnimation(m_animation);
126 123 }
127 124 else {
128 setGeometryPoints(newPoints);
125 m_points = newPoints;
129 126 updateGeometry();
130 127 }
131 128 }
@@ -46,7 +46,7 class XYChart : public ChartElement
46 46 Q_OBJECT
47 47 public:
48 48 explicit XYChart(QXYSeries *series, ChartPresenter *presenter);
49 ~XYChart(){};
49 ~XYChart() {}
50 50
51 51 void setGeometryPoints(const QVector<QPointF>& points);
52 52 QVector<QPointF> geometryPoints() const { return m_points; }
@@ -84,7 +84,7 protected:
84 84 private:
85 85 inline bool isEmpty();
86 86
87 private:
87 protected:
88 88 qreal m_minX;
89 89 qreal m_maxX;
90 90 qreal m_minY;
General Comments 0
You need to be logged in to leave comments. Login now