qlineseries.h
59 lines
| 1.3 KiB
| text/x-c
|
CLexer
|
r360 | #ifndef QLINESERIES_H_ | ||
#define QLINESERIES_H_ | ||||
|
r19 | |||
|
r30 | #include "qchartglobal.h" | ||
|
r360 | #include "qseries.h" | ||
|
r12 | #include <QDebug> | ||
|
r85 | #include <QPen> | ||
#include <QBrush> | ||||
|
r12 | |||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r12 | |||
|
r360 | class QTCOMMERCIALCHART_EXPORT QLineSeries : public QSeries | ||
|
r12 | { | ||
|
r131 | Q_OBJECT | ||
|
r419 | public: | ||
|
r349 | QLineSeries(QObject* parent=0); | ||
virtual ~QLineSeries(); | ||||
|
r21 | |||
|
r419 | public: // from QChartSeries | ||
|
r360 | virtual QSeriesType type() const { return QSeries::SeriesTypeLine;} | ||
|
r348 | void add(qreal x, qreal y); | ||
void add(const QPointF& point); | ||||
void replace(qreal x,qreal y); | ||||
void replace(const QPointF& point); | ||||
void remove(qreal x); | ||||
void remove(const QPointF& point); | ||||
|
r12 | void clear(); | ||
|
r85 | |||
void setPen(const QPen& pen); | ||||
|
r331 | QPen pen() const { return m_pen;} | ||
|
r85 | |||
|
r186 | void setPointsVisible(bool visible); | ||
|
r367 | bool pointsVisible() const {return m_pointsVisible;} | ||
|
r185 | |||
|
r12 | int count() const; | ||
qreal x(int pos) const; | ||||
qreal y(int pos) const; | ||||
|
r372 | |||
QLineSeries& operator << (const QPointF &point); | ||||
|
r349 | friend QDebug operator<< (QDebug d, const QLineSeries series); | ||
|
r12 | |||
|
r419 | signals: | ||
|
r389 | void pointReplaced(int index); | ||
|
r374 | void pointRemoved(int index); | ||
void pointAdded(int index); | ||||
|
r392 | void updated(); | ||
|
r131 | |||
|
r419 | protected: | ||
|
r131 | QVector<qreal> m_x; | ||
QVector<qreal> m_y; | ||||
|
r419 | |||
private: | ||||
|
r85 | QPen m_pen; | ||
|
r185 | bool m_pointsVisible; | ||
|
r12 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r19 | |||
|
r12 | #endif | ||