##// END OF EJS Templates
Added documentation for BarModelMapper classes
Marek Rosa -
r1348:da176c513ee6
parent child
Show More
@@ -9,6 +9,45
9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
10
10
11 /*!
11 /*!
12 \property QBarModelMapper::series
13 \brief Defines the QPieSeries object that is used by the mapper.
14
15 All the data in the series in the series is discarded when it is set to the mapper.
16 When new series is specified the old series is disconnected (it preserves its data)
17 */
18
19 /*!
20 \property QBarModelMapper::model
21 \brief Defines the model that is used by the mapper.
22 */
23
24 /*!
25 \property QBarModelMapper::first
26 \brief Defines which item of the model's row/column should be mapped as the value of the first QBarSet in the series.
27
28 Minimal and default value is: 0
29 */
30
31 /*!
32 \property QBarModelMapper::count
33 \brief Defines the number of rows/columns of the model that are mapped as the data for QBarSeries
34
35 Minimal and default value is: -1 (count limited by the number of rows/columns in the model)
36 */
37
38 /*!
39 \class QBarModelMapper
40 \brief part of QtCommercial chart API.
41 \mainclass
42
43 The instance of this class cannot be created directly. QHBarModelMapper of QVBarModelMapper should be used instead. This class is used to create a connection between QBarSeries and QAbstractItemModel derived model object.
44 Curently it is NOT possible to use both QAbstractItemModel and QXYSeries model API.
45 When the series is set to the mapper the QBarSeries and QBarSet API that affect the data (append, setValue, remove) should not be used.
46 The model and the QBarSeries won't be kept in sync. Model API should be used to insert,remove,modify BarSets.
47 NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells.
48 */
49
50 /*!
12 Constructs a mapper object which is a child of \a parent.
51 Constructs a mapper object which is a child of \a parent.
13 */
52 */
14 QBarModelMapper::QBarModelMapper(QObject *parent) :
53 QBarModelMapper::QBarModelMapper(QObject *parent) :
@@ -93,12 +132,22 void QBarModelMapper::setCount(int count)
93 d->initializeBarFromModel();
132 d->initializeBarFromModel();
94 }
133 }
95
134
135 /*!
136 Returns the orientation that is used when QBarModelMapper accesses the model.
137 This mean whether the consecutive values of the bar set are read from row (Qt::Horizontal)
138 or from columns (Qt::Vertical)
139 */
96 Qt::Orientation QBarModelMapper::orientation() const
140 Qt::Orientation QBarModelMapper::orientation() const
97 {
141 {
98 Q_D(const QBarModelMapper);
142 Q_D(const QBarModelMapper);
99 return d->m_orientation;
143 return d->m_orientation;
100 }
144 }
101
145
146 /*!
147 Returns the \a orientation that is used when QBarModelMapper accesses the model.
148 This mean whether the consecutive values of the pie are read from row (Qt::Horizontal)
149 or from columns (Qt::Vertical)
150 */
102 void QBarModelMapper::setOrientation(Qt::Orientation orientation)
151 void QBarModelMapper::setOrientation(Qt::Orientation orientation)
103 {
152 {
104 Q_D(QBarModelMapper);
153 Q_D(QBarModelMapper);
@@ -106,12 +155,19 void QBarModelMapper::setOrientation(Qt::Orientation orientation)
106 d->initializeBarFromModel();
155 d->initializeBarFromModel();
107 }
156 }
108
157
158 /*!
159 Returns which section of the model is used as the data source for the first bar set
160 */
109 int QBarModelMapper::firstBarSetSection() const
161 int QBarModelMapper::firstBarSetSection() const
110 {
162 {
111 Q_D(const QBarModelMapper);
163 Q_D(const QBarModelMapper);
112 return d->m_firstBarSetSection;
164 return d->m_firstBarSetSection;
113 }
165 }
114
166
167 /*!
168 Sets the model section that is used as the data source for the first bar set
169 Parameter \a firstBarSetSection specifies the section of the model.
170 */
115 void QBarModelMapper::setFirstBarSetSection(int firstBarSetSection)
171 void QBarModelMapper::setFirstBarSetSection(int firstBarSetSection)
116 {
172 {
117 Q_D(QBarModelMapper);
173 Q_D(QBarModelMapper);
@@ -119,12 +175,19 void QBarModelMapper::setFirstBarSetSection(int firstBarSetSection)
119 d->initializeBarFromModel();
175 d->initializeBarFromModel();
120 }
176 }
121
177
178 /*!
179 Returns which section of the model is used as the data source for the last bar set
180 */
122 int QBarModelMapper::lastBarSetSection() const
181 int QBarModelMapper::lastBarSetSection() const
123 {
182 {
124 Q_D(const QBarModelMapper);
183 Q_D(const QBarModelMapper);
125 return d->m_lastBarSetSection;
184 return d->m_lastBarSetSection;
126 }
185 }
127
186
187 /*!
188 Sets the model section that is used as the data source for the last bar set
189 Parameter \a lastBarSetSection specifies the section of the model.
190 */
128 void QBarModelMapper::setLastBarSetSection(int lastBarSetSection)
191 void QBarModelMapper::setLastBarSetSection(int lastBarSetSection)
129 {
192 {
130 Q_D(QBarModelMapper);
193 Q_D(QBarModelMapper);
@@ -132,12 +195,19 void QBarModelMapper::setLastBarSetSection(int lastBarSetSection)
132 d->initializeBarFromModel();
195 d->initializeBarFromModel();
133 }
196 }
134
197
198 /*!
199 Returns which section of the model is used as the data source for the x axis categories.
200 */
135 int QBarModelMapper::categoriesSection() const
201 int QBarModelMapper::categoriesSection() const
136 {
202 {
137 Q_D(const QBarModelMapper);
203 Q_D(const QBarModelMapper);
138 return d->m_categoriesSection;
204 return d->m_categoriesSection;
139 }
205 }
140
206
207 /*!
208 Sets the model section that is used as the data source for the x axis categories.
209 Parameter \a categoriesSection specifies the section of the model.
210 */
141 void QBarModelMapper::setCategoriesSection(int categoriesSection)
211 void QBarModelMapper::setCategoriesSection(int categoriesSection)
142 {
212 {
143 Q_D(QBarModelMapper);
213 Q_D(QBarModelMapper);
@@ -145,6 +215,10 void QBarModelMapper::setCategoriesSection(int categoriesSection)
145 d->initializeBarFromModel();
215 d->initializeBarFromModel();
146 }
216 }
147
217
218 /*!
219 Resets the QBarModelMapper to the default state.
220 first: 0; count: -1; firstBarSetSection: -1; lastBarSetSection: -1; categoriesSection: -1
221 */
148 void QBarModelMapper::reset()
222 void QBarModelMapper::reset()
149 {
223 {
150 Q_D(QBarModelMapper);
224 Q_D(QBarModelMapper);
@@ -52,9 +52,6 protected:
52 Qt::Orientation orientation() const;
52 Qt::Orientation orientation() const;
53 void setOrientation(Qt::Orientation orientation);
53 void setOrientation(Qt::Orientation orientation);
54
54
55 Q_SIGNALS:
56 void updated();
57
58 protected:
55 protected:
59 QBarModelMapperPrivate * const d_ptr;
56 QBarModelMapperPrivate * const d_ptr;
60 Q_DECLARE_PRIVATE(QBarModelMapper)
57 Q_DECLARE_PRIVATE(QBarModelMapper)
@@ -11,6 +11,27 QTCOMMERCIALCHART_BEGIN_NAMESPACE
11 */
11 */
12
12
13 /*!
13 /*!
14 \property QHBarModelMapper::firstBarSetRow
15 \brief Defines which column of the model is used as the data source for the first bar set
16
17 Default value is: -1 (invalid mapping)
18 */
19
20 /*!
21 \property QHBarModelMapper::lastBarSetRow
22 \brief Defines which column of the model is used as the data source for the last bar set
23
24 Default value is: -1 (invalid mapping)
25 */
26
27 /*!
28 \property QHBarModelMapper::categoriesRow
29 \brief Defines which row of the model is used as the data source for the x axis categories
30
31 Default value is: -1 (invalid mapping)
32 */
33
34 /*!
14 Constructs a mapper object which is a child of \a parent.
35 Constructs a mapper object which is a child of \a parent.
15 */
36 */
16 QHBarModelMapper::QHBarModelMapper(QObject *parent) :
37 QHBarModelMapper::QHBarModelMapper(QObject *parent) :
@@ -11,6 +11,27 QTCOMMERCIALCHART_BEGIN_NAMESPACE
11 */
11 */
12
12
13 /*!
13 /*!
14 \property QVBarModelMapper::firstBarSetColumn
15 \brief Defines which column of the model is used as the data source for the first bar set
16
17 Default value is: -1 (invalid mapping)
18 */
19
20 /*!
21 \property QVBarModelMapper::lastBarSetColumn
22 \brief Defines which column of the model is used as the data source for the last bar set
23
24 Default value is: -1 (invalid mapping)
25 */
26
27 /*!
28 \property QVBarModelMapper::categoriesColumn
29 \brief Defines which column of the model is used as the data source for the x axis categories
30
31 Default value is: -1 (invalid mapping)
32 */
33
34 /*!
14 Constructs a mapper object which is a child of \a parent.
35 Constructs a mapper object which is a child of \a parent.
15 */
36 */
16 QVBarModelMapper::QVBarModelMapper(QObject *parent) :
37 QVBarModelMapper::QVBarModelMapper(QObject *parent) :
General Comments 0
You need to be logged in to leave comments. Login now