diff --git a/src/piechart/piechartitem.cpp b/src/piechart/piechartitem.cpp index 5f962a4..3e954e2 100644 --- a/src/piechart/piechartitem.cpp +++ b/src/piechart/piechartitem.cpp @@ -41,14 +41,10 @@ PieChartItem::PieChartItem(QPieSeries *series, ChartPresenter* presenter) connect(series, SIGNAL(piePositionChanged()), this, SLOT(handlePieLayoutChanged())); connect(series, SIGNAL(pieSizeChanged()), this, SLOT(handlePieLayoutChanged())); - QTimer::singleShot(0, this, SLOT(initialize())); + QTimer::singleShot(0, this, SLOT(initialize())); // TODO: get rid of this // Note: the following does not affect as long as the item does not have anything to paint setZValue(ChartPresenter::PieSeriesZValue); - - // If enabled slice boundingrect() is called instead of shape(). - // And this causes severe issues with mouse click & hover decection. - //setFlags(QGraphicsItem::ItemClipsChildrenToShape); } PieChartItem::~PieChartItem() diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp index ced18c2..f8e5b6d 100644 --- a/src/piechart/piesliceitem.cpp +++ b/src/piechart/piesliceitem.cpp @@ -75,6 +75,7 @@ void PieSliceItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*op painter->restore(); if (m_data.m_isLabelVisible) { + painter->setClipRect(parentItem()->boundingRect()); painter->setPen(m_data.m_labelPen); painter->drawPath(m_labelArmPath); // the pen color will affect the font color as well