qscatterseries.h
68 lines
| 1.8 KiB
| text/x-c
|
CLexer
Tero Ahola
|
r42 | #ifndef QSCATTERSERIES_H | ||
#define QSCATTERSERIES_H | ||||
Michal Klocek
|
r360 | #include "qseries.h" | ||
Tero Ahola
|
r48 | #include <QRectF> | ||
Tero Ahola
|
r64 | #include <QColor> | ||
Tero Ahola
|
r42 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class QScatterSeriesPrivate; | ||||
Michal Klocek
|
r360 | class QTCOMMERCIALCHART_EXPORT QScatterSeries : public QSeries | ||
Tero Ahola
|
r42 | { | ||
Q_OBJECT | ||||
Tero Ahola
|
r195 | |||
public: | ||||
enum MarkerShape { | ||||
// TODO: to be defined by the graphics design | ||||
// TODO: marker shapes: "x", star, rectangle, tilted rect, triangle, circle, dot | ||||
MarkerShapeDefault = 0, | ||||
MarkerShapePoint, | ||||
MarkerShapeX, | ||||
MarkerShapeRectangle, | ||||
MarkerShapeTiltedRectangle, | ||||
MarkerShapeTriangle, | ||||
MarkerShapeCircle | ||||
}; | ||||
Tero Ahola
|
r42 | public: | ||
Tero Ahola
|
r61 | QScatterSeries(QObject *parent = 0); | ||
Tero Ahola
|
r42 | ~QScatterSeries(); | ||
public: // from QChartSeries | ||||
Michal Klocek
|
r360 | QSeriesType type() const { return QSeries::SeriesTypeScatter; } | ||
Tero Ahola
|
r42 | |||
Tero Ahola
|
r158 | public: | ||
Tero Ahola
|
r358 | void add(qreal x, qreal y); | ||
void add(QPointF value); | ||||
void add(QList<QPointF> points); | ||||
Tero Ahola
|
r300 | void setData(QList<QPointF> points); | ||
Tero Ahola
|
r180 | QScatterSeries& operator << (const QPointF &value); | ||
Tero Ahola
|
r300 | QScatterSeries& operator << (QList<QPointF> points); | ||
Tero Ahola
|
r158 | QList<QPointF> data(); | ||
Tero Ahola
|
r358 | //TODO: insert, replace, remove, clear...? | ||
Tero Ahola
|
r179 | |||
Tero Ahola
|
r358 | QPen pen(); | ||
void setPen(QPen pen); | ||||
QBrush brush(); | ||||
void setBrush(QBrush brush); | ||||
MarkerShape shape(); | ||||
void setShape(MarkerShape shape); | ||||
Tero Ahola
|
r195 | // TODO: marker size? | ||
Tero Ahola
|
r179 | |||
Tero Ahola
|
r158 | Q_SIGNALS: | ||
Tero Ahola
|
r300 | void clicked(/* TODO: parameters? */); | ||
// TODO: move to PIMPL for simplicity or does the user ever need changed signals? | ||||
Tero Ahola
|
r179 | // TODO: more finegrained signaling for performance reasons | ||
Tero Ahola
|
r195 | // (check QPieSeries implementation with change sets) | ||
Tero Ahola
|
r158 | void changed(); | ||
Tero Ahola
|
r42 | private: | ||
Q_DECLARE_PRIVATE(QScatterSeries) | ||||
Q_DISABLE_COPY(QScatterSeries) | ||||
QScatterSeriesPrivate *const d; | ||||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QSCATTERSERIES_H | ||||