##// END OF EJS Templates
Fixed area series paint bug caused by mouse event fix on line series
Tero Ahola -
r1792:ea0ec9902253
parent child
Show More
@@ -73,10 +73,10 void AreaChartItem::updatePath()
73 {
73 {
74 QPainterPath path;
74 QPainterPath path;
75
75
76 path = m_upper->shape();
76 path = m_upper->path();
77
77
78 if (m_lower) {
78 if (m_lower) {
79 path.connectPath(m_lower->shape().toReversed());
79 path.connectPath(m_lower->path().toReversed());
80 } else {
80 } else {
81 QPointF first = path.pointAtPercent(0);
81 QPointF first = path.pointAtPercent(0);
82 QPointF last = path.pointAtPercent(1);
82 QPointF last = path.pointAtPercent(1);
@@ -27,7 +27,7
27
27
28 QTCOMMERCIALCHART_BEGIN_NAMESPACE
28 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29
29
30 const qreal mouseEventMinWidth(14);
30 const qreal mouseEventMinWidth(12);
31
31
32 LineChartItem::LineChartItem(QLineSeries* series,ChartPresenter *presenter):
32 LineChartItem::LineChartItem(QLineSeries* series,ChartPresenter *presenter):
33 XYChart(series, presenter),
33 XYChart(series, presenter),
@@ -52,8 +52,11 public:
52 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
52 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
53 QPainterPath shape() const;
53 QPainterPath shape() const;
54
54
55 QPainterPath path() const { return m_path; }
56
55 public Q_SLOTS:
57 public Q_SLOTS:
56 void handleUpdated();
58 void handleUpdated();
59
57 protected:
60 protected:
58 void updateGeometry();
61 void updateGeometry();
59 void mousePressEvent(QGraphicsSceneMouseEvent *event);
62 void mousePressEvent(QGraphicsSceneMouseEvent *event);
@@ -65,7 +68,6 private:
65 QPen m_linePen;
68 QPen m_linePen;
66 QPen m_pointPen;
69 QPen m_pointPen;
67 bool m_pointsVisible;
70 bool m_pointsVisible;
68
69 };
71 };
70
72
71 QTCOMMERCIALCHART_END_NAMESPACE
73 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now