diff --git a/src/areachart/areachartitem.cpp b/src/areachart/areachartitem.cpp index dadb980..2915e76 100644 --- a/src/areachart/areachartitem.cpp +++ b/src/areachart/areachartitem.cpp @@ -143,6 +143,7 @@ void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt void AreaChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { emit clicked(m_upper->calculateDomainPoint(event->pos())); + ChartItem::mousePressEvent(event); } #include "moc_areachartitem_p.cpp" diff --git a/src/barchart/bar.cpp b/src/barchart/bar.cpp index b9055d3..b25d4a9 100644 --- a/src/barchart/bar.cpp +++ b/src/barchart/bar.cpp @@ -45,6 +45,7 @@ void Bar::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) emit clicked(m_index, m_barset); + QGraphicsItem::mousePressEvent(event); } void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event) @@ -52,6 +53,7 @@ void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event) m_hovering = true; emit hovered(true, m_barset); + } void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) diff --git a/src/chartpresenter_p.h b/src/chartpresenter_p.h index 4c359f4..896be25 100644 --- a/src/chartpresenter_p.h +++ b/src/chartpresenter_p.h @@ -53,15 +53,17 @@ class ChartPresenter: public QObject public: enum ZValues { BackgroundZValue = -1, - ShadesZValue, + ShadesZValue , GridZValue, SeriesZValue, LineChartZValue = SeriesZValue, + SplineChartZValue = SeriesZValue, BarSeriesZValue = SeriesZValue, ScatterSeriesZValue = SeriesZValue, PieSeriesZValue = SeriesZValue, AxisZValue, - LegendZValue + LegendZValue, + TopMostZValue }; enum State { diff --git a/src/linechart/linechartitem.cpp b/src/linechart/linechartitem.cpp index fe9015d..278fb3d 100644 --- a/src/linechart/linechartitem.cpp +++ b/src/linechart/linechartitem.cpp @@ -107,6 +107,7 @@ void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt void LineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { emit XYChart::clicked(calculateDomainPoint(event->pos())); + QGraphicsItem::mousePressEvent(event); } #include "moc_linechartitem_p.cpp" diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp index 082af7c..9db2a8b 100644 --- a/src/piechart/piesliceitem.cpp +++ b/src/piechart/piesliceitem.cpp @@ -132,6 +132,7 @@ void PieSliceItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* /*event*/) void PieSliceItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { emit clicked(event->buttons()); + QGraphicsItem::mousePressEvent(event); } void PieSliceItem::setLayout(const PieSliceData &sliceData) diff --git a/src/scatterchart/scatterchartitem.cpp b/src/scatterchart/scatterchartitem.cpp index 4fa6ecc..b9f390a 100644 --- a/src/scatterchart/scatterchartitem.cpp +++ b/src/scatterchart/scatterchartitem.cpp @@ -68,14 +68,14 @@ void ScatterChartItem::createPoints(int count) switch (m_shape) { case QScatterSeries::MarkerShapeCircle: { - QGraphicsEllipseItem* i = new QGraphicsEllipseItem(0,0,m_size,m_size); + QGraphicsEllipseItem* i = new QGraphicsEllipseItem(0,0,m_size,m_size,this); const QRectF& rect = i->boundingRect(); i->setPos(-rect.width()/2,-rect.height()/2); item = new Marker(i,this); break; } case QScatterSeries::MarkerShapeRectangle: { - QGraphicsRectItem* i = new QGraphicsRectItem(0,0,m_size,m_size); + QGraphicsRectItem* i = new QGraphicsRectItem(0,0,m_size,m_size,this); i->setPos(-m_size/2,-m_size/2); item = new Marker(i,this); break; @@ -198,6 +198,7 @@ void ScatterChartItem::handleUpdated() void ScatterChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { emit XYChart::clicked(calculateDomainPoint(event->pos())); + QGraphicsItem::mousePressEvent(event); } #include "moc_scatterchartitem_p.cpp" diff --git a/src/scatterchart/scatterchartitem_p.h b/src/scatterchart/scatterchartitem_p.h index c4695f3..cf2a6b2 100644 --- a/src/scatterchart/scatterchartitem_p.h +++ b/src/scatterchart/scatterchartitem_p.h @@ -138,6 +138,7 @@ protected: { Q_UNUSED(event) m_parent->markerSelected(this); + QAbstractGraphicsShapeItem::mousePressEvent(event); } private: diff --git a/src/splinechart/splinechartitem.cpp b/src/splinechart/splinechartitem.cpp index 436ec84..ca48f42 100644 --- a/src/splinechart/splinechartitem.cpp +++ b/src/splinechart/splinechartitem.cpp @@ -34,7 +34,7 @@ SplineChartItem::SplineChartItem(QSplineSeries *series, ChartPresenter *presente m_pointsVisible(false), m_animation(0) { - setZValue(ChartPresenter::LineChartZValue); + setZValue(ChartPresenter::SplineChartZValue); QObject::connect(m_series->d_func(),SIGNAL(updated()),this,SLOT(handleUpdated())); QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); handleUpdated(); @@ -169,6 +169,7 @@ void SplineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *o void SplineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { emit XYChart::clicked(calculateDomainPoint(event->pos())); + QGraphicsItem::mousePressEvent(event); } #include "moc_splinechartitem_p.cpp"