1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QBOXPLOTSERIES_H
5#define QBOXPLOTSERIES_H
6
7#include <QtCharts/QChartGlobal>
8#include <QtCharts/QBoxSet>
9#include <QtCharts/QAbstractSeries>
10
11QT_BEGIN_NAMESPACE
12
13class QBoxPlotSeriesPrivate;
14
15class Q_CHARTS_EXPORT QBoxPlotSeries : public QAbstractSeries
16{
17 Q_OBJECT
18 Q_PROPERTY(bool boxOutlineVisible READ boxOutlineVisible WRITE setBoxOutlineVisible NOTIFY boxOutlineVisibilityChanged)
19 Q_PROPERTY(qreal boxWidth READ boxWidth WRITE setBoxWidth NOTIFY boxWidthChanged)
20 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
21 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
22 Q_PROPERTY(int count READ count NOTIFY countChanged REVISION(2, 0))
23public:
24 explicit QBoxPlotSeries(QObject *parent = nullptr);
25 ~QBoxPlotSeries();
26
27 bool append(QBoxSet *box);
28 bool remove(QBoxSet *box);
29 bool take(QBoxSet *box);
30 bool append(const QList<QBoxSet *> &boxes);
31 bool insert(int index, QBoxSet *box);
32 int count() const;
33 QList<QBoxSet *> boxSets() const;
34 void clear();
35
36 QAbstractSeries::SeriesType type() const override;
37
38 void setBoxOutlineVisible(bool visible);
39 bool boxOutlineVisible();
40 void setBoxWidth(qreal width);
41 qreal boxWidth();
42 void setBrush(const QBrush &brush);
43 QBrush brush() const;
44 void setPen(const QPen &pen);
45 QPen pen() const;
46
47Q_SIGNALS:
48 void clicked(QBoxSet *boxset);
49 void hovered(bool status, QBoxSet *boxset);
50 void pressed(QBoxSet *boxset);
51 void released(QBoxSet *boxset);
52 void doubleClicked(QBoxSet *boxset);
53 void countChanged();
54 void penChanged();
55 void brushChanged();
56 void boxOutlineVisibilityChanged();
57 void boxWidthChanged();
58
59 void boxsetsAdded(const QList<QBoxSet *> &sets);
60 void boxsetsRemoved(const QList<QBoxSet *> &sets);
61
62private:
63 Q_DECLARE_PRIVATE(QBoxPlotSeries)
64 Q_DISABLE_COPY(QBoxPlotSeries)
65 friend class BoxPlotChartItem;
66 friend class QBoxPlotLegendMarkerPrivate;
67};
68
69QT_END_NAMESPACE
70
71#endif // QBOXPLOTSERIES_H
72

source code of qtcharts/src/charts/boxplotchart/qboxplotseries.h