##// END OF EJS Templates
Refactor the new QXYSeries::pointAt() -> QXYSeries::at()...
Miikka Heikkinen -
r2491:d86f47a4910b
parent child
Show More
@@ -88,7 +88,7 void LineChartItem::updateGeometry()
88 88 qreal minX = domain()->minX();
89 89 qreal maxX = domain()->maxX();
90 90 qreal minY = domain()->minY();
91 QPointF currentSeriesPoint = m_series->pointAt(0);
91 QPointF currentSeriesPoint = m_series->at(0);
92 92 QPointF currentGeometryPoint = points.at(0);
93 93 QPointF previousGeometryPoint = points.at(0);
94 94 int size = m_linePen.width();
@@ -129,7 +129,7 void LineChartItem::updateGeometry()
129 129 // degrees and both of the points are within the margin, one in the top half and one in the
130 130 // bottom half of the chart, the bottom one gets clipped incorrectly.
131 131 // However, this should be rare occurrence in any sensible chart.
132 currentSeriesPoint = m_series->pointAt(qMin(seriesLastIndex, i));
132 currentSeriesPoint = m_series->at(qMin(seriesLastIndex, i));
133 133 currentGeometryPoint = points.at(i);
134 134 pointOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX);
135 135
@@ -149,7 +149,7 void LineChartItem::updateGeometry()
149 149
150 150 bool dummyOk; // We know points are ok, but this is needed
151 151 qreal currentAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(currentSeriesPoint.x(), dummyOk);
152 qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->pointAt(i - 1).x(), dummyOk);
152 qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk);
153 153
154 154 if ((qAbs(currentAngle - previousAngle) > 180.0)) {
155 155 // If the angle between two points is over 180 degrees (half X range),
@@ -140,7 +140,7 void ScatterChartItem::updateGeometry()
140 140 // Note that marker map values can be technically incorrect during the animation,
141 141 // if it was caused by an insert, but this shouldn't be a problem as the points are
142 142 // fake anyway.
143 m_markerMap[item] = m_series->pointAt(qMin(seriesLastIndex, i));
143 m_markerMap[item] = m_series->at(qMin(seriesLastIndex, i));
144 144 item->setPos(point.x() - rect.width() / 2, point.y() - rect.height() / 2);
145 145
146 146 if (!m_visible || offGridStatus.at(i))
@@ -119,7 +119,7 void SplineChartItem::updateGeometry()
119 119 qreal minX = domain()->minX();
120 120 qreal maxX = domain()->maxX();
121 121 qreal minY = domain()->minY();
122 QPointF currentSeriesPoint = m_series->pointAt(0);
122 QPointF currentSeriesPoint = m_series->at(0);
123 123 QPointF currentGeometryPoint = points.at(0);
124 124 QPointF previousGeometryPoint = points.at(0);
125 125 bool pointOffGrid = false;
@@ -157,7 +157,7 void SplineChartItem::updateGeometry()
157 157 // degrees and both of the points are within the margin, one in the top half and one in the
158 158 // bottom half of the chart, the bottom one gets clipped incorrectly.
159 159 // However, this should be rare occurrence in any sensible chart.
160 currentSeriesPoint = m_series->pointAt(qMin(seriesLastIndex, i));
160 currentSeriesPoint = m_series->at(qMin(seriesLastIndex, i));
161 161 currentGeometryPoint = points.at(i);
162 162 pointOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX);
163 163
@@ -165,7 +165,7 void SplineChartItem::updateGeometry()
165 165 if (!pointOffGrid || !previousPointWasOffGrid) {
166 166 bool dummyOk; // We know points are ok, but this is needed
167 167 qreal currentAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(currentSeriesPoint.x(), dummyOk);
168 qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->pointAt(i - 1).x(), dummyOk);
168 qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk);
169 169
170 170 if ((qAbs(currentAngle - previousAngle) > 180.0)) {
171 171 // If the angle between two points is over 180 degrees (half X range),
@@ -368,7 +368,7 QList<QPointF> QXYSeries::points() const
368 368 /*!
369 369 Returns point at \a index in internal points vector.
370 370 */
371 const QPointF &QXYSeries::pointAt(int index) const
371 const QPointF &QXYSeries::at(int index) const
372 372 {
373 373 Q_D(const QXYSeries);
374 374 return d->m_points.at(index);
@@ -56,7 +56,7 public:
56 56
57 57 int count() const;
58 58 QList<QPointF> points() const;
59 const QPointF &pointAt(int index) const;
59 const QPointF &at(int index) const;
60 60
61 61 QXYSeries &operator << (const QPointF &point);
62 62 QXYSeries &operator << (const QList<QPointF> &points);
@@ -79,7 +79,7 QVector<bool> XYChart::offGridStatusVector()
79 79 const int seriesLastIndex = m_series->count() - 1;
80 80
81 81 for (int i = 0; i < m_points.size(); i++) {
82 const QPointF &seriesPoint = m_series->pointAt(qMin(seriesLastIndex, i));
82 const QPointF &seriesPoint = m_series->at(qMin(seriesLastIndex, i));
83 83 if (seriesPoint.x() < minX
84 84 || seriesPoint.x() > maxX
85 85 || seriesPoint.y() < minY
General Comments 0
You need to be logged in to leave comments. Login now