| 1 | // Copyright (C) 2023 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 QtGraphs 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 <QSet> | 
| 17 | #include <QtCore/QMap> | 
| 18 | #include <QtGraphs/qbarset.h> | 
| 19 | #include <QtGui/QBrush> | 
| 20 | #include <QtGui/QFont> | 
| 21 | #include <QtGui/QPen> | 
| 22 | #include <private/qobject_p.h> | 
| 23 |  | 
| 24 | QT_BEGIN_NAMESPACE | 
| 25 |  | 
| 26 | class QBarSetPrivate : public QObjectPrivate | 
| 27 | { | 
| 28 |     Q_DECLARE_PUBLIC(QBarSet) | 
| 29 | public: | 
| 30 |     QBarSetPrivate(const QString &label); | 
| 31 |     ~QBarSetPrivate() override; | 
| 32 |  | 
| 33 |     void append(QPointF value); | 
| 34 |     void append(const QList<QPointF> &values); | 
| 35 |     void append(const QList<qreal> &values); | 
| 36 |  | 
| 37 |     void insert(qsizetype index, qreal value); | 
| 38 |     void insert(qsizetype index, QPointF value); | 
| 39 |     qsizetype remove(qsizetype index, qsizetype count); | 
| 40 |  | 
| 41 |     void replace(qsizetype index, qreal value); | 
| 42 |  | 
| 43 |     qreal pos(qsizetype index) const; | 
| 44 |     qreal value(qsizetype index) const; | 
| 45 |  | 
| 46 |     void setVisualsDirty(bool dirty) { m_visualsDirty = dirty; } | 
| 47 |     bool visualsDirty() const { return m_visualsDirty; } | 
| 48 |     void setLabelsDirty(bool dirty) { m_labelsDirty = dirty; } | 
| 49 |     bool labelsDirty() const { return m_labelsDirty; } | 
| 50 |  | 
| 51 |     void setBarSelected(qsizetype index, bool selected, bool &callSignal); | 
| 52 |     bool isBarSelected(qsizetype index) const; | 
| 53 |  | 
| 54 | public: | 
| 55 |     QString m_label; | 
| 56 |     QList<QPointF> m_values; | 
| 57 |     QSet<qsizetype> m_selectedBars; | 
| 58 |     // By default colors are transparent, meaning that use the ones from theme | 
| 59 |     QColor m_color = QColor(Qt::transparent); | 
| 60 |     QColor m_borderColor = QColor(Qt::transparent); | 
| 61 |     QColor m_labelColor = QColor(Qt::transparent); | 
| 62 |     QColor m_selectedColor = QColor(Qt::transparent); | 
| 63 |     // By default border width is -1, meaning that use the one from theme | 
| 64 |     qreal m_borderWidth = -1; | 
| 65 |     bool m_visualsDirty; | 
| 66 |     bool m_labelsDirty; | 
| 67 |  | 
| 68 |     friend class QBarSeries; | 
| 69 | }; | 
| 70 |  | 
| 71 | QT_END_NAMESPACE | 
| 72 |  | 
| 73 | #endif // QBARSETPRIVATE_P_H | 
| 74 |  |