diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp index db19d80..63611f0 100644 --- a/src/piechart/piesliceitem.cpp +++ b/src/piechart/piesliceitem.cpp @@ -109,7 +109,6 @@ 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/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 4648747..0de443a 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -844,9 +844,11 @@ void QPieSeriesPrivate::sliceClicked() void QPieSeriesPrivate::sliceHovered(bool state) { QPieSlice *slice = qobject_cast(sender()); - Q_ASSERT(m_slices.contains(slice)); - Q_Q(QPieSeries); - emit q->hovered(slice, state); + if (!m_slices.isEmpty()) { + Q_ASSERT(m_slices.contains(slice)); + Q_Q(QPieSeries); + emit q->hovered(slice, state); + } } void QPieSeriesPrivate::initializeDomain()