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