@@ -127,7 +127,7 void ChartDataSet::removeSeries(QAbstractSeries* series) | |||
|
127 | 127 | |
|
128 | 128 | if(x==-1) { |
|
129 | 129 | emit axisRemoved(axisX); |
|
130 |
axisX |
|
|
130 | delete axisX; | |
|
131 | 131 | } |
|
132 | 132 | } |
|
133 | 133 | |
@@ -140,7 +140,7 void ChartDataSet::removeSeries(QAbstractSeries* series) | |||
|
140 | 140 | |
|
141 | 141 | if(y==-1) { |
|
142 | 142 | emit axisRemoved(axisY); |
|
143 |
axisY |
|
|
143 | delete axisY; | |
|
144 | 144 | } |
|
145 | 145 | } |
|
146 | 146 | } |
@@ -188,14 +188,19 void tst_ChartDataSet::setAxisX_data() | |||
|
188 | 188 | QAbstractSeries* percent = new QPercentBarSeries(this); |
|
189 | 189 | QAbstractSeries* stacked = new QStackedBarSeries(this); |
|
190 | 190 | |
|
191 | QValuesAxis* valueaxis0 = new QValuesAxis(this); | |
|
192 | QValuesAxis* valueaxis1 = new QValuesAxis(this); | |
|
193 | QValuesAxis* valueaxis2 = new QValuesAxis(this); | |
|
194 | QCategoriesAxis* categoriesaxis = new QCategoriesAxis(this); | |
|
195 | ||
|
196 | QTest::newRow("line,spline,scatter: axis 0 axis1 axis 2") << ( QList<QAbstractSeries*>() << line << spline << scatter) << ( QList<QAbstractAxis*>() << valueaxis0 << valueaxis1 << valueaxis2) << 3; | |
|
197 | QTest::newRow("area: axis 0") << ( QList<QAbstractSeries*>() << area) << ( QList<QAbstractAxis*>() << valueaxis0) << 1; | |
|
198 | QTest::newRow("area, spline, scatter: axis 0 axis1 axis 1") << ( QList<QAbstractSeries*>() << area << spline << scatter) << ( QList<QAbstractAxis*>() << valueaxis0 << valueaxis1 << valueaxis1) << 2; | |
|
191 | QTest::newRow("line,spline,scatter: axis 0 axis1 axis 2") | |
|
192 | << (QList<QAbstractSeries*>() << line << spline << scatter) | |
|
193 | << (QList<QAbstractAxis*>() << new QValuesAxis(this) << new QValuesAxis(this) << new QValuesAxis(this)) << 3; | |
|
194 | ||
|
195 | QTest::newRow("area: axis 0") << (QList<QAbstractSeries*>() << area) | |
|
196 | << (QList<QAbstractAxis*>() << new QValuesAxis(this)) << 1; | |
|
197 | ||
|
198 | QList<QAbstractAxis*> axes0; | |
|
199 | axes0 << new QValuesAxis(this) << new QValuesAxis(this); | |
|
200 | axes0 << axes0.last(); | |
|
201 | QTest::newRow("line,spline,scatter: axis 0 axis1 axis 1") | |
|
202 | << (QList<QAbstractSeries*>() << line << spline << scatter) | |
|
203 | << axes0 << 2; | |
|
199 | 204 |
|
|
200 | 205 | } |
|
201 | 206 | |
@@ -321,24 +326,12 void tst_ChartDataSet::removeAllSeries_data() | |||
|
321 | 326 | QTest::addColumn<QList<QAbstractAxis*> >("axisList"); |
|
322 | 327 | QTest::addColumn<int>("axisCount"); |
|
323 | 328 | |
|
324 | QAbstractSeries* line = new QLineSeries(this); | |
|
325 | QAbstractSeries* area = new QAreaSeries(static_cast<QLineSeries*>(line)); | |
|
326 | QAbstractSeries* scatter = new QScatterSeries(this); | |
|
327 | QAbstractSeries* spline = new QSplineSeries(this); | |
|
328 | QAbstractSeries* pie = new QPieSeries(this); | |
|
329 | QAbstractSeries* bar = new QBarSeries(this); | |
|
330 | QAbstractSeries* percent = new QPercentBarSeries(this); | |
|
331 | QAbstractSeries* stacked = new QStackedBarSeries(this); | |
|
332 | ||
|
333 | QValuesAxis* valueaxis0 = new QValuesAxis(this); | |
|
334 | QValuesAxis* valueaxis1 = new QValuesAxis(this); | |
|
335 | QValuesAxis* valueaxis2 = new QValuesAxis(this); | |
|
336 | ||
|
337 | 329 | QTest::newRow("line,spline,scatter: axis 0 axis1 axis 2") |
|
338 |
<< (QList<QAbstractSeries*>() << |
|
|
339 | << (QList<QAbstractAxis*>() << valueaxis0 << valueaxis1 << valueaxis2) << 3; | |
|
330 | << (QList<QAbstractSeries*>() << new QLineSeries(this) << new QSplineSeries(this) | |
|
331 | << new QScatterSeries(this)) | |
|
332 | << (QList<QAbstractAxis*>() << new QValuesAxis(this) << new QValuesAxis(this) | |
|
333 | << new QValuesAxis(this)) << 3; | |
|
340 | 334 | //TODO: |
|
341 | ||
|
342 | 335 | } |
|
343 | 336 | |
|
344 | 337 | void tst_ChartDataSet::removeAllSeries() |
General Comments 0
You need to be logged in to leave comments.
Login now