##// END OF EJS Templates
Add animations to pie. Works but has some visual issues when adding slices.
Add animations to pie. Works but has some visual issues when adding slices.

File last commit:

r618:249071e508d1
r618:249071e508d1
Show More
pieslice_p.h
80 lines | 2.0 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
Refactoring the pie for animations (no actual animations yet)
r566 class PieSliceLayout
{
public:
Jani Honkonen
Add animations to pie. Works but has some visual issues when adding slices.
r618 QPieSlice* m_data; // TODO: get rid of this
Jani Honkonen
Refactoring the pie for animations (no actual animations yet)
r566 QPointF m_center;
qreal m_radius;
qreal m_startAngle;
qreal m_angleSpan;
};
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:
void setLayout(PieSliceLayout layout);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 void updateGeometry();
void updateData(const QPieSlice *sliceData);
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
Refactoring the pie for animations (no actual animations yet)
r566 PieSliceLayout m_layout;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 QPainterPath m_slicePath;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 bool m_isExploded;
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454 qreal m_explodeDistanceFactor;
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 bool m_labelVisible;
Jani Honkonen
Renaming pen & brush functions for pie and adding const
r469 QPen m_slicePen;
QBrush m_sliceBrush;
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437
QPainterPath m_labelArmPath;
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454 qreal m_labelArmLengthFactor;
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 QPen m_labelArmPen;
QRectF m_labelTextRect;
QFont m_labelFont;
QString m_labelText;
Tero Ahola
Integrated draft version of pie series
r51 };
QTCOMMERCIALCHART_END_NAMESPACE
#endif // PIESLICE_H