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 QBARCATEGORYAXIS_P_H
14#define QBARCATEGORYAXIS_P_H
15
16#include <QtCharts/QBarCategoryAxis>
17#include <private/qabstractaxis_p.h>
18#include <QtCharts/private/qchartglobal_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class AbstractDomain;
23
24class Q_CHARTS_PRIVATE_EXPORT QBarCategoryAxisPrivate : public QAbstractAxisPrivate
25{
26 Q_OBJECT
27
28public:
29 QBarCategoryAxisPrivate(QBarCategoryAxis *q);
30 ~QBarCategoryAxisPrivate();
31
32public:
33 void initializeGraphics(QGraphicsItem* parent) override;
34 void initializeDomain(AbstractDomain *domain) override;
35 void updateCategoryDomain();
36
37 //interface for manipulating range form base class
38 void setRange(const QVariant &min, const QVariant &max) override;
39 void setMin(const QVariant &min) override;
40 void setMax(const QVariant &max) override;
41
42 //interface manipulating range form domain
43 qreal min() override { return m_min; }
44 qreal max() override { return m_max; }
45 void setRange(qreal min,qreal max) override;
46
47private:
48 //range handling
49 void setRange(const QString &minCategory, const QString &maxCategory);
50
51private:
52 QStringList m_categories;
53 QString m_minCategory;
54 QString m_maxCategory;
55 qreal m_min;
56 qreal m_max;
57 int m_count;
58
59private:
60 Q_DECLARE_PUBLIC(QBarCategoryAxis);
61};
62
63QT_END_NAMESPACE
64
65#endif // QBARCATEGORYAXIS_P_H
66

source code of qtcharts/src/charts/axis/barcategoryaxis/qbarcategoryaxis_p.h