1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Data Visualization module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 or (at your option) any later version
20** approved by the KDE Free Qt Foundation. The licenses are as published by
21** the Free Software Foundation and appearing in the file LICENSE.GPL3
22** included in the packaging of this file. Please review the following
23** information to ensure the GNU General Public License requirements will
24** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25**
26** $QT_END_LICENSE$
27**
28****************************************************************************/
29
30//
31// W A R N I N G
32// -------------
33//
34// This file is not part of the QtDataVisualization API. It exists purely as an
35// implementation detail. This header file may change from version to
36// version without notice, or even be removed.
37//
38// We mean it.
39
40#ifndef DECLARATIVEBARS_P_H
41#define DECLARATIVEBARS_P_H
42
43#include "datavisualizationglobal_p.h"
44#include "abstractdeclarative_p.h"
45#include "bars3dcontroller_p.h"
46
47QT_BEGIN_NAMESPACE_DATAVISUALIZATION
48
49class DeclarativeBars : public AbstractDeclarative
50{
51 Q_OBJECT
52 Q_PROPERTY(QCategory3DAxis *rowAxis READ rowAxis WRITE setRowAxis NOTIFY rowAxisChanged)
53 Q_PROPERTY(QValue3DAxis *valueAxis READ valueAxis WRITE setValueAxis NOTIFY valueAxisChanged)
54 Q_PROPERTY(QCategory3DAxis *columnAxis READ columnAxis WRITE setColumnAxis NOTIFY columnAxisChanged)
55 Q_PROPERTY(bool multiSeriesUniform READ isMultiSeriesUniform WRITE setMultiSeriesUniform NOTIFY multiSeriesUniformChanged)
56 Q_PROPERTY(float barThickness READ barThickness WRITE setBarThickness NOTIFY barThicknessChanged)
57 Q_PROPERTY(QSizeF barSpacing READ barSpacing WRITE setBarSpacing NOTIFY barSpacingChanged)
58 Q_PROPERTY(bool barSpacingRelative READ isBarSpacingRelative WRITE setBarSpacingRelative NOTIFY barSpacingRelativeChanged)
59 Q_PROPERTY(QQmlListProperty<QBar3DSeries> seriesList READ seriesList)
60 Q_PROPERTY(QBar3DSeries *selectedSeries READ selectedSeries NOTIFY selectedSeriesChanged)
61 Q_PROPERTY(QBar3DSeries *primarySeries READ primarySeries WRITE setPrimarySeries NOTIFY primarySeriesChanged)
62 Q_PROPERTY(float floorLevel READ floorLevel WRITE setFloorLevel NOTIFY floorLevelChanged REVISION 1)
63 Q_CLASSINFO("DefaultProperty", "seriesList")
64
65public:
66 explicit DeclarativeBars(QQuickItem *parent = 0);
67 ~DeclarativeBars();
68
69 QCategory3DAxis *rowAxis() const;
70 void setRowAxis(QCategory3DAxis *axis);
71 QValue3DAxis *valueAxis() const;
72 void setValueAxis(QValue3DAxis *axis);
73 QCategory3DAxis *columnAxis() const;
74 void setColumnAxis(QCategory3DAxis *axis);
75
76 void setMultiSeriesUniform(bool uniform);
77 bool isMultiSeriesUniform() const;
78
79 void setBarThickness(float thicknessRatio);
80 float barThickness() const;
81
82 void setBarSpacing(QSizeF spacing);
83 QSizeF barSpacing() const;
84
85 void setBarSpacingRelative(bool relative);
86 bool isBarSpacingRelative() const;
87
88 QQmlListProperty<QBar3DSeries> seriesList();
89 static void appendSeriesFunc(QQmlListProperty<QBar3DSeries> *list, QBar3DSeries *series);
90 static int countSeriesFunc(QQmlListProperty<QBar3DSeries> *list);
91 static QBar3DSeries *atSeriesFunc(QQmlListProperty<QBar3DSeries> *list, int index);
92 static void clearSeriesFunc(QQmlListProperty<QBar3DSeries> *list);
93 Q_INVOKABLE void addSeries(QBar3DSeries *series);
94 Q_INVOKABLE void removeSeries(QBar3DSeries *series);
95 Q_INVOKABLE void insertSeries(int index, QBar3DSeries *series);
96 void setPrimarySeries(QBar3DSeries *series);
97 QBar3DSeries *primarySeries() const;
98 QBar3DSeries *selectedSeries() const;
99
100 void setFloorLevel(float level);
101 float floorLevel() const;
102
103public Q_SLOTS:
104 void handleAxisXChanged(QAbstract3DAxis *axis);
105 void handleAxisYChanged(QAbstract3DAxis *axis);
106 void handleAxisZChanged(QAbstract3DAxis *axis);
107
108Q_SIGNALS:
109 void rowAxisChanged(QCategory3DAxis *axis);
110 void valueAxisChanged(QValue3DAxis *axis);
111 void columnAxisChanged(QCategory3DAxis *axis);
112 void multiSeriesUniformChanged(bool uniform);
113 void barThicknessChanged(float thicknessRatio);
114 void barSpacingChanged(QSizeF spacing);
115 void barSpacingRelativeChanged(bool relative);
116 void meshFileNameChanged(QString filename);
117 void primarySeriesChanged(QBar3DSeries *series);
118 void selectedSeriesChanged(QBar3DSeries *series);
119 Q_REVISION(1) void floorLevelChanged(float level);
120
121private:
122 Bars3DController *m_barsController;
123};
124
125QT_END_NAMESPACE_DATAVISUALIZATION
126
127#endif
128

source code of qtdatavis3d/src/datavisualizationqml2/declarativebars_p.h