##// END OF EJS Templates
Bugfix : black line drawn during areachart paint
Michal Klocek -
r690:847ff650439d
parent child
Show More
@@ -17,9 +17,9 m_lower(0),
17 17 m_pointsVisible(false)
18 18 {
19 19 setZValue(ChartPresenter::LineChartZValue);
20 m_upper = new AreaBoundItem(this,m_series->upperSeries(),presenter);
20 m_upper = new AreaBoundItem(this,m_series->upperSeries());
21 21 if(m_series->lowerSeries()){
22 m_lower = new AreaBoundItem(this,m_series->lowerSeries(),presenter);
22 m_lower = new AreaBoundItem(this,m_series->lowerSeries());
23 23 }
24 24
25 25 QObject::connect(areaSeries,SIGNAL(updated()),this,SLOT(handleUpdated()));
@@ -48,7 +48,8 void AreaChartItem::updatePath()
48 48 {
49 49 QPainterPath path;
50 50
51 path.connectPath(m_upper->shape());
51 path = m_upper->shape();
52
52 53 if(m_lower){
53 54 path.connectPath(m_lower->shape().toReversed());
54 55 }
@@ -99,12 +100,8 void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
99 100 Q_UNUSED(option)
100 101
101 102 painter->save();
102 QPen pen;
103 pen.setCosmetic(false);
104 pen.setWidth(4);
105 pen.setColor(qRgb(200,0,250));
106 painter->setPen(pen);
107 //painter->setBrush(m_brush);
103 painter->setPen(m_linePen);
104 painter->setBrush(m_brush);
108 105 painter->setClipRect(m_clipRect);
109 106 painter->drawPath(m_path);
110 107 if(m_pointsVisible){
@@ -55,8 +55,9 private:
55 55 class AreaBoundItem : public LineChartItem
56 56 {
57 57 public:
58 AreaBoundItem(AreaChartItem* item,QLineSeries* lineSeries,ChartPresenter *presenter):LineChartItem(lineSeries,presenter),
59 m_item(item){};
58 AreaBoundItem(AreaChartItem* item,QLineSeries* lineSeries):LineChartItem(lineSeries,0),
59 m_item(item){
60 };
60 61
61 62 ~AreaBoundItem(){};
62 63
@@ -11,7 +11,7 class ChartItem : public QGraphicsItem, public Chart
11 11 {
12 12 enum ChartItemTypes{ AXIS_ITEM = UserType+1, XYLINE_ITEM};
13 13 public:
14 ChartItem(ChartPresenter *presenter):QGraphicsItem(presenter->rootItem()),Chart(presenter){};
14 ChartItem(ChartPresenter *presenter):QGraphicsItem(presenter?presenter->rootItem():0),Chart(presenter){};
15 15 };
16 16
17 17 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now