1 | // Copyright (C) 2023 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #include "qabstractdataproxy_p.h" |
5 | #include "qabstract3dseries_p.h" |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | /*! |
10 | * \class QAbstractDataProxy |
11 | * \inmodule QtGraphs |
12 | * \brief The QAbstractDataProxy class is a base class for all graphs proxies. |
13 | * |
14 | * The following graphs type specific inherited classes are used instead |
15 | * of the base class: QBarDataProxy, QScatterDataProxy, and QSurfaceDataProxy. |
16 | * |
17 | * For more information, see \l{Qt Graphs Data Handling}. |
18 | */ |
19 | |
20 | /*! |
21 | * \qmltype AbstractDataProxy |
22 | * \inqmlmodule QtGraphs |
23 | * \ingroup graphs_qml |
24 | * \instantiates QAbstractDataProxy |
25 | * \brief Base type for all QtGraphs data proxies. |
26 | * |
27 | * This type is uncreatable, but contains properties that are exposed via the |
28 | * following subtypes: BarDataProxy, ScatterDataProxy, SurfaceDataProxy. |
29 | * |
30 | * For more information, see \l {Qt Graphs Data Handling}. |
31 | */ |
32 | |
33 | /*! |
34 | * \qmlproperty AbstractDataProxy.DataType AbstractDataProxy::type |
35 | * The type of the proxy. One of the QAbstractDataProxy::DataType values. |
36 | */ |
37 | |
38 | /*! |
39 | * \enum QAbstractDataProxy::DataType |
40 | * |
41 | * This enum type specifies the data type of the proxy. |
42 | * |
43 | * \value DataTypeNone |
44 | * No data type. |
45 | * \value DataTypeBar |
46 | * Data type for Q3DBars. |
47 | * \value DataTypeScatter |
48 | * Data type for Q3DScatter. |
49 | * \value DataTypeSurface |
50 | * Data type for Q3DSurface. |
51 | */ |
52 | |
53 | /*! |
54 | * \internal |
55 | */ |
56 | QAbstractDataProxy::QAbstractDataProxy(QAbstractDataProxyPrivate *d, QObject *parent) : |
57 | QObject(parent), |
58 | d_ptr(d) |
59 | { |
60 | } |
61 | |
62 | /*! |
63 | * Deletes the abstract data proxy. |
64 | */ |
65 | QAbstractDataProxy::~QAbstractDataProxy() |
66 | { |
67 | } |
68 | |
69 | /*! |
70 | * \property QAbstractDataProxy::type |
71 | * |
72 | * \brief The data type of the proxy. |
73 | */ |
74 | QAbstractDataProxy::DataType QAbstractDataProxy::type() const |
75 | { |
76 | const Q_D(QAbstractDataProxy); |
77 | return d->m_type; |
78 | } |
79 | |
80 | // QAbstractDataProxyPrivate |
81 | |
82 | QAbstractDataProxyPrivate::QAbstractDataProxyPrivate(QAbstractDataProxy *q, |
83 | QAbstractDataProxy::DataType type) |
84 | : q_ptr(q), |
85 | m_type(type), |
86 | m_series(0) |
87 | { |
88 | } |
89 | |
90 | QAbstractDataProxyPrivate::~QAbstractDataProxyPrivate() |
91 | { |
92 | } |
93 | |
94 | void QAbstractDataProxyPrivate::setSeries(QAbstract3DSeries *series) |
95 | { |
96 | q_ptr->setParent(series); |
97 | m_series = series; |
98 | } |
99 | |
100 | QT_END_NAMESPACE |
101 | |