declarativelineseries.cpp
37 lines
| 1006 B
| text/x-c
|
CppLexer
/ qmlplugin / declarativelineseries.cpp
Tero Ahola
|
r215 | #include "declarativelineseries.h" | ||
#include "declarativechart.h" | ||||
#include "qchart.h" | ||||
Michal Klocek
|
r349 | #include "qlineseries.h" | ||
Tero Ahola
|
r215 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Tero Ahola
|
r789 | DeclarativeLineSeries::DeclarativeLineSeries(QObject *parent) : | ||
QLineSeries(parent) | ||||
Tero Ahola
|
r215 | { | ||
} | ||||
Tero Ahola
|
r793 | void DeclarativeLineSeries::componentComplete() | ||
Tero Ahola
|
r789 | { | ||
DeclarativeChart *declarativeChart = qobject_cast<DeclarativeChart *>(parent()); | ||||
if (declarativeChart) { | ||||
QChart *chart = qobject_cast<QChart *>(declarativeChart->m_chart); | ||||
Q_ASSERT(chart); | ||||
chart->addSeries(this); | ||||
} | ||||
} | ||||
QDeclarativeListProperty<DeclarativeXyPoint> DeclarativeLineSeries::points() | ||||
{ | ||||
Tero Ahola
|
r793 | return QDeclarativeListProperty<DeclarativeXyPoint>(this, 0, &DeclarativeXySeries::appendPoints); | ||
Tero Ahola
|
r789 | } | ||
void DeclarativeLineSeries::appendPoints(QDeclarativeListProperty<DeclarativeXyPoint> *list, | ||||
DeclarativeXyPoint *element) | ||||
{ | ||||
DeclarativeXySeries::appendPoints(list, element); | ||||
} | ||||
Tero Ahola
|
r215 | #include "moc_declarativelineseries.cpp" | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||