areachartitem_p.h
75 lines
| 1.6 KiB
| text/x-c
|
CLexer
|
r421 | #ifndef AREACHARTITEM_H | ||
#define AREACHARTITEM_H | ||||
#include "qchartglobal.h" | ||||
#include "linechartitem_p.h" | ||||
#include <QPen> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class QAreaSeries; | ||||
class AreaChartItem; | ||||
|
r689 | class AreaChartItem : public ChartItem | ||
|
r421 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r677 | AreaChartItem(QAreaSeries* areaSeries, ChartPresenter *presenter); | ||
|
r421 | ~ AreaChartItem(); | ||
//from QGraphicsItem | ||||
QRectF boundingRect() const; | ||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||||
QPainterPath shape() const; | ||||
|
r560 | LineChartItem* upperLineItem() const { return m_upper ;} | ||
LineChartItem* lowerLineItem() const { return m_lower ;} | ||||
|
r421 | void updatePath(); | ||
|
r571 | |||
protected: | ||||
void mousePressEvent( QGraphicsSceneMouseEvent * event ); | ||||
signals: | ||||
void clicked(const QPointF& point); | ||||
|
r421 | public slots: | ||
void handleUpdated(); | ||||
|
r439 | void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | ||
|
r421 | void handleGeometryChanged(const QRectF& size); | ||
private: | ||||
QAreaSeries* m_series; | ||||
LineChartItem* m_upper; | ||||
LineChartItem* m_lower; | ||||
|
r439 | QPainterPath m_path; | ||
|
r421 | QRectF m_rect; | ||
QRectF m_clipRect; | ||||
|
r563 | QPen m_linePen; | ||
QPen m_pointPen; | ||||
|
r421 | QBrush m_brush; | ||
|
r563 | bool m_pointsVisible; | ||
|
r421 | }; | ||
class AreaBoundItem : public LineChartItem | ||||
{ | ||||
public: | ||||
|
r677 | AreaBoundItem(AreaChartItem* item,QLineSeries* lineSeries,ChartPresenter *presenter):LineChartItem(lineSeries,presenter), | ||
|
r421 | m_item(item){}; | ||
~AreaBoundItem(){}; | ||||
|
r557 | void setLayout(QVector<QPointF>& points){ | ||
LineChartItem::setLayout(points); | ||||
|
r421 | m_item->updatePath(); | ||
} | ||||
private: | ||||
AreaChartItem* m_item; | ||||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||