qscatterseries.cpp
59 lines
| 972 B
| text/x-c
|
CppLexer
/ src / qscatterseries.cpp
Tero Ahola
|
r42 | #include "qscatterseries.h" | ||
#include "qscatterseries_p.h" | ||||
#include "qchart.h" | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Tero Ahola
|
r158 | QScatterSeriesPrivate::QScatterSeriesPrivate() : | ||
m_data(QList<QPointF>()) | ||||
Tero Ahola
|
r42 | { | ||
} | ||||
Tero Ahola
|
r158 | QScatterSeries::QScatterSeries(QObject *parent) : | ||
QChartSeries(parent), | ||||
d(new QScatterSeriesPrivate()) | ||||
Tero Ahola
|
r42 | { | ||
} | ||||
Tero Ahola
|
r158 | QScatterSeries::~QScatterSeries() | ||
Tero Ahola
|
r42 | { | ||
Tero Ahola
|
r158 | delete d; | ||
Tero Ahola
|
r48 | } | ||
Tero Ahola
|
r180 | void QScatterSeries::addData(QPointF value) | ||
Tero Ahola
|
r61 | { | ||
Tero Ahola
|
r180 | d->m_data.append(value); | ||
emit changed(); | ||||
} | ||||
QScatterSeries& QScatterSeries::operator << (const QPointF &value) | ||||
{ | ||||
d->m_data.append(value); | ||||
Tero Ahola
|
r179 | emit changed(); | ||
Tero Ahola
|
r180 | return *this; | ||
Tero Ahola
|
r179 | } | ||
Tero Ahola
|
r158 | |||
Tero Ahola
|
r180 | void QScatterSeries::setData(QList<QPointF> data) | ||
Tero Ahola
|
r179 | { | ||
Tero Ahola
|
r180 | d->m_data = data; | ||
Tero Ahola
|
r158 | emit changed(); | ||
Tero Ahola
|
r61 | } | ||
Tero Ahola
|
r158 | QList<QPointF> QScatterSeries::data() | ||
Tero Ahola
|
r64 | { | ||
Tero Ahola
|
r158 | return d->m_data; | ||
Tero Ahola
|
r64 | } | ||
Tero Ahola
|
r179 | void QScatterSeries::setMarkerPen(QPen pen) | ||
Tero Ahola
|
r75 | { | ||
Tero Ahola
|
r179 | d->m_markerPen = pen; | ||
Tero Ahola
|
r75 | } | ||
Tero Ahola
|
r179 | QPen QScatterSeries::markerPen() | ||
Tero Ahola
|
r42 | { | ||
Tero Ahola
|
r179 | return d->m_markerPen; | ||
Tero Ahola
|
r42 | } | ||
#include "moc_qscatterseries.cpp" | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||