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