##// END OF EJS Templates
Clear background when there is only pie chart.
Clear background when there is only pie chart.

File last commit:

r203:7350e0387b3f
r293:c84fc5fb7b13
Show More
customslice.cpp
20 lines | 496 B | text/x-c | CppLexer
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 #include "customslice.h"
CustomSlice::CustomSlice(qreal value, QObject* parent)
:QPieSlice(parent)
{
setValue(value);
connect(this, SIGNAL(changed()), this, SLOT(updateLabel()));
connect(this, SIGNAL(hoverEnter()), this, SLOT(toggleExploded()));
connect(this, SIGNAL(hoverLeave()), this, SLOT(toggleExploded()));
}
void CustomSlice::updateLabel()
{
setLabel(QString::number(this->percentage()));
}
void CustomSlice::toggleExploded()
{
setExploded(!isExploded());
}