| 1 | // Copyright (C) 2016 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | 
| 3 |  | 
| 4 | //  W A R N I N G | 
| 5 | //  ------------- | 
| 6 | // | 
| 7 | // This file is not part of the Qt Chart API.  It exists purely as an | 
| 8 | // implementation detail.  This header file may change from version to | 
| 9 | // version without notice, or even be removed. | 
| 10 | // | 
| 11 | // We mean it. | 
| 12 |  | 
| 13 | #ifndef QBOXPLOTSERIES_P_H | 
| 14 | #define QBOXPLOTSERIES_P_H | 
| 15 |  | 
| 16 | #include <QtCharts/QBoxPlotSeries> | 
| 17 | #include <private/qabstractbarseries_p.h> | 
| 18 | #include <private/abstractdomain_p.h> | 
| 19 | #include <QtCharts/QBarSet> | 
| 20 | #include <QtCharts/private/qchartglobal_p.h> | 
| 21 |  | 
| 22 | QT_BEGIN_NAMESPACE | 
| 23 |  | 
| 24 | class BoxPlotAnimation; | 
| 25 |  | 
| 26 | class Q_CHARTS_EXPORT QBoxPlotSeriesPrivate : public QAbstractSeriesPrivate | 
| 27 | { | 
| 28 |     Q_OBJECT | 
| 29 |  | 
| 30 | public: | 
| 31 |     QBoxPlotSeriesPrivate(QBoxPlotSeries *q); | 
| 32 |     ~QBoxPlotSeriesPrivate(); | 
| 33 |  | 
| 34 |     void initializeGraphics(QGraphicsItem *parent) override; | 
| 35 |     void initializeDomain() override; | 
| 36 |     void initializeAxes() override; | 
| 37 |     void initializeAnimations(QChart::AnimationOptions options, int duration, QEasingCurve &curve) override; | 
| 38 |     void initializeTheme(int index, ChartTheme *theme, bool forced = false) override; | 
| 39 |  | 
| 40 |     QList<QLegendMarker*> createLegendMarkers(QLegend *legend) override; | 
| 41 |  | 
| 42 |     QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const override; | 
| 43 |     QAbstractAxis *createDefaultAxis(Qt::Orientation orientation) const override; | 
| 44 |  | 
| 45 |     bool append(QBoxSet *set); | 
| 46 |     bool remove(QBoxSet *set); | 
| 47 |     bool append(const QList<QBoxSet *> &sets); | 
| 48 |     bool remove(const QList<QBoxSet *> &sets); | 
| 49 |     bool insert(int index, QBoxSet *set); | 
| 50 |     QBoxSet *boxSetAt(int index); | 
| 51 |  | 
| 52 |     qreal max(); | 
| 53 |     qreal min(); | 
| 54 |  | 
| 55 | private: | 
| 56 |     void populateCategories(QBarCategoryAxis *axis); | 
| 57 |  | 
| 58 | Q_SIGNALS: | 
| 59 |     void updated(); | 
| 60 |     void clicked(int index, QBoxSet *barset); | 
| 61 |     void pressed(int index, QBoxSet *barset); | 
| 62 |     void released(int index, QBoxSet *barset); | 
| 63 |     void doubleClicked(int index, QBoxSet *barset); | 
| 64 |     void updatedBoxes(); | 
| 65 |     void updatedLayout(); | 
| 66 |     void restructuredBoxes(); | 
| 67 |  | 
| 68 | private Q_SLOTS: | 
| 69 |     void handleSeriesChange(QAbstractSeries *series); | 
| 70 |     void handleSeriesRemove(QAbstractSeries *series); | 
| 71 |  | 
| 72 | protected: | 
| 73 |     QList<QBoxSet *> m_boxSets; | 
| 74 |     QPen m_pen; | 
| 75 |     QBrush m_brush; | 
| 76 |     bool m_boxOutlineVisible; | 
| 77 |     int m_index; | 
| 78 |     BoxPlotAnimation *m_animation; | 
| 79 |     qreal m_boxWidth; | 
| 80 |  | 
| 81 | private: | 
| 82 |     Q_DECLARE_PUBLIC(QBoxPlotSeries) | 
| 83 | }; | 
| 84 |  | 
| 85 | QT_END_NAMESPACE | 
| 86 |  | 
| 87 | #endif | 
| 88 |  |