##// END OF EJS Templates
Remove click exploding and hover highlighting from pie series API. User should always implement their own.
Remove click exploding and hover highlighting from pie series API. User should always implement their own.

File last commit:

r413:afa09ce7f031
r436:b334955b5e36
Show More
pieslice_p.h
66 lines | 1.3 KiB | text/x-c | CLexer
#ifndef PIESLICE_H
#define PIESLICE_H
#include "qchartglobal.h"
#include "charttheme_p.h"
#include "qpieseries.h"
#include <QGraphicsItem>
#include <QRectF>
#include <QColor>
#include <QPen>
#define PIESLICE_LABEL_GAP 5
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class PiePresenter;
class PieSliceLabel;
class QPieSlice;
class PieSlice : public QGraphicsObject
{
Q_OBJECT
public:
PieSlice(QGraphicsItem* parent = 0);
~PieSlice();
public: // from QGraphicsItem
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
Q_SIGNALS:
void clicked();
void hoverEnter();
void hoverLeave();
public Q_SLOTS:
void setPieRect(QRectF rect);
void updateGeometry();
void updateData(const QPieSlice *sliceData);
public:
PieSliceLabel* label() { return m_slicelabel; }
private:
PieSliceLabel* m_slicelabel;
QRectF m_pieRect;
QPainterPath m_path;
qreal m_startAngle;
qreal m_angleSpan;
bool m_isExploded;
qreal m_explodeDistance;
QPen m_pen;
QBrush m_brush;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // PIESLICE_H