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