xychartitem_p.h
65 lines
| 1.5 KiB
| text/x-c
|
CLexer
|
r466 | #ifndef XYCHARTITEM_H | ||
#define XYCHARTITEM_H | ||||
#include "qchartglobal.h" | ||||
#include "chartitem_p.h" | ||||
#include <QPen> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartPresenter; | ||||
class QXYSeries; | ||||
|
r677 | class XYChartItem : public ChartItem | ||
|
r466 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r743 | explicit XYChartItem(QXYSeries *series, ChartPresenter *presenter); | ||
~XYChartItem(){}; | ||||
|
r466 | |||
QVector<QPointF> points() const {return m_points;} | ||||
QRectF clipRect() const { return m_clipRect;} | ||||
|
r677 | |||
|
r775 | public Q_SLOTS: | ||
|
r466 | void handlePointAdded(int index); | ||
void handlePointRemoved(int index); | ||||
void handlePointReplaced(int index); | ||||
void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | ||||
|
r743 | void handleGeometryChanged(const QRectF &size); | ||
|
r466 | |||
|
r775 | Q_SIGNALS: | ||
|
r571 | void clicked(const QPointF& point); | ||
|
r466 | protected: | ||
|
r677 | |||
|
r743 | virtual void setLayout(QVector<QPointF> &points); | ||
virtual void updateLayout(QVector<QPointF> &oldPoints,QVector<QPointF> &newPoints,int index = 0); | ||||
|
r677 | |||
|
r743 | QPointF calculateGeometryPoint(const QPointF &point) const; | ||
|
r466 | QPointF calculateGeometryPoint(int index) const; | ||
|
r743 | QPointF calculateDomainPoint(const QPointF &point) const; | ||
|
r466 | QVector<QPointF> calculateGeometryPoints() const; | ||
|
r743 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | ||
|
r466 | |||
private: | ||||
inline bool isEmpty(); | ||||
private: | ||||
qreal m_minX; | ||||
qreal m_maxX; | ||||
qreal m_minY; | ||||
qreal m_maxY; | ||||
QXYSeries* m_series; | ||||
QSizeF m_size; | ||||
QRectF m_clipRect; | ||||
QVector<QPointF> m_points; | ||||
|
r530 | friend class XYAnimation; | ||
|
r571 | friend class AreaChartItem; | ||
|
r476 | |||
|
r466 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||