qxyseries.h
81 lines
| 2.1 KiB
| text/x-c
|
CLexer
|
r466 | #ifndef QXYSERIES_H_ | ||
#define QXYSERIES_H_ | ||||
|
r697 | #include <qchartglobal.h> | ||
#include <qseries.h> | ||||
|
r466 | #include <QDebug> | ||
#include <QPen> | ||||
#include <QBrush> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class QTCOMMERCIALCHART_EXPORT QXYSeries : public QSeries | ||||
{ | ||||
|
r491 | Q_OBJECT | ||
|
r470 | protected: | ||
|
r491 | QXYSeries(QObject* parent=0); | ||
virtual ~QXYSeries(); | ||||
|
r466 | |||
public: | ||||
|
r491 | void add(qreal x, qreal y); | ||
void add(const QPointF& point); | ||||
|
r481 | void add(const QList<QPointF> points); | ||
|
r491 | void replace(qreal x,qreal y); | ||
void replace(const QPointF& point); | ||||
|
r622 | void remove(qreal x); | ||
|
r541 | void remove(qreal x, qreal y); | ||
|
r491 | void remove(const QPointF& point); | ||
void removeAll(); | ||||
int count() const; | ||||
qreal x(int pos) const; | ||||
qreal y(int pos) const; | ||||
QList<QPointF> data(); | ||||
QXYSeries& operator << (const QPointF &point); | ||||
QXYSeries& operator << (const QList<QPointF> points); | ||||
void setPen(const QPen& pen); | ||||
QPen pen() const {return m_pen;} | ||||
|
r470 | void setBrush(const QBrush& pen); | ||
QBrush brush() const {return m_brush;} | ||||
|
r467 | |||
|
r519 | bool setModel(QAbstractItemModel* model); | ||
QAbstractItemModel* model() {return m_model;} | ||||
|
r545 | virtual void setModelMapping(int modelX, int modelY, Qt::Orientation orientation = Qt::Vertical); | ||
|
r734 | virtual void setModelMappingShift(int first, int count = 0); | ||
|
r519 | |||
private slots: | ||||
void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); | ||||
|
r734 | void modelDataAboutToBeAdded(QModelIndex parent, int start, int end); | ||
|
r545 | void modelDataAdded(QModelIndex parent, int start, int end); | ||
|
r734 | void modelDataAboutToBeRemoved(QModelIndex parent, int start, int end); | ||
|
r545 | void modelDataRemoved(QModelIndex parent, int start, int end); | ||
|
r519 | |||
|
r466 | signals: | ||
|
r571 | void clicked(const QPointF& point); | ||
|
r491 | void updated(); | ||
void pointReplaced(int index); | ||||
void pointRemoved(int index); | ||||
void pointAdded(int index); | ||||
|
r466 | |||
protected: | ||||
|
r491 | QVector<qreal> m_x; | ||
QVector<qreal> m_y; | ||||
|
r519 | |||
|
r491 | QPen m_pen; | ||
QBrush m_brush; | ||||
|
r519 | |||
|
r734 | int m_mapX; | ||
|
r519 | int m_mapY; | ||
|
r734 | int m_mapFirst; | ||
int m_mapCount; | ||||
bool m_mapLimited; | ||||
Qt::Orientation m_mapOrientation; | ||||
int tempItemsRemoved; | ||||
|
r466 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||