##// END OF EJS Templates
Add QChart::series() doc and tests
Jani Honkonen -
r1316:91d7d3ce5f50
parent child
Show More
@@ -92,6 +92,8 QChart::~QChart()
92 92 Adds the \a series and optional \a axisY onto the chart and takes the ownership of the objects.
93 93 If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and
94 94 the y axis).
95
96 \sa removeSeries(), removeAllSeries()
95 97 */
96 98 void QChart::addSeries(QAbstractSeries *series, QAxis *axisY)
97 99 {
@@ -439,6 +441,11 bool QChart::isBackgroundDropShadowEnabled() const
439 441 return d_ptr->m_presenter->m_backgroundItem->isDropShadowEnabled();
440 442 }
441 443
444 /*!
445 Returns all the series that are added to the chart.
446
447 \sa addSeries(), removeSeries(), removeAllSeries()
448 */
442 449 QList<QAbstractSeries*> QChart::series() const
443 450 {
444 451 return d_ptr->m_dataset->series();
@@ -204,11 +204,15 void tst_QChart::addSeries()
204 204 QTest::qWaitForWindowShown(m_view);
205 205 if(!axis) axis = m_chart->axisY();
206 206 QVERIFY(!series->chart());
207 QCOMPARE(m_chart->series().count(), 0);
207 208 m_chart->addSeries(series,axis);
209 QCOMPARE(m_chart->series().count(), 1);
210 QCOMPARE(m_chart->series().first(), series);
208 211 QVERIFY(series->chart() == m_chart);
209 212 QCOMPARE(m_chart->axisY(series),axis);
210 213 m_chart->removeSeries(series);
211 214 QVERIFY(!series->chart());
215 QCOMPARE(m_chart->series().count(), 0);
212 216 }
213 217
214 218 void tst_QChart::animationOptions_data()
General Comments 0
You need to be logged in to leave comments. Login now