##// END OF EJS Templates
exposing countcategories to user from barchartseries
exposing countcategories to user from barchartseries

File last commit:

r294:bf1f84426ed8
r323:a2d7c580728d
Show More
customslice.cpp
22 lines | 556 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);
Jani Honkonen
Hide slice label by default
r294 setLabelVisible(true);
setExploded(true);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 connect(this, SIGNAL(changed()), this, SLOT(updateLabel()));
connect(this, SIGNAL(hoverEnter()), this, SLOT(toggleExploded()));
connect(this, SIGNAL(hoverLeave()), this, SLOT(toggleExploded()));
}
void CustomSlice::updateLabel()
{
Jani Honkonen
Hide slice label by default
r294 setLabel(QString::number(this->percentage()*100) + "%");
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
void CustomSlice::toggleExploded()
{
setExploded(!isExploded());
}