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 DECLARATIVESCATTER_P_H
15#define DECLARATIVESCATTER_P_H
16
17#include "abstractdeclarative_p.h"
18#include "qscatter3dseries.h"
19
20#include <private/datavisualizationglobal_p.h>
21#include <private/scatter3dcontroller_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class DeclarativeScatter : public AbstractDeclarative
26{
27 Q_OBJECT
28 Q_PROPERTY(QValue3DAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
29 Q_PROPERTY(QValue3DAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
30 Q_PROPERTY(QValue3DAxis *axisZ READ axisZ WRITE setAxisZ NOTIFY axisZChanged)
31 Q_PROPERTY(QScatter3DSeries *selectedSeries READ selectedSeries NOTIFY selectedSeriesChanged)
32 Q_PROPERTY(QQmlListProperty<QScatter3DSeries> seriesList READ seriesList)
33 Q_CLASSINFO("DefaultProperty", "seriesList")
34
35 QML_NAMED_ELEMENT(Scatter3D)
36 QML_ADDED_IN_VERSION(1, 0)
37
38public:
39 explicit DeclarativeScatter(QQuickItem *parent = 0);
40 ~DeclarativeScatter();
41
42 QValue3DAxis *axisX() const;
43 void setAxisX(QValue3DAxis *axis);
44 QValue3DAxis *axisY() const;
45 void setAxisY(QValue3DAxis *axis);
46 QValue3DAxis *axisZ() const;
47 void setAxisZ(QValue3DAxis *axis);
48
49 QQmlListProperty<QScatter3DSeries> seriesList();
50 static void appendSeriesFunc(QQmlListProperty<QScatter3DSeries> *list, QScatter3DSeries *series);
51 static qsizetype countSeriesFunc(QQmlListProperty<QScatter3DSeries> *list);
52 static QScatter3DSeries *atSeriesFunc(QQmlListProperty<QScatter3DSeries> *list, qsizetype index);
53 static void clearSeriesFunc(QQmlListProperty<QScatter3DSeries> *list);
54 Q_INVOKABLE void addSeries(QScatter3DSeries *series);
55 Q_INVOKABLE void removeSeries(QScatter3DSeries *series);
56
57 QScatter3DSeries *selectedSeries() const;
58
59public Q_SLOTS:
60 void handleAxisXChanged(QAbstract3DAxis *axis) override;
61 void handleAxisYChanged(QAbstract3DAxis *axis) override;
62 void handleAxisZChanged(QAbstract3DAxis *axis) override;
63
64Q_SIGNALS:
65 void axisXChanged(QValue3DAxis *axis);
66 void axisYChanged(QValue3DAxis *axis);
67 void axisZChanged(QValue3DAxis *axis);
68 void selectedSeriesChanged(QScatter3DSeries *series);
69
70protected:
71 Scatter3DController *m_scatterController;
72};
73
74QT_END_NAMESPACE
75
76#endif
77

source code of qtdatavis3d/src/datavisualizationqml/declarativescatter_p.h