1// Copyright (C) 2016 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 QtDataVisualization 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 "datavisualizationglobal_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 QObject
27{
28 Q_OBJECT
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
46public Q_SLOTS:
47 void markDirtyNoLabelChange();
48
49protected:
50 QValue3DAxisFormatter *q_ptr;
51
52 bool m_needsRecalculate;
53
54 float m_min;
55 float m_max;
56 float m_rangeNormalizer;
57
58 QList<float> m_gridPositions;
59 QList<float> m_subGridPositions;
60 QList<float> m_labelPositions;
61 QStringList m_labelStrings;
62
63 QValue3DAxis *m_axis;
64
65 QString m_previousLabelFormat;
66 QByteArray m_labelFormatArray;
67 Utils::ParamType m_preparsedParamType;
68
69 bool m_allowNegatives;
70 bool m_allowZero;
71
72 QLocale m_locale;
73 QString m_formatPreStr;
74 QString m_formatPostStr;
75 int m_formatPrecision;
76 char m_formatSpec;
77 bool m_cLocaleInUse;
78
79 friend class QValue3DAxisFormatter;
80};
81
82QT_END_NAMESPACE
83
84#endif
85

source code of qtdatavis3d/src/datavisualization/axis/qvalue3daxisformatter_p.h