piechartitem_p.h
79 lines
| 2.3 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** 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 | ||
// ------------- | ||||
// | ||||
// This file is not part of the QtCommercial Chart API. It exists purely as an | ||||
// 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" | ||
|
r142 | |||
class QGraphicsItem; | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r566 | class QPieSlice; | ||
|
r659 | class ChartPresenter; | ||
|
r142 | |||
|
r677 | class PieChartItem : public ChartItem | ||
|
r142 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r1074 | explicit PieChartItem(QPieSeries *series, ChartPresenter *presenter); | ||
|
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 | ||
virtual void handleGeometryChanged(const QRectF &rect); | ||||
|
r1191 | virtual void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | ||
virtual void rangeXChanged(qreal min, qreal max, int tickXCount); | ||||
virtual void rangeYChanged(qreal min, qreal max, int tickYCount); | ||||
|
r1074 | |||
void updateLayout(); | ||||
|
r621 | void handleSlicesAdded(QList<QPieSlice*> slices); | ||
void handleSlicesRemoved(QList<QPieSlice*> slices); | ||||
|
r566 | void handleSliceChanged(); | ||
|
r142 | |||
|
r1074 | private: | ||
PieSliceData updateSliceGeometry(QPieSlice *slice); | ||||
|
r174 | |||
|
r142 | private: | ||
|
r1074 | QHash<QPieSlice*, PieSliceItem*> m_sliceItems; | ||
|
r174 | QPieSeries *m_series; | ||
|
r142 | QRectF m_rect; | ||
|
r454 | QPointF m_pieCenter; | ||
qreal m_pieRadius; | ||||
|
r142 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r568 | #endif // PIECHARTITEM_H | ||