@@ -56,12 +56,21 | |||||
56 | <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li> |
|
56 | <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li> | |
57 | <li><a href="qxyseries.html">QXYSeries</a></li> |
|
57 | <li><a href="qxyseries.html">QXYSeries</a></li> | |
58 | <li><a href="qlegend.html">QLegend</a></li> |
|
58 | <li><a href="qlegend.html">QLegend</a></li> | |
59 |
<li><a href="q |
|
59 | <li><a href="qpiemodelmapper.html">QPieModelMapper</a></li> | |
60 | <li><a href="qvpiemodelmapper.html">QVPieModelMapper</a></li> |
|
60 | <ul> | |
61 |
<li><a href="qh |
|
61 | <li><a href="qhpiemodelmapper.html">QHPieModelMapper</a></li> | |
62 |
<li><a href="qv |
|
62 | <li><a href="qvpiemodelmapper.html">QVPieModelMapper</a></li> | |
63 | <li><a href="qhxymodelmapper.html">QHXYModelMapper</a></li> |
|
63 | </ul> | |
64 |
<li><a href="q |
|
64 | <li><a href="qbarmodelmapper.html">QBarModelMapper</a></li> | |
|
65 | <ul> | |||
|
66 | <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li> | |||
|
67 | <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li> | |||
|
68 | </ul> | |||
|
69 | <li><a href="qxymodelmapper.html">QXYModelMapper</a></li> | |||
|
70 | <ul> | |||
|
71 | <li><a href="qhxymodelmapper.html">QHXYModelMapper</a></li> | |||
|
72 | <li><a href="qvxymodelmapper.html">QVXYModelMapper</a></li> | |||
|
73 | </ul> | |||
65 | </ul> |
|
74 | </ul> | |
66 | </td> |
|
75 | </td> | |
67 | </tr> |
|
76 | </tr> |
@@ -27,7 +27,23 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
27 | \brief part of QtCommercial chart API. |
|
27 | \brief part of QtCommercial chart API. | |
28 | \mainclass |
|
28 | \mainclass | |
29 |
|
29 | |||
30 | Nothing here yet |
|
30 | This class is used to create a connection between QPieSeries and QAbstractItemModel derived model object that keeps the consecutive pie slices data in rows. | |
|
31 | It is possible to use both QAbstractItemModel and QPieSeries model API. QHPieModelMapper makes sure that Pie and the model are kept in sync. | |||
|
32 | NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. | |||
|
33 | */ | |||
|
34 | ||||
|
35 | /*! | |||
|
36 | \property QHPieModelMapper::valuesRow | |||
|
37 | \brief Defines which row of the model is kept in sync with the values of the pie's slices | |||
|
38 | ||||
|
39 | Default value is: -1 (invalid mapping) | |||
|
40 | */ | |||
|
41 | ||||
|
42 | /*! | |||
|
43 | \property QHPieModelMapper::labelsRow | |||
|
44 | \brief Defines which row of the model is kept in sync with the labels of the pie's slices | |||
|
45 | ||||
|
46 | Default value is: -1 (invalid mapping) | |||
31 | */ |
|
47 | */ | |
32 |
|
48 | |||
33 | QHPieModelMapper::QHPieModelMapper(QObject *parent) : |
|
49 | QHPieModelMapper::QHPieModelMapper(QObject *parent) : | |
@@ -36,21 +52,35 QHPieModelMapper::QHPieModelMapper(QObject *parent) : | |||||
36 | QPieModelMapper::setOrientation(Qt::Horizontal); |
|
52 | QPieModelMapper::setOrientation(Qt::Horizontal); | |
37 | } |
|
53 | } | |
38 |
|
54 | |||
|
55 | /*! | |||
|
56 | Returns which row of the model is kept in sync with the values of the pie's slices | |||
|
57 | */ | |||
39 | int QHPieModelMapper::valuesRow() const |
|
58 | int QHPieModelMapper::valuesRow() const | |
40 | { |
|
59 | { | |
41 | return QPieModelMapper::valuesSection(); |
|
60 | return QPieModelMapper::valuesSection(); | |
42 | } |
|
61 | } | |
43 |
|
62 | |||
|
63 | /*! | |||
|
64 | Sets the model row that is kept in sync with the pie slices values. | |||
|
65 | Parameter \a valuesRow specifies the row of the model. | |||
|
66 | */ | |||
44 | void QHPieModelMapper::setValuesRow(int valuesRow) |
|
67 | void QHPieModelMapper::setValuesRow(int valuesRow) | |
45 | { |
|
68 | { | |
46 | QPieModelMapper::setValuesSection(valuesRow); |
|
69 | QPieModelMapper::setValuesSection(valuesRow); | |
47 | } |
|
70 | } | |
48 |
|
71 | |||
|
72 | /*! | |||
|
73 | Returns which row of the model is kept in sync with the labels of the pie's slices | |||
|
74 | */ | |||
49 | int QHPieModelMapper::labelsRow() const |
|
75 | int QHPieModelMapper::labelsRow() const | |
50 | { |
|
76 | { | |
51 | return QPieModelMapper::labelsSection(); |
|
77 | return QPieModelMapper::labelsSection(); | |
52 | } |
|
78 | } | |
53 |
|
79 | |||
|
80 | /*! | |||
|
81 | Sets the model row that is kept in sync with the pie's slices labels. | |||
|
82 | Parameter \a labelsRow specifies the row of the model. | |||
|
83 | */ | |||
54 | void QHPieModelMapper::setLabelsRow(int labelsRow) |
|
84 | void QHPieModelMapper::setLabelsRow(int labelsRow) | |
55 | { |
|
85 | { | |
56 | QPieModelMapper::setLabelsSection(labelsRow); |
|
86 | QPieModelMapper::setLabelsSection(labelsRow); |
@@ -26,18 +26,49 | |||||
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 |
|
28 | |||
|
29 | /*! | |||
|
30 | \property QPieModelMapper::series | |||
|
31 | \brief Defines the QPieSeries object that is used by the mapper. | |||
|
32 | ||||
|
33 | All the data in the series in the series is discarded when it is set to the mapper. | |||
|
34 | When new series is specified the old series is disconnected (it preserves its data) | |||
|
35 | */ | |||
|
36 | ||||
|
37 | /*! | |||
|
38 | \property QPieModelMapper::model | |||
|
39 | \brief Defines the model that is used by the mapper. | |||
|
40 | */ | |||
|
41 | ||||
|
42 | /*! | |||
|
43 | \property QPieModelMapper::first | |||
|
44 | \brief Defines which item of the model's row/column should be mapped as the value/label of the first slice of the pie | |||
|
45 | ||||
|
46 | Minimal and default value is: 0 | |||
|
47 | */ | |||
|
48 | ||||
|
49 | /*! | |||
|
50 | \property QPieModelMapper::count | |||
|
51 | \brief Defines the number of rows/columns of the model that are mapped as the data for the pie. | |||
|
52 | ||||
|
53 | Minimal and default value is: -1 (count limited by the number of rows/columns in the model) | |||
|
54 | */ | |||
|
55 | ||||
|
56 | /*! | |||
|
57 | \class QPieModelMapper | |||
|
58 | \brief part of QtCommercial chart API. | |||
|
59 | \mainclass | |||
|
60 | ||||
|
61 | The instance of this class cannot be created directly. QHPieModelMapper of QVPieModelMapper should be used instead. This class is used to create a connection between QPieSeries and QAbstractItemModel derived model object. | |||
|
62 | It is possible to use both QAbstractItemModel and QPieSeries model API. QPieModelMapper makes sure that Pie and the model are kept in sync. | |||
|
63 | NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. | |||
|
64 | */ | |||
|
65 | ||||
29 | QPieModelMapper::QPieModelMapper(QObject *parent) : |
|
66 | QPieModelMapper::QPieModelMapper(QObject *parent) : | |
30 | QObject(parent), |
|
67 | QObject(parent), | |
31 | d_ptr(new QPieModelMapperPrivate(this)) |
|
68 | d_ptr(new QPieModelMapperPrivate(this)) | |
32 | { |
|
69 | { | |
33 | } |
|
70 | } | |
34 |
|
71 | |||
35 | QPieModelMapper::~QPieModelMapper() |
|
|||
36 | { |
|
|||
37 | // Q_D(QPieModelMapper); |
|
|||
38 | // disconnect(d->m_model, 0, d, 0); |
|
|||
39 | } |
|
|||
40 |
|
||||
41 | QAbstractItemModel* QPieModelMapper::model() const |
|
72 | QAbstractItemModel* QPieModelMapper::model() const | |
42 | { |
|
73 | { | |
43 | Q_D(const QPieModelMapper); |
|
74 | Q_D(const QPieModelMapper); | |
@@ -113,12 +144,22 void QPieModelMapper::setCount(int count) | |||||
113 | d->initializePieFromModel(); |
|
144 | d->initializePieFromModel(); | |
114 | } |
|
145 | } | |
115 |
|
146 | |||
|
147 | /*! | |||
|
148 | Returns the orientation that is used when QPieModelMapper accesses the model. | |||
|
149 | This mean whether the consecutive values/labels of the pie are read from row (Qt::Horizontal) | |||
|
150 | or from columns (Qt::Vertical) | |||
|
151 | */ | |||
116 | Qt::Orientation QPieModelMapper::orientation() const |
|
152 | Qt::Orientation QPieModelMapper::orientation() const | |
117 | { |
|
153 | { | |
118 | Q_D(const QPieModelMapper); |
|
154 | Q_D(const QPieModelMapper); | |
119 | return d->m_orientation; |
|
155 | return d->m_orientation; | |
120 | } |
|
156 | } | |
121 |
|
157 | |||
|
158 | /*! | |||
|
159 | Returns the \a orientation that is used when QPieModelMapper accesses the model. | |||
|
160 | This mean whether the consecutive values/labels of the pie are read from row (Qt::Horizontal) | |||
|
161 | or from columns (Qt::Vertical) | |||
|
162 | */ | |||
122 | void QPieModelMapper::setOrientation(Qt::Orientation orientation) |
|
163 | void QPieModelMapper::setOrientation(Qt::Orientation orientation) | |
123 | { |
|
164 | { | |
124 | Q_D(QPieModelMapper); |
|
165 | Q_D(QPieModelMapper); | |
@@ -126,12 +167,19 void QPieModelMapper::setOrientation(Qt::Orientation orientation) | |||||
126 | d->initializePieFromModel(); |
|
167 | d->initializePieFromModel(); | |
127 | } |
|
168 | } | |
128 |
|
169 | |||
|
170 | /*! | |||
|
171 | Returns which section of the model is kept in sync with the values of the pie's slices | |||
|
172 | */ | |||
129 | int QPieModelMapper::valuesSection() const |
|
173 | int QPieModelMapper::valuesSection() const | |
130 | { |
|
174 | { | |
131 | Q_D(const QPieModelMapper); |
|
175 | Q_D(const QPieModelMapper); | |
132 | return d->m_valuesSection; |
|
176 | return d->m_valuesSection; | |
133 | } |
|
177 | } | |
134 |
|
178 | |||
|
179 | /*! | |||
|
180 | Sets the model section that is kept in sync with the pie slices values. | |||
|
181 | Parameter \a valuesSection specifies the section of the model. | |||
|
182 | */ | |||
135 | void QPieModelMapper::setValuesSection(int valuesSection) |
|
183 | void QPieModelMapper::setValuesSection(int valuesSection) | |
136 | { |
|
184 | { | |
137 | Q_D(QPieModelMapper); |
|
185 | Q_D(QPieModelMapper); | |
@@ -139,12 +187,19 void QPieModelMapper::setValuesSection(int valuesSection) | |||||
139 | d->initializePieFromModel(); |
|
187 | d->initializePieFromModel(); | |
140 | } |
|
188 | } | |
141 |
|
189 | |||
|
190 | /*! | |||
|
191 | Returns which section of the model is kept in sync with the labels of the pie's slices | |||
|
192 | */ | |||
142 | int QPieModelMapper::labelsSection() const |
|
193 | int QPieModelMapper::labelsSection() const | |
143 | { |
|
194 | { | |
144 | Q_D(const QPieModelMapper); |
|
195 | Q_D(const QPieModelMapper); | |
145 | return d->m_labelsSection; |
|
196 | return d->m_labelsSection; | |
146 | } |
|
197 | } | |
147 |
|
198 | |||
|
199 | /*! | |||
|
200 | Sets the model section that is kept in sync with the pie slices labels. | |||
|
201 | Parameter \a labelsSection specifies the section of the model. | |||
|
202 | */ | |||
148 | void QPieModelMapper::setLabelsSection(int labelsSection) |
|
203 | void QPieModelMapper::setLabelsSection(int labelsSection) | |
149 | { |
|
204 | { | |
150 | Q_D(QPieModelMapper); |
|
205 | Q_D(QPieModelMapper); | |
@@ -152,6 +207,10 void QPieModelMapper::setLabelsSection(int labelsSection) | |||||
152 | d->initializePieFromModel(); |
|
207 | d->initializePieFromModel(); | |
153 | } |
|
208 | } | |
154 |
|
209 | |||
|
210 | /*! | |||
|
211 | Resets the QPieModelMapper to the default state. | |||
|
212 | first: 0; count: -1; valuesSection: -1; labelsSection: -1; | |||
|
213 | */ | |||
155 | void QPieModelMapper::reset() |
|
214 | void QPieModelMapper::reset() | |
156 | { |
|
215 | { | |
157 | Q_D(QPieModelMapper); |
|
216 | Q_D(QPieModelMapper); |
@@ -42,7 +42,6 class QTCOMMERCIALCHART_EXPORT QPieModelMapper : public QObject | |||||
42 |
|
42 | |||
43 | protected: |
|
43 | protected: | |
44 | QPieModelMapper(QObject *parent = 0); |
|
44 | QPieModelMapper(QObject *parent = 0); | |
45 | ~QPieModelMapper(); |
|
|||
46 |
|
45 | |||
47 | public: |
|
46 | public: | |
48 | QAbstractItemModel* model() const; |
|
47 | QAbstractItemModel* model() const; |
@@ -28,7 +28,23 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
28 | \brief part of QtCommercial chart API. |
|
28 | \brief part of QtCommercial chart API. | |
29 | \mainclass |
|
29 | \mainclass | |
30 |
|
30 | |||
31 | Nothing here yet |
|
31 | This class is used to create a connection between QPieSeries and QAbstractItemModel derived model object that keeps the consecutive pie slices data in columns. | |
|
32 | It is possible to use both QAbstractItemModel and QPieSeries model API. QVPieModelMapper makes sure that Pie and the model are kept in sync. | |||
|
33 | NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. | |||
|
34 | */ | |||
|
35 | ||||
|
36 | /*! | |||
|
37 | \property QVPieModelMapper::valuesColumn | |||
|
38 | \brief Defines which column of the model is kept in sync with the values of the pie's slices | |||
|
39 | ||||
|
40 | Default value is: -1 (invalid mapping) | |||
|
41 | */ | |||
|
42 | ||||
|
43 | /*! | |||
|
44 | \property QVPieModelMapper::labelsColumn | |||
|
45 | \brief Defines which column of the model is kept in sync with the labels of the pie's slices | |||
|
46 | ||||
|
47 | Default value is: -1 (invalid mapping) | |||
32 | */ |
|
48 | */ | |
33 |
|
49 | |||
34 | QVPieModelMapper::QVPieModelMapper(QObject *parent) : |
|
50 | QVPieModelMapper::QVPieModelMapper(QObject *parent) : | |
@@ -37,21 +53,35 QVPieModelMapper::QVPieModelMapper(QObject *parent) : | |||||
37 | QPieModelMapper::setOrientation(Qt::Vertical); |
|
53 | QPieModelMapper::setOrientation(Qt::Vertical); | |
38 | } |
|
54 | } | |
39 |
|
55 | |||
|
56 | /*! | |||
|
57 | Returns which column of the model is kept in sync with the values of the pie's slices | |||
|
58 | */ | |||
40 | int QVPieModelMapper::valuesColumn() const |
|
59 | int QVPieModelMapper::valuesColumn() const | |
41 | { |
|
60 | { | |
42 | return QPieModelMapper::valuesSection(); |
|
61 | return QPieModelMapper::valuesSection(); | |
43 | } |
|
62 | } | |
44 |
|
63 | |||
|
64 | /*! | |||
|
65 | Sets the model column that is kept in sync with the pie slices values. | |||
|
66 | Parameter \a valuesColumn specifies the row of the model. | |||
|
67 | */ | |||
45 | void QVPieModelMapper::setValuesColumn(int valuesColumn) |
|
68 | void QVPieModelMapper::setValuesColumn(int valuesColumn) | |
46 | { |
|
69 | { | |
47 | QPieModelMapper::setValuesSection(valuesColumn); |
|
70 | QPieModelMapper::setValuesSection(valuesColumn); | |
48 | } |
|
71 | } | |
49 |
|
72 | |||
|
73 | /*! | |||
|
74 | Returns which column of the model is kept in sync with the labels of the pie's slices | |||
|
75 | */ | |||
50 | int QVPieModelMapper::labelsColumn() const |
|
76 | int QVPieModelMapper::labelsColumn() const | |
51 | { |
|
77 | { | |
52 | return QPieModelMapper::labelsSection(); |
|
78 | return QPieModelMapper::labelsSection(); | |
53 | } |
|
79 | } | |
54 |
|
80 | |||
|
81 | /*! | |||
|
82 | Sets the model column that is kept in sync with the pie's slices labels. | |||
|
83 | Parameter \a labelsColumn specifies the row of the model. | |||
|
84 | */ | |||
55 | void QVPieModelMapper::setLabelsColumn(int labelsColumn) |
|
85 | void QVPieModelMapper::setLabelsColumn(int labelsColumn) | |
56 | { |
|
86 | { | |
57 | QPieModelMapper::setLabelsSection(labelsColumn); |
|
87 | QPieModelMapper::setLabelsSection(labelsColumn); |
General Comments 0
You need to be logged in to leave comments.
Login now