summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/data/qabstractdataproxy.cpp
blob: 2ef4b614bb5a8204d29ff2b7e380a9f069e2322f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the QtDataVisualization module.
**
** Licensees holding valid Qt Enterprise licenses may use this file in
** accordance with the Qt Enterprise License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
**
****************************************************************************/

#include "qabstractdataproxy.h"
#include "qabstractdataproxy_p.h"

QT_DATAVISUALIZATION_BEGIN_NAMESPACE

/*!
 * \class QAbstractDataProxy
 * \inmodule QtDataVisualization
 * \brief Base class for all QtDataVisualization data proxies.
 * \since 1.0.0
 *
 * You use the visualization type specific inherited classes instead of the base class.
 * \sa QBarDataProxy, QScatterDataProxy, QSurfaceDataProxy
 */

/*!
 * \enum QAbstractDataProxy::DataType
 *
 * Data type of the proxy.
 *
 * \value DataTypeNone
 *        No data type.
 * \value DataTypeBar
 *        Data type for Q3DBars.
 * \value DataTypeScatter
 *        Data type for Q3DScatter.
 * \value DataTypeSurface
 *        Data type for Q3DSurface.
 */

/*!
 * \internal
 */
QAbstractDataProxy::QAbstractDataProxy(QAbstractDataProxyPrivate *d, QObject *parent) :
    QObject(parent),
    d_ptr(d)
{
}

/*!
 * Destroys QAbstractDataProxy.
 */
QAbstractDataProxy::~QAbstractDataProxy()
{
}

/*!
 * \property QAbstractDataProxy::type
 */
QAbstractDataProxy::DataType QAbstractDataProxy::type() const
{
    return d_ptr->m_type;
}

/*!
 * Sets label \a format for data items in this proxy. This format is used for single item labels,
 * e.g. when an item is selected. How the format is interpreted depends on proxy type. See
 * each proxy class documentation for more information.
 *
 * \sa QBarDataProxy, QScatterDataProxy, QSurfaceDataProxy
 */
void QAbstractDataProxy::setItemLabelFormat(const QString &format)
{
    d_ptr->setItemLabelFormat(format);
    emit itemLabelFormatChanged();
}

/*!
 * \return label format for data items in this proxy.
 */
QString QAbstractDataProxy::itemLabelFormat() const
{
    return d_ptr->m_itemLabelFormat;
}

/*!
 * \fn void QAbstractDataProxy::itemLabelFormatChanged()
 *
 * Emitted when label format changes.
 */

// QAbstractDataProxyPrivate

QAbstractDataProxyPrivate::QAbstractDataProxyPrivate(QAbstractDataProxy *q, QAbstractDataProxy::DataType type)
    : QObject(0),
      q_ptr(q),
      m_type(type),
      m_isDefaultProxy(false)
{
}

QAbstractDataProxyPrivate::~QAbstractDataProxyPrivate()
{
}

void QAbstractDataProxyPrivate::setItemLabelFormat(const QString &format)
{
    m_itemLabelFormat = format;
}

QT_DATAVISUALIZATION_END_NAMESPACE