1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QBAR3DSERIES_H
5#define QBAR3DSERIES_H
6
7#include <QtGraphs/qabstract3dseries.h>
8#include <QtGraphs/qbardataproxy.h>
9#include <QtCore/QPoint>
10
11QT_BEGIN_NAMESPACE
12
13class QBar3DSeriesPrivate;
14
15class Q_GRAPHS_EXPORT QBar3DSeries : public QAbstract3DSeries
16{
17 Q_OBJECT
18 Q_DECLARE_PRIVATE(QBar3DSeries)
19 Q_PROPERTY(QBarDataProxy *dataProxy READ dataProxy WRITE setDataProxy NOTIFY dataProxyChanged)
20 Q_PROPERTY(QPoint selectedBar READ selectedBar WRITE setSelectedBar NOTIFY selectedBarChanged)
21 Q_PROPERTY(float meshAngle READ meshAngle WRITE setMeshAngle NOTIFY meshAngleChanged)
22 Q_PROPERTY(QList<QColor> rowColors READ rowColors WRITE setRowColors NOTIFY rowColorsChanged)
23
24public:
25 explicit QBar3DSeries(QObject *parent = nullptr);
26 explicit QBar3DSeries(QBarDataProxy *dataProxy, QObject *parent = nullptr);
27 virtual ~QBar3DSeries();
28
29 void setDataProxy(QBarDataProxy *proxy);
30 QBarDataProxy *dataProxy() const;
31
32 void setSelectedBar(const QPoint &position);
33 QPoint selectedBar() const;
34 static QPoint invalidSelectionPosition();
35
36 void setMeshAngle(float angle);
37 float meshAngle() const;
38
39 QList<QColor> rowColors() const;
40 void setRowColors(const QList<QColor> &colors);
41
42Q_SIGNALS:
43 void dataProxyChanged(QBarDataProxy *proxy);
44 void selectedBarChanged(const QPoint &position);
45 void meshAngleChanged(float angle);
46 void rowColorsChanged(const QList<QColor> &rowcolors);
47
48private:
49 Q_DISABLE_COPY(QBar3DSeries)
50
51 void connectSignals();
52 void handleMeshRotationChanged(const QQuaternion &rotation);
53
54 friend class Bars3DController;
55 friend class QQuickGraphsBars;
56};
57
58QT_END_NAMESPACE
59
60#endif
61

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