1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QSCATTERDATAPROXY_H |
5 | #define QSCATTERDATAPROXY_H |
6 | |
7 | #include <QtDataVisualization/qabstractdataproxy.h> |
8 | #include <QtDataVisualization/qscatterdataitem.h> |
9 | |
10 | Q_MOC_INCLUDE(<QtDataVisualization/qscatter3dseries.h>) |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | class QScatterDataProxyPrivate; |
15 | class QScatter3DSeries; |
16 | |
17 | typedef QList<QScatterDataItem> QScatterDataArray; |
18 | |
19 | class Q_DATAVISUALIZATION_EXPORT QScatterDataProxy : public QAbstractDataProxy |
20 | { |
21 | Q_OBJECT |
22 | |
23 | Q_PROPERTY(int itemCount READ itemCount NOTIFY itemCountChanged) |
24 | Q_PROPERTY(QScatter3DSeries *series READ series NOTIFY seriesChanged) |
25 | |
26 | public: |
27 | explicit QScatterDataProxy(QObject *parent = nullptr); |
28 | virtual ~QScatterDataProxy(); |
29 | |
30 | QScatter3DSeries *series() const; |
31 | int itemCount() const; |
32 | const QScatterDataArray *array() const; |
33 | const QScatterDataItem *itemAt(int index) const; |
34 | |
35 | void resetArray(QScatterDataArray *newArray); |
36 | |
37 | void setItem(int index, const QScatterDataItem &item); |
38 | void setItems(int index, const QScatterDataArray &items); |
39 | |
40 | int addItem(const QScatterDataItem &item); |
41 | int addItems(const QScatterDataArray &items); |
42 | |
43 | void insertItem(int index, const QScatterDataItem &item); |
44 | void insertItems(int index, const QScatterDataArray &items); |
45 | |
46 | void removeItems(int index, int removeCount); |
47 | |
48 | Q_SIGNALS: |
49 | void arrayReset(); |
50 | void itemsAdded(int startIndex, int count); |
51 | void itemsChanged(int startIndex, int count); |
52 | void itemsRemoved(int startIndex, int count); |
53 | void itemsInserted(int startIndex, int count); |
54 | |
55 | void itemCountChanged(int count); |
56 | void seriesChanged(QScatter3DSeries *series); |
57 | |
58 | protected: |
59 | explicit QScatterDataProxy(QScatterDataProxyPrivate *d, QObject *parent = nullptr); |
60 | QScatterDataProxyPrivate *dptr(); |
61 | const QScatterDataProxyPrivate *dptrc() const; |
62 | |
63 | private: |
64 | Q_DISABLE_COPY(QScatterDataProxy) |
65 | |
66 | friend class Scatter3DController; |
67 | }; |
68 | |
69 | QT_END_NAMESPACE |
70 | |
71 | #endif |
72 | |