piechartitem_p.h
90 lines
| 2.4 KiB
| text/x-c
|
CLexer
|
r2845 | /****************************************************************************** | ||
|
r794 | ** | ||
|
r2845 | ** Copyright (C) 2015 The Qt Company Ltd. | ||
** Contact: http://www.qt.io/licensing/ | ||||
|
r794 | ** | ||
|
r2740 | ** This file is part of the Qt Charts module. | ||
|
r794 | ** | ||
|
r2845 | ** $QT_BEGIN_LICENSE:COMM$ | ||
|
r794 | ** | ||
|
r2845 | ** Commercial License Usage | ||
** Licensees holding valid commercial Qt licenses may use this file in | ||||
** accordance with the commercial license agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and The Qt Company. For licensing terms | ||||
** and conditions see http://www.qt.io/terms-conditions. For further | ||||
** information use the contact form at http://www.qt.io/contact-us. | ||||
|
r794 | ** | ||
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
******************************************************************************/ | ||||
|
r794 | |||
|
r1366 | // W A R N I N G | ||
// ------------- | ||||
// | ||||
|
r2807 | // This file is not part of the Qt 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 | |||
|
r2714 | #include <QtCharts/QPieSeries> | ||
#include <private/chartitem_p.h> | ||||
#include <private/piesliceitem_p.h> | ||||
#include <QtCore/QPointer> | ||||
|
r142 | |||
|
r2774 | QT_BEGIN_NAMESPACE | ||
|
r142 | class QGraphicsItem; | ||
|
r2774 | QT_END_NAMESPACE | ||
|
r2712 | QT_CHARTS_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 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r142 | |||
|
r568 | #endif // PIECHARTITEM_H | ||