@@ -10,7 +10,8 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
10 |
|
10 | |||
11 | //TODO: optimize : remove points which are not visible |
|
11 | //TODO: optimize : remove points which are not visible | |
12 |
|
12 | |||
13 |
AreaChartItem::AreaChartItem(QAreaSeries *areaSeries,ChartPresenter *presenter) |
|
13 | AreaChartItem::AreaChartItem(QAreaSeries *areaSeries, ChartPresenter *presenter) | |
|
14 | : ChartItem(presenter), | |||
14 | m_series(areaSeries), |
|
15 | m_series(areaSeries), | |
15 | m_upper(0), |
|
16 | m_upper(0), | |
16 | m_lower(0), |
|
17 | m_lower(0), | |
@@ -18,9 +19,8 AreaChartItem::AreaChartItem(QAreaSeries *areaSeries,ChartPresenter *presenter) | |||||
18 | { |
|
19 | { | |
19 | setZValue(ChartPresenter::LineChartZValue); |
|
20 | setZValue(ChartPresenter::LineChartZValue); | |
20 | m_upper = new AreaBoundItem(this,m_series->upperSeries()); |
|
21 | m_upper = new AreaBoundItem(this,m_series->upperSeries()); | |
21 |
if (m_series->lowerSeries()) |
|
22 | if (m_series->lowerSeries()) | |
22 | m_lower = new AreaBoundItem(this,m_series->lowerSeries()); |
|
23 | m_lower = new AreaBoundItem(this,m_series->lowerSeries()); | |
23 | } |
|
|||
24 |
|
24 | |||
25 | connect(areaSeries,SIGNAL(updated()),this,SLOT(handleUpdated())); |
|
25 | connect(areaSeries,SIGNAL(updated()),this,SLOT(handleUpdated())); | |
26 | connect(this,SIGNAL(clicked(const QPointF&)),areaSeries,SIGNAL(clicked(const QPointF&))); |
|
26 | connect(this,SIGNAL(clicked(const QPointF&)),areaSeries,SIGNAL(clicked(const QPointF&))); | |
@@ -32,7 +32,7 AreaChartItem::~AreaChartItem() | |||||
32 | { |
|
32 | { | |
33 | delete m_upper; |
|
33 | delete m_upper; | |
34 | delete m_lower; |
|
34 | delete m_lower; | |
35 |
} |
|
35 | } | |
36 |
|
36 | |||
37 | QRectF AreaChartItem::boundingRect() const |
|
37 | QRectF AreaChartItem::boundingRect() const | |
38 | { |
|
38 | { | |
@@ -91,7 +91,6 void AreaChartItem::handleGeometryChanged(const QRectF &rect) | |||||
91 | if (m_lower) |
|
91 | if (m_lower) | |
92 | m_lower->handleGeometryChanged(rect); |
|
92 | m_lower->handleGeometryChanged(rect); | |
93 | } |
|
93 | } | |
94 | //painter |
|
|||
95 |
|
94 | |||
96 | void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
95 | void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | |
97 | { |
|
96 | { |
@@ -65,7 +65,6 public: | |||||
65 |
|
65 | |||
66 | private: |
|
66 | private: | |
67 | AreaChartItem* m_item; |
|
67 | AreaChartItem* m_item; | |
68 |
|
||||
69 | }; |
|
68 | }; | |
70 |
|
69 | |||
71 | QTCOMMERCIALCHART_END_NAMESPACE |
|
70 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -78,12 +78,14 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
78 | upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead. |
|
78 | upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead. | |
79 | When series object is added to QChartView or QChart instance ownerships is transfered. |
|
79 | When series object is added to QChartView or QChart instance ownerships is transfered. | |
80 | */ |
|
80 | */ | |
81 |
QAreaSeries::QAreaSeries(QLineSeries* |
|
81 | QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries) | |
|
82 | : QSeries(upperSeries), | |||
82 | m_upperSeries(upperSeries), |
|
83 | m_upperSeries(upperSeries), | |
83 | m_lowerSeries(lowerSeries), |
|
84 | m_lowerSeries(lowerSeries), | |
84 | m_pointsVisible(false) |
|
85 | m_pointsVisible(false) | |
85 | { |
|
86 | { | |
86 | } |
|
87 | } | |
|
88 | ||||
87 | /*! |
|
89 | /*! | |
88 | Destroys the object. Series added to QChartView or QChart instances are owned by those, |
|
90 | Destroys the object. Series added to QChartView or QChart instances are owned by those, | |
89 | and are deleted when mentioned object are destroyed. |
|
91 | and are deleted when mentioned object are destroyed. |
@@ -36,7 +36,7 public: | |||||
36 |
|
36 | |||
37 | void setPen(const QPen &pen); |
|
37 | void setPen(const QPen &pen); | |
38 | QPen pen() const {return m_pen;} |
|
38 | QPen pen() const {return m_pen;} | |
39 |
void setBrush(const QBrush & |
|
39 | void setBrush(const QBrush &brush); | |
40 | QBrush brush() const {return m_brush;} |
|
40 | QBrush brush() const {return m_brush;} | |
41 |
|
41 | |||
42 | bool setModel(QAbstractItemModel *model); |
|
42 | bool setModel(QAbstractItemModel *model); |
General Comments 0
You need to be logged in to leave comments.
Login now