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 QBARSET_P_H
14#define QBARSET_P_H
15
16#include <QtCharts/QBarSet>
17#include <QtCharts/private/qchartglobal_p.h>
18#include <QtCore/QMap>
19#include <QtGui/QPen>
20#include <QtGui/QBrush>
21#include <QtGui/QFont>
22#include <QSet>
23
24QT_BEGIN_NAMESPACE
25
26class Q_CHARTS_PRIVATE_EXPORT QBarSetPrivate : public QObject
27{
28 Q_OBJECT
29
30public:
31 QBarSetPrivate(const QString label, QBarSet *parent);
32 ~QBarSetPrivate();
33
34 void append(QPointF value);
35 void append(const QList<QPointF> &values);
36 void append(const QList<qreal> &values);
37
38 void insert(const int index, const qreal value);
39 void insert(const int index, const QPointF value);
40 int remove(const int index, const int count);
41
42 void replace(const int index, const qreal value);
43
44 qreal pos(const int index);
45 qreal value(const int index);
46
47 void setVisualsDirty(bool dirty) { m_visualsDirty = dirty; }
48 bool visualsDirty() const { return m_visualsDirty; }
49 void setLabelsDirty(bool dirty) { m_labelsDirty = dirty; }
50 bool labelsDirty() const { return m_labelsDirty; }
51
52 void setBarSelected(int index, bool selected, bool &callSignal);
53 bool isBarSelected(int index) const;
54
55Q_SIGNALS:
56 void updatedBars();
57 void valueChanged(int index);
58 void valueAdded(int index, int count);
59 void valueRemoved(int index, int count);
60
61public:
62 QBarSet * const q_ptr;
63 QString m_label;
64 QList<QPointF> m_values;
65 QSet<int> m_selectedBars;
66 QPen m_pen;
67 QBrush m_brush;
68 QBrush m_labelBrush;
69 QFont m_labelFont;
70 QColor m_selectedColor;
71 bool m_visualsDirty;
72 bool m_labelsDirty;
73
74 friend class QBarSet;
75};
76
77QT_END_NAMESPACE
78
79#endif // QBARSETPRIVATE_P_H
80

source code of qtcharts/src/charts/barchart/qbarset_p.h