1 | // Copyright (C) 2018 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 VALUEAXISLABEL_H |
14 | #define VALUEAXISLABEL_H |
15 | |
16 | #include <private/editableaxislabel_p.h> |
17 | |
18 | QT_BEGIN_NAMESPACE |
19 | |
20 | class Q_CHARTS_PRIVATE_EXPORT ValueAxisLabel : public EditableAxisLabel |
21 | { |
22 | Q_OBJECT |
23 | public: |
24 | ValueAxisLabel(QGraphicsItem *parent = nullptr); |
25 | |
26 | void keyPressEvent(QKeyEvent *event) override; |
27 | |
28 | qreal value() const; |
29 | void setValue(const qreal &value); |
30 | |
31 | private: |
32 | qreal m_value = 0.0; |
33 | qreal m_valueBeforeEdit = 0.0; |
34 | |
35 | void setInitialEditValue() override; |
36 | void finishEditing() override; |
37 | void resetBeforeEditValue() override; |
38 | |
39 | Q_SIGNALS: |
40 | void valueChanged(qreal oldValue, qreal newValue); |
41 | }; |
42 | |
43 | QT_END_NAMESPACE |
44 | |
45 | #endif // VALUEAXISLABEL_H |
46 | |