| 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 <QtCore/QLocale> |
| 18 | #include <QtCore/private/qobject_p.h> |
| 19 | #include "qvalue3daxisformatter.h" |
| 20 | #include "utils_p.h" |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QValue3DAxis; |
| 25 | |
| 26 | class QValue3DAxisFormatterPrivate : public QObjectPrivate |
| 27 | { |
| 28 | Q_DECLARE_PUBLIC(QValue3DAxisFormatter) |
| 29 | |
| 30 | public: |
| 31 | QValue3DAxisFormatterPrivate(); |
| 32 | ~QValue3DAxisFormatterPrivate() override; |
| 33 | |
| 34 | void recalculate(); |
| 35 | void doRecalculate(); |
| 36 | void populateCopy(QValue3DAxisFormatter ©); |
| 37 | void doPopulateCopy(QValue3DAxisFormatterPrivate ©); |
| 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 | |
| 46 | protected: |
| 47 | bool m_needsRecalculate; |
| 48 | |
| 49 | float m_min; |
| 50 | float m_max; |
| 51 | float m_rangeNormalizer; |
| 52 | |
| 53 | QList<float> m_gridPositions; |
| 54 | QList<float> m_subGridPositions; |
| 55 | QList<float> m_labelPositions; |
| 56 | QStringList m_labelStrings; |
| 57 | |
| 58 | QValue3DAxis *m_axis; |
| 59 | |
| 60 | QString m_previousLabelFormat; |
| 61 | QByteArray m_labelFormatArray; |
| 62 | Utils::ParamType m_preparsedParamType; |
| 63 | |
| 64 | bool m_allowNegatives; |
| 65 | bool m_allowZero; |
| 66 | |
| 67 | QLocale m_locale; |
| 68 | QString m_formatPreStr; |
| 69 | QString m_formatPostStr; |
| 70 | int m_formatPrecision; |
| 71 | char m_formatSpec; |
| 72 | bool m_cLocaleInUse; |
| 73 | }; |
| 74 | |
| 75 | QT_END_NAMESPACE |
| 76 | |
| 77 | #endif |
| 78 | |