@@ -250,13 +250,19 void DeclarativeChart::childEvent(QChildEvent *event) | |||
|
250 | 250 | |
|
251 | 251 | void DeclarativeChart::componentComplete() |
|
252 | 252 | { |
|
253 | bool createAxis = true; | |
|
253 | 254 | foreach(QObject *child, children()) { |
|
254 | 255 | if (qobject_cast<QAbstractSeries *>(child)) { |
|
255 | 256 | // qDebug() << "DeclarativeChart::componentComplete(), add: " << child; |
|
256 | 257 | // TODO: how about optional y-axis? |
|
257 | 258 | m_chart->addSeries(qobject_cast<QAbstractSeries *>(child)); |
|
259 | }else if(qobject_cast<QAbstractAxis *>(child)){ | |
|
260 | createAxis = false; | |
|
258 | 261 | } |
|
259 | 262 | } |
|
263 | ||
|
264 | if(createAxis) m_chart->createDefaultAxes(); | |
|
265 | ||
|
260 | 266 | QDeclarativeItem::componentComplete(); |
|
261 | 267 | } |
|
262 | 268 |
General Comments 0
You need to be logged in to leave comments.
Login now