@@ -262,7 +262,11 void DeclarativeChart::componentComplete() | |||
|
262 | 262 | { |
|
263 | 263 | foreach(QObject *child, children()) { |
|
264 | 264 | if (qobject_cast<QAbstractSeries *>(child)) { |
|
265 | m_chart->addSeries(qobject_cast<QAbstractSeries *>(child)); | |
|
265 | // Add series to the chart | |
|
266 | QAbstractSeries *series = qobject_cast<QAbstractSeries *>(child); | |
|
267 | m_chart->addSeries(series); | |
|
268 | ||
|
269 | // Set optional user defined axes and connect axis related signals | |
|
266 | 270 | if (qobject_cast<DeclarativeLineSeries *>(child)) { |
|
267 | 271 | DeclarativeLineSeries *s = qobject_cast<DeclarativeLineSeries *>(child); |
|
268 | 272 | connect(s, SIGNAL(axisXChanged(QAbstractAxis *)), this, SLOT(handleAxisXSet(QAbstractAxis *))); |
@@ -324,15 +328,14 void DeclarativeChart::componentComplete() | |||
|
324 | 328 | setAxisX(s->axisX(), s); |
|
325 | 329 | setAxisY(s->axisY(), s); |
|
326 | 330 | } |
|
331 | ||
|
332 | // Create the missing axes for the series that cannot be painted without axes | |
|
333 | createDefaultAxes(series); | |
|
327 | 334 | } else if(qobject_cast<QAbstractAxis *>(child)) { |
|
328 | 335 | // Do nothing, axes are set for the chart in the context of series |
|
329 | 336 | } |
|
330 | 337 | } |
|
331 | 338 | |
|
332 | // Create the missing axes for the series that cannot be painted without axes | |
|
333 | foreach(QAbstractSeries *series, m_chart->series()) | |
|
334 | createDefaultAxes(series); | |
|
335 | ||
|
336 | 339 | QDeclarativeItem::componentComplete(); |
|
337 | 340 | } |
|
338 | 341 |
General Comments 0
You need to be logged in to leave comments.
Login now