piechartitem_p.h
86 lines
| 2.3 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
|
r2688 | ** Copyright (C) 2014 Digia Plc | ||
|
r794 | ** All rights reserved. | ||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
|
r2574 | ** This file is part of the Qt Enterprise Charts Add-on. | ||
|
r794 | ** | ||
** $QT_BEGIN_LICENSE$ | ||||
|
r2574 | ** Licensees holding valid Qt Enterprise licenses may use this file in | ||
** accordance with the Qt Enterprise License Agreement provided with the | ||||
|
r794 | ** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r1366 | // W A R N I N G | ||
// ------------- | ||||
// | ||||
|
r2574 | // This file is not part of the Qt Enterprise Chart API. It exists purely as an | ||
|
r1366 | // implementation detail. This header file may change from version to | ||
// version without notice, or even be removed. | ||||
// | ||||
// We mean it. | ||||
|
r568 | #ifndef PIECHARTITEM_H | ||
#define PIECHARTITEM_H | ||||
|
r142 | |||
#include "qpieseries.h" | ||||
|
r566 | #include "chartitem_p.h" | ||
|
r673 | #include "piesliceitem_p.h" | ||
|
r2475 | #include <QPointer> | ||
|
r142 | |||
class QGraphicsItem; | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r566 | class QPieSlice; | ||
|
r659 | class ChartPresenter; | ||
|
r1735 | class PieAnimation; | ||
|
r142 | |||
|
r677 | class PieChartItem : public ChartItem | ||
|
r142 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r2273 | explicit PieChartItem(QPieSeries *series, QGraphicsItem* item = 0); | ||
|
r568 | ~PieChartItem(); | ||
|
r142 | |||
|
r1074 | // from QGraphicsItem | ||
|
r142 | QRectF boundingRect() const { return m_rect; } | ||
|
r1074 | void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {} | ||
|
r142 | |||
public Q_SLOTS: | ||||
|
r1074 | // from Chart | ||
|
r1815 | virtual void handleDomainUpdated(); | ||
|
r1074 | |||
void updateLayout(); | ||||
|
r2104 | void handleSlicesAdded(QList<QPieSlice *> slices); | ||
void handleSlicesRemoved(QList<QPieSlice *> slices); | ||||
|
r566 | void handleSliceChanged(); | ||
|
r1456 | void handleSeriesVisibleChanged(); | ||
|
r2067 | void handleOpacityChanged(); | ||
|
r142 | |||
|
r2104 | void setAnimation(PieAnimation *animation); | ||
ChartAnimation *animation() const; | ||||
|
r1735 | |||
|
r1074 | private: | ||
PieSliceData updateSliceGeometry(QPieSlice *slice); | ||||
|
r174 | |||
|
r142 | private: | ||
|
r2104 | QHash<QPieSlice *, PieSliceItem *> m_sliceItems; | ||
|
r2475 | QPointer<QPieSeries> m_series; | ||
|
r142 | QRectF m_rect; | ||
|
r454 | QPointF m_pieCenter; | ||
qreal m_pieRadius; | ||||
|
r1838 | qreal m_holeSize; | ||
|
r2104 | PieAnimation *m_animation; | ||
|
r1735 | |||
|
r142 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r568 | #endif // PIECHARTITEM_H | ||