##// END OF EJS Templates
added _p to private class headers
added _p to private class headers

File last commit:

r355:b889b21eeadf
r381:8ab9ba5c10bd
Show More
qpieslice.h
97 lines | 2.1 KiB | text/x-c | CLexer
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 #ifndef QPIESLICE_H
#define QPIESLICE_H
#include <qchartglobal.h>
#include <QObject>
#include <QPen>
#include <QBrush>
#include <QFont>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class QTCOMMERCIALCHART_EXPORT QPieSlice : public QObject
{
Q_OBJECT
Jani Honkonen
Add documentation to pie
r314 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY changed)
Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed)
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
public:
QPieSlice(QObject *parent = 0);
Jani Honkonen
Add documentation to pie
r314 QPieSlice(qreal value, QString label, QObject *parent = 0);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 virtual ~QPieSlice();
// data
qreal value() const;
QString label() const;
bool isLabelVisible() const;
bool isExploded() const;
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 qreal explodeDistance() const;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
// generated data
qreal percentage() const;
Jani Honkonen
QPieSlice: angle() -> startAngle(), angleSpan() -> endAngle()
r355 qreal startAngle() const;
qreal endAngle() const;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
// customization
QPen pen() const;
QBrush brush() const;
QPen labelPen() const;
QFont labelFont() const;
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 qreal labelArmLength() const;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Q_SIGNALS:
void clicked();
void hoverEnter();
void hoverLeave();
void changed();
public Q_SLOTS:
// data
void setLabel(QString label);
void setLabelVisible(bool visible);
void setValue(qreal value);
void setExploded(bool exploded);
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 void setExplodeDistance(qreal distance);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
// customization
void setPen(QPen pen);
void setBrush(QBrush brush);
void setLabelFont(QFont font);
void setLabelPen(QPen pen);
void setLabelArmLength(qreal len);
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 // TODO: label position in general
// setLabelFlags(inside|outside|labelArmOn|labelArmOff|???)
// setLabelOrientation(horizontal|vertical|same as slice center angle|???)
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 private:
// TODO: use private class
friend class QPieSeries;
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 friend class PiePresenter;
Jani Honkonen
QPieSlice: angle() -> startAngle(), angleSpan() -> endAngle()
r355 friend class PieSlice;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
// data
qreal m_value;
QString m_label;
bool m_isLabelVisible;
bool m_isExploded;
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 qreal m_explodeDistance;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
// generated data
qreal m_percentage;
Jani Honkonen
QPieSlice: angle() -> startAngle(), angleSpan() -> endAngle()
r355 qreal m_startAngle;
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 qreal m_angleSpan;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
// customization
QPen m_pen;
QBrush m_brush;
QPen m_labelPen;
QFont m_labelFont;
qreal m_labelArmLength;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // QPIESLICE_H