##// END OF EJS Templates
Fix piechart clipping bug
Jani Honkonen -
r905:d59d388cc788
parent child
Show More
@@ -41,14 +41,10 PieChartItem::PieChartItem(QPieSeries *series, ChartPresenter* presenter)
41 connect(series, SIGNAL(piePositionChanged()), this, SLOT(handlePieLayoutChanged()));
41 connect(series, SIGNAL(piePositionChanged()), this, SLOT(handlePieLayoutChanged()));
42 connect(series, SIGNAL(pieSizeChanged()), this, SLOT(handlePieLayoutChanged()));
42 connect(series, SIGNAL(pieSizeChanged()), this, SLOT(handlePieLayoutChanged()));
43
43
44 QTimer::singleShot(0, this, SLOT(initialize()));
44 QTimer::singleShot(0, this, SLOT(initialize())); // TODO: get rid of this
45
45
46 // Note: the following does not affect as long as the item does not have anything to paint
46 // Note: the following does not affect as long as the item does not have anything to paint
47 setZValue(ChartPresenter::PieSeriesZValue);
47 setZValue(ChartPresenter::PieSeriesZValue);
48
49 // If enabled slice boundingrect() is called instead of shape().
50 // And this causes severe issues with mouse click & hover decection.
51 //setFlags(QGraphicsItem::ItemClipsChildrenToShape);
52 }
48 }
53
49
54 PieChartItem::~PieChartItem()
50 PieChartItem::~PieChartItem()
@@ -75,6 +75,7 void PieSliceItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*op
75 painter->restore();
75 painter->restore();
76
76
77 if (m_data.m_isLabelVisible) {
77 if (m_data.m_isLabelVisible) {
78 painter->setClipRect(parentItem()->boundingRect());
78 painter->setPen(m_data.m_labelPen);
79 painter->setPen(m_data.m_labelPen);
79 painter->drawPath(m_labelArmPath);
80 painter->drawPath(m_labelArmPath);
80 // the pen color will affect the font color as well
81 // the pen color will affect the font color as well
General Comments 0
You need to be logged in to leave comments. Login now