1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QBARDATAITEM_H
5#define QBARDATAITEM_H
6
7#include <QtGraphs/qgraphsglobal.h>
8
9QT_BEGIN_NAMESPACE
10
11class QBarDataItemPrivate;
12
13class Q_GRAPHS_EXPORT QBarDataItem
14{
15public:
16 constexpr QBarDataItem() noexcept {};
17 constexpr QBarDataItem(float value) noexcept { m_value = value; };
18 constexpr QBarDataItem(float value, float angle) noexcept{ m_value = value; m_angle = angle; };
19 QBarDataItem(const QBarDataItem &other);
20 ~QBarDataItem();
21
22 QBarDataItem &operator=(const QBarDataItem &other);
23
24 constexpr inline void setValue(float val) noexcept { m_value = val; }
25 constexpr inline float value() const noexcept { return m_value; }
26 constexpr inline void setRotation(float angle) noexcept { m_angle = angle; }
27 constexpr inline float rotation() const noexcept { return m_angle; }
28
29protected:
30 void createExtraData();
31
32 QBarDataItemPrivate *d_ptr = nullptr;
33
34private:
35 float m_value = 0.f;
36 float m_angle = 0.f;
37};
38
39QT_END_NAMESPACE
40
41#endif
42

source code of qtgraphs/src/graphs/data/qbardataitem.h