##// END OF EJS Templates
bug fix in legend signals
bug fix in legend signals

File last commit:

r568:9b365faaa041
r569:41841e53b04b
Show More
piechartitem_p.h
48 lines | 1.2 KiB | text/x-c | CLexer
Jani Honkonen
Rename piepresenter -> piechartitem
r568 #ifndef PIECHARTITEM_H
#define PIECHARTITEM_H
Jani Honkonen
Pie chart refactoring
r142
#include "qpieseries.h"
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 #include "chartitem_p.h"
#include "pieslice_p.h"
Jani Honkonen
Pie chart refactoring
r142
class QGraphicsItem;
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 class QPieSlice;
Jani Honkonen
Pie chart refactoring
r142
Jani Honkonen
Rename piepresenter -> piechartitem
r568 class PieChartItem : public QObject, public ChartItem
Jani Honkonen
Pie chart refactoring
r142 {
Q_OBJECT
public:
// TODO: use a generic data class instead of x and y
Jani Honkonen
Rename piepresenter -> piechartitem
r568 PieChartItem(QGraphicsItem *parent, QPieSeries *series);
~PieChartItem();
Jani Honkonen
Pie chart refactoring
r142
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157 public: // from QGraphicsItem
Jani Honkonen
Pie chart refactoring
r142 QRectF boundingRect() const { return m_rect; }
Jani Honkonen
Refactoring piechart API (and internals)
r174 void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
Jani Honkonen
Pie chart refactoring
r142
public Q_SLOTS:
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 void handleSeriesChanged();
void handleSliceChanged();
void handleDomainChanged(qreal, qreal, qreal, qreal);
Jani Honkonen
Pie chart refactoring
r142 void handleGeometryChanged(const QRectF& rect);
Jani Honkonen
Refactoring piechart API (and internals)
r174 private:
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 QVector<PieSliceLayout> calculateLayout();
void applyLayout(const QVector<PieSliceLayout> &layout);
void setLayout(const QVector<PieSliceLayout> &layout);
Jani Honkonen
Refactoring piechart API (and internals)
r174
Jani Honkonen
Pie chart refactoring
r142 private:
friend class PieSlice;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 QHash<QPieSlice*, PieSlice*> m_slices;
Jani Honkonen
Refactoring piechart API (and internals)
r174 QPieSeries *m_series;
Jani Honkonen
Pie chart refactoring
r142 QRectF m_rect;
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454 QPointF m_pieCenter;
qreal m_pieRadius;
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 QRectF m_debugRect;
Jani Honkonen
Pie chart refactoring
r142 };
QTCOMMERCIALCHART_END_NAMESPACE
Jani Honkonen
Rename piepresenter -> piechartitem
r568 #endif // PIECHARTITEM_H