qscatterseries.h
71 lines
| 1.8 KiB
| text/x-c
|
CLexer
|
r42 | #ifndef QSCATTERSERIES_H | ||
#define QSCATTERSERIES_H | ||||
|
r360 | #include "qseries.h" | ||
|
r48 | #include <QRectF> | ||
|
r64 | #include <QColor> | ||
|
r42 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class QScatterSeriesPrivate; | ||||
|
r360 | class QTCOMMERCIALCHART_EXPORT QScatterSeries : public QSeries | ||
|
r42 | { | ||
Q_OBJECT | ||||
|
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, | ||||
MarkerShapeX, | ||||
MarkerShapeRectangle, | ||||
|
r459 | MarkerShapeRoundedRectangle, | ||
|
r195 | MarkerShapeTiltedRectangle, | ||
MarkerShapeTriangle, | ||||
MarkerShapeCircle | ||||
}; | ||||
|
r42 | public: | ||
|
r61 | QScatterSeries(QObject *parent = 0); | ||
|
r42 | ~QScatterSeries(); | ||
public: // from QChartSeries | ||||
|
r360 | QSeriesType type() const { return QSeries::SeriesTypeScatter; } | ||
|
r42 | |||
|
r158 | public: | ||
|
r358 | void add(qreal x, qreal y); | ||
void add(QPointF value); | ||||
void add(QList<QPointF> points); | ||||
|
r300 | void setData(QList<QPointF> points); | ||
|
r180 | QScatterSeries& operator << (const QPointF &value); | ||
|
r300 | QScatterSeries& operator << (QList<QPointF> points); | ||
|
r158 | QList<QPointF> data(); | ||
|
r395 | bool replace(int index, QPointF newPoint); | ||
bool removeAt(int index); | ||||
|
r394 | int removeAll(QPointF point); | ||
void clear(); | ||||
int closestPoint(QPointF coordinate); | ||||
//TODO: insert, replace...? | ||||
|
r179 | |||
|
r459 | QPen pen() const; | ||
void setPen(const QPen &pen); | ||||
QBrush brush() const; | ||||
void setBrush(const QBrush &brush); | ||||
MarkerShape shape() const; | ||||
|
r358 | void setShape(MarkerShape shape); | ||
|
r459 | qreal size() const; | ||
|
r397 | void setSize(qreal size); | ||
|
r179 | |||
|
r158 | Q_SIGNALS: | ||
|
r394 | void clicked(QPointF coordinate); | ||
|
r158 | |||
|
r42 | private: | ||
Q_DECLARE_PRIVATE(QScatterSeries) | ||||
Q_DISABLE_COPY(QScatterSeries) | ||||
|
r459 | friend class ScatterPresenter; | ||
QScatterSeriesPrivate *d; | ||||
|
r42 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QSCATTERSERIES_H | ||||