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