1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the QtGraphs API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13
14#ifndef QVALUE3DAXISFORMATTER_P_H
15#define QVALUE3DAXISFORMATTER_P_H
16
17#include "private/qobject_p.h"
18#include "qvalue3daxisformatter.h"
19#include "utils_p.h"
20#include <QtCore/QLocale>
21
22QT_BEGIN_NAMESPACE
23
24class QValue3DAxis;
25
26class QValue3DAxisFormatterPrivate// : public QObjectPrivate
27{
28 Q_DECLARE_PUBLIC(QValue3DAxisFormatter)
29
30public:
31 QValue3DAxisFormatterPrivate(QValue3DAxisFormatter *q);
32 virtual ~QValue3DAxisFormatterPrivate();
33
34 void recalculate();
35 void doRecalculate();
36 void populateCopy(QValue3DAxisFormatter &copy);
37 void doPopulateCopy(QValue3DAxisFormatterPrivate &copy);
38
39 QString stringForValue(qreal value, const QString &format);
40 float positionAt(float value) const;
41 float valueAt(float position) const;
42
43 void setAxis(QValue3DAxis *axis);
44 void markDirty(bool labelsChange);
45
46protected:
47 QValue3DAxisFormatter *q_ptr;
48
49 bool m_needsRecalculate;
50
51 float m_min;
52 float m_max;
53 float m_rangeNormalizer;
54
55 QList<float> m_gridPositions;
56 QList<float> m_subGridPositions;
57 QList<float> m_labelPositions;
58 QStringList m_labelStrings;
59
60 QValue3DAxis *m_axis;
61
62 QString m_previousLabelFormat;
63 QByteArray m_labelFormatArray;
64 Utils::ParamType m_preparsedParamType;
65
66 bool m_allowNegatives;
67 bool m_allowZero;
68
69 QLocale m_locale;
70 QString m_formatPreStr;
71 QString m_formatPostStr;
72 int m_formatPrecision;
73 char m_formatSpec;
74 bool m_cLocaleInUse;
75};
76
77QT_END_NAMESPACE
78
79#endif
80

source code of qtgraphs/src/graphs/axis/qvalue3daxisformatter_p.h