From 8fac02c7d947822318d9c0c77b53c02cdca12e15 2012-07-03 13:50:56 From: Michal Klocek Date: 2012-07-03 13:50:56 Subject: [PATCH] Adds defulat axis creation for qml plugin --- diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp index 4962b99..f5f7290 100644 --- a/plugins/declarative/declarativechart.cpp +++ b/plugins/declarative/declarativechart.cpp @@ -250,13 +250,19 @@ void DeclarativeChart::childEvent(QChildEvent *event) void DeclarativeChart::componentComplete() { + bool createAxis = true; foreach(QObject *child, children()) { if (qobject_cast(child)) { // qDebug() << "DeclarativeChart::componentComplete(), add: " << child; // TODO: how about optional y-axis? m_chart->addSeries(qobject_cast(child)); + }else if(qobject_cast(child)){ + createAxis = false; } } + + if(createAxis) m_chart->createDefaultAxes(); + QDeclarativeItem::componentComplete(); }