##// END OF EJS Templates
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.

File last commit:

r668:ea2480445e4a
r668:ea2480445e4a
Show More
pieslice_p.h
79 lines | 1.9 KiB | text/x-c | CLexer
Tero Ahola
Integrated draft version of pie series
r51 #ifndef PIESLICE_H
#define PIESLICE_H
#include "qchartglobal.h"
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 #include "charttheme_p.h"
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157 #include "qpieseries.h"
Tero Ahola
Integrated draft version of pie series
r51 #include <QGraphicsItem>
#include <QRectF>
#include <QColor>
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157 #include <QPen>
Tero Ahola
Integrated draft version of pie series
r51
Jani Honkonen
Pie now actually withs the given rectangle and does not go over
r413 #define PIESLICE_LABEL_GAP 5
Tero Ahola
Integrated draft version of pie series
r51 QTCOMMERCIALCHART_BEGIN_NAMESPACE
Jani Honkonen
Rename piepresenter -> piechartitem
r568 class PieChartItem;
Jani Honkonen
Refactoring piechart API (and internals)
r174 class PieSliceLabel;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 class QPieSlice;
Tero Ahola
Integrated draft version of pie series
r51
Jani Honkonen
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.
r668 class PieSliceData
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 {
public:
QPointF m_center;
qreal m_radius;
qreal m_startAngle;
qreal m_angleSpan;
Jani Honkonen
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.
r668
Jani Honkonen
Fix add/remove animation for pie and apply colors from theme when adding/removing
r659 QPen m_pen;
QBrush m_brush;
Jani Honkonen
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.
r668
bool m_isExploded;
qreal m_explodeDistanceFactor;
bool m_labelVisible;
QString m_labelText;
QFont m_labelFont;
qreal m_labelArmLengthFactor;
QPen m_labelArmPen;
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 };
Jani Honkonen
Refactoring piechart API (and internals)
r174 class PieSlice : public QGraphicsObject
Tero Ahola
Integrated draft version of pie series
r51 {
Jani Honkonen
Refactoring piechart API (and internals)
r174 Q_OBJECT
Tero Ahola
Integrated draft version of pie series
r51 public:
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 PieSlice(QGraphicsItem* parent = 0);
Tero Ahola
Integrated draft version of pie series
r51 ~PieSlice();
public: // from QGraphicsItem
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
Jani Honkonen
Pie chart refactoring
r142 void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
Jani Honkonen
Pie chart refactoring
r142 void mousePressEvent(QGraphicsSceneMouseEvent *event);
Tero Ahola
Integrated draft version of pie series
r51
Jani Honkonen
Refactoring piechart API (and internals)
r174 Q_SIGNALS:
void clicked();
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 void hoverEnter();
void hoverLeave();
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 public:
Jani Honkonen
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.
r668 void setSliceData(PieSliceData sliceData);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 void updateGeometry();
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 static QPointF sliceCenter(QPointF point, qreal radius, QPieSlice *slice);
static QPainterPath slicePath(QPointF center, qreal radius, qreal startAngle, qreal angleSpan, qreal* centerAngle, QPointF* armStart);
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 static QPainterPath labelArmPath(QPointF start, qreal angle, qreal length, qreal textWidth, QPointF* textStart);
static QRectF labelTextRect(QFont font, QString text);
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289
Jani Honkonen
Pie chart refactoring
r142 private:
Jani Honkonen
Rename PieSliceLayout -> PieSliceData. A "layout" is a bad name for this.
r668 PieSliceData m_data;
Jani Honkonen
Refactoring pie series and animations.
r621 QRectF m_boundingRect;
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 QPainterPath m_slicePath;
QPainterPath m_labelArmPath;
QRectF m_labelTextRect;
Tero Ahola
Integrated draft version of pie series
r51 };
QTCOMMERCIALCHART_END_NAMESPACE
#endif // PIESLICE_H