@@ -30,22 +30,22 DeclarativeAreaSeries::DeclarativeAreaSeries(QObject *parent) : | |||||
30 | { |
|
30 | { | |
31 | } |
|
31 | } | |
32 |
|
32 | |||
33 |
void DeclarativeAreaSeries::setUpperSeries(DeclarativeLineSeries* |
|
33 | void DeclarativeAreaSeries::setUpperSeries(DeclarativeLineSeries *series) | |
34 | { |
|
34 | { | |
35 | QAreaSeries::setUpperSeries(series); |
|
35 | QAreaSeries::setUpperSeries(series); | |
36 | } |
|
36 | } | |
37 |
|
37 | |||
38 |
DeclarativeLineSeries* |
|
38 | DeclarativeLineSeries *DeclarativeAreaSeries::upperSeries() const | |
39 | { |
|
39 | { | |
40 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::upperSeries()); |
|
40 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::upperSeries()); | |
41 | } |
|
41 | } | |
42 |
|
42 | |||
43 |
void DeclarativeAreaSeries::setLowerSeries(DeclarativeLineSeries* |
|
43 | void DeclarativeAreaSeries::setLowerSeries(DeclarativeLineSeries *series) | |
44 | { |
|
44 | { | |
45 | QAreaSeries::setLowerSeries(series); |
|
45 | QAreaSeries::setLowerSeries(series); | |
46 | } |
|
46 | } | |
47 |
|
47 | |||
48 |
DeclarativeLineSeries* |
|
48 | DeclarativeLineSeries *DeclarativeAreaSeries::lowerSeries() const | |
49 | { |
|
49 | { | |
50 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::lowerSeries()); |
|
50 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::lowerSeries()); | |
51 | } |
|
51 | } |
@@ -37,10 +37,10 class DeclarativeAreaSeries : public QAreaSeries | |||||
37 |
|
37 | |||
38 | public: |
|
38 | public: | |
39 | explicit DeclarativeAreaSeries(QObject *parent = 0); |
|
39 | explicit DeclarativeAreaSeries(QObject *parent = 0); | |
40 |
void setUpperSeries(DeclarativeLineSeries* |
|
40 | void setUpperSeries(DeclarativeLineSeries *series); | |
41 |
DeclarativeLineSeries* |
|
41 | DeclarativeLineSeries *upperSeries() const; | |
42 |
void setLowerSeries(DeclarativeLineSeries* |
|
42 | void setLowerSeries(DeclarativeLineSeries *series); | |
43 |
DeclarativeLineSeries* |
|
43 | DeclarativeLineSeries *lowerSeries() const; | |
44 | QAbstractAxis *axisX() { return m_axisX; } |
|
44 | QAbstractAxis *axisX() { return m_axisX; } | |
45 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
45 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
46 | QAbstractAxis *axisY() { return m_axisY; } |
|
46 | QAbstractAxis *axisY() { return m_axisY; } |
@@ -25,8 +25,8 | |||||
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
27 |
|
27 | |||
28 |
DeclarativeBarSet::DeclarativeBarSet(QObject *parent) |
|
28 | DeclarativeBarSet::DeclarativeBarSet(QObject *parent) | |
29 | QBarSet("", parent) |
|
29 | : QBarSet("", parent) | |
30 | { |
|
30 | { | |
31 | connect(this, SIGNAL(valuesAdded(int,int)), this, SLOT(handleCountChanged(int,int))); |
|
31 | connect(this, SIGNAL(valuesAdded(int,int)), this, SLOT(handleCountChanged(int,int))); | |
32 | connect(this, SIGNAL(valuesRemoved(int,int)), this, SLOT(handleCountChanged(int,int))); |
|
32 | connect(this, SIGNAL(valuesRemoved(int,int)), this, SLOT(handleCountChanged(int,int))); | |
@@ -90,10 +90,10 void DeclarativeBarSeries::componentComplete() | |||||
90 | foreach (QObject *child, children()) { |
|
90 | foreach (QObject *child, children()) { | |
91 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
91 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
92 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
92 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
93 | } else if(qobject_cast<QVBarModelMapper *>(child)) { |
|
93 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
94 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
94 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
95 | mapper->setSeries(this); |
|
95 | mapper->setSeries(this); | |
96 | } else if(qobject_cast<QHBarModelMapper *>(child)) { |
|
96 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
97 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
97 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
98 | mapper->setSeries(this); |
|
98 | mapper->setSeries(this); | |
99 | } |
|
99 | } | |
@@ -114,7 +114,7 void DeclarativeBarSeries::appendSeriesChildren(QDeclarativeListProperty<QObject | |||||
114 |
|
114 | |||
115 | DeclarativeBarSet *DeclarativeBarSeries::at(int index) |
|
115 | DeclarativeBarSet *DeclarativeBarSeries::at(int index) | |
116 | { |
|
116 | { | |
117 | QList<QBarSet*> setList = barSets(); |
|
117 | QList<QBarSet *> setList = barSets(); | |
118 | if (index >= 0 && index < setList.count()) |
|
118 | if (index >= 0 && index < setList.count()) | |
119 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
119 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
120 |
|
120 | |||
@@ -149,10 +149,10 void DeclarativeStackedBarSeries::componentComplete() | |||||
149 | foreach (QObject *child, children()) { |
|
149 | foreach (QObject *child, children()) { | |
150 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
150 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
151 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
151 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
152 | } else if(qobject_cast<QVBarModelMapper *>(child)) { |
|
152 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
153 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
153 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
154 | mapper->setSeries(this); |
|
154 | mapper->setSeries(this); | |
155 | } else if(qobject_cast<QHBarModelMapper *>(child)) { |
|
155 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
156 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
156 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
157 | mapper->setSeries(this); |
|
157 | mapper->setSeries(this); | |
158 | } |
|
158 | } | |
@@ -174,7 +174,7 void DeclarativeStackedBarSeries::appendSeriesChildren(QDeclarativeListProperty< | |||||
174 |
|
174 | |||
175 | DeclarativeBarSet *DeclarativeStackedBarSeries::at(int index) |
|
175 | DeclarativeBarSet *DeclarativeStackedBarSeries::at(int index) | |
176 | { |
|
176 | { | |
177 | QList<QBarSet*> setList = barSets(); |
|
177 | QList<QBarSet *> setList = barSets(); | |
178 | if (index >= 0 && index < setList.count()) |
|
178 | if (index >= 0 && index < setList.count()) | |
179 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
179 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
180 |
|
180 | |||
@@ -209,10 +209,10 void DeclarativePercentBarSeries::componentComplete() | |||||
209 | foreach (QObject *child, children()) { |
|
209 | foreach (QObject *child, children()) { | |
210 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
210 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
211 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
211 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
212 | } else if(qobject_cast<QVBarModelMapper *>(child)) { |
|
212 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
213 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
213 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
214 | mapper->setSeries(this); |
|
214 | mapper->setSeries(this); | |
215 | } else if(qobject_cast<QHBarModelMapper *>(child)) { |
|
215 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
216 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
216 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
217 | mapper->setSeries(this); |
|
217 | mapper->setSeries(this); | |
218 | } |
|
218 | } | |
@@ -233,7 +233,7 void DeclarativePercentBarSeries::appendSeriesChildren(QDeclarativeListProperty< | |||||
233 |
|
233 | |||
234 | DeclarativeBarSet *DeclarativePercentBarSeries::at(int index) |
|
234 | DeclarativeBarSet *DeclarativePercentBarSeries::at(int index) | |
235 | { |
|
235 | { | |
236 | QList<QBarSet*> setList = barSets(); |
|
236 | QList<QBarSet *> setList = barSets(); | |
237 | if (index >= 0 && index < setList.count()) |
|
237 | if (index >= 0 && index < setList.count()) | |
238 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
238 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
239 |
|
239 | |||
@@ -268,10 +268,10 void DeclarativeHorizontalBarSeries::componentComplete() | |||||
268 | foreach (QObject *child, children()) { |
|
268 | foreach (QObject *child, children()) { | |
269 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
269 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
270 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
270 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
271 | } else if(qobject_cast<QVBarModelMapper *>(child)) { |
|
271 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
272 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
272 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
273 | mapper->setSeries(this); |
|
273 | mapper->setSeries(this); | |
274 | } else if(qobject_cast<QHBarModelMapper *>(child)) { |
|
274 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
275 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
275 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
276 | mapper->setSeries(this); |
|
276 | mapper->setSeries(this); | |
277 | } |
|
277 | } | |
@@ -292,7 +292,7 void DeclarativeHorizontalBarSeries::appendSeriesChildren(QDeclarativeListProper | |||||
292 |
|
292 | |||
293 | DeclarativeBarSet *DeclarativeHorizontalBarSeries::at(int index) |
|
293 | DeclarativeBarSet *DeclarativeHorizontalBarSeries::at(int index) | |
294 | { |
|
294 | { | |
295 | QList<QBarSet*> setList = barSets(); |
|
295 | QList<QBarSet *> setList = barSets(); | |
296 | if (index >= 0 && index < setList.count()) |
|
296 | if (index >= 0 && index < setList.count()) | |
297 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
297 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
298 |
|
298 | |||
@@ -327,10 +327,10 void DeclarativeHorizontalStackedBarSeries::componentComplete() | |||||
327 | foreach (QObject *child, children()) { |
|
327 | foreach (QObject *child, children()) { | |
328 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
328 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
329 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
329 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
330 | } else if(qobject_cast<QVBarModelMapper *>(child)) { |
|
330 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
331 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
331 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
332 | mapper->setSeries(this); |
|
332 | mapper->setSeries(this); | |
333 | } else if(qobject_cast<QHBarModelMapper *>(child)) { |
|
333 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
334 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
334 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
335 | mapper->setSeries(this); |
|
335 | mapper->setSeries(this); | |
336 | } |
|
336 | } | |
@@ -351,7 +351,7 void DeclarativeHorizontalStackedBarSeries::appendSeriesChildren(QDeclarativeLis | |||||
351 |
|
351 | |||
352 | DeclarativeBarSet *DeclarativeHorizontalStackedBarSeries::at(int index) |
|
352 | DeclarativeBarSet *DeclarativeHorizontalStackedBarSeries::at(int index) | |
353 | { |
|
353 | { | |
354 | QList<QBarSet*> setList = barSets(); |
|
354 | QList<QBarSet *> setList = barSets(); | |
355 | if (index >= 0 && index < setList.count()) |
|
355 | if (index >= 0 && index < setList.count()) | |
356 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
356 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
357 |
|
357 | |||
@@ -386,10 +386,10 void DeclarativeHorizontalPercentBarSeries::componentComplete() | |||||
386 | foreach (QObject *child, children()) { |
|
386 | foreach (QObject *child, children()) { | |
387 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
387 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
388 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
388 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
389 | } else if(qobject_cast<QVBarModelMapper *>(child)) { |
|
389 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
390 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
390 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
391 | mapper->setSeries(this); |
|
391 | mapper->setSeries(this); | |
392 | } else if(qobject_cast<QHBarModelMapper *>(child)) { |
|
392 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
393 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
393 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
394 | mapper->setSeries(this); |
|
394 | mapper->setSeries(this); | |
395 | } |
|
395 | } | |
@@ -410,7 +410,7 void DeclarativeHorizontalPercentBarSeries::appendSeriesChildren(QDeclarativeLis | |||||
410 |
|
410 | |||
411 | DeclarativeBarSet *DeclarativeHorizontalPercentBarSeries::at(int index) |
|
411 | DeclarativeBarSet *DeclarativeHorizontalPercentBarSeries::at(int index) | |
412 | { |
|
412 | { | |
413 | QList<QBarSet*> setList = barSets(); |
|
413 | QList<QBarSet *> setList = barSets(); | |
414 | if (index >= 0 && index < setList.count()) |
|
414 | if (index >= 0 && index < setList.count()) | |
415 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
415 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
416 |
|
416 |
@@ -104,8 +104,8 public Q_SLOTS: | |||||
104 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
104 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
105 |
|
105 | |||
106 | private: |
|
106 | private: | |
107 |
QAbstractAxis* |
|
107 | QAbstractAxis *m_axisX; | |
108 |
QAbstractAxis* |
|
108 | QAbstractAxis *m_axisY; | |
109 | }; |
|
109 | }; | |
110 |
|
110 | |||
111 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDeclarativeParserStatus |
|
111 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDeclarativeParserStatus | |
@@ -144,8 +144,8 public Q_SLOTS: | |||||
144 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
144 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
145 |
|
145 | |||
146 | private: |
|
146 | private: | |
147 |
QAbstractAxis* |
|
147 | QAbstractAxis *m_axisX; | |
148 |
QAbstractAxis* |
|
148 | QAbstractAxis *m_axisY; | |
149 | }; |
|
149 | }; | |
150 |
|
150 | |||
151 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QDeclarativeParserStatus |
|
151 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QDeclarativeParserStatus | |
@@ -184,8 +184,8 public Q_SLOTS: | |||||
184 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
184 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
185 |
|
185 | |||
186 | private: |
|
186 | private: | |
187 |
QAbstractAxis* |
|
187 | QAbstractAxis *m_axisX; | |
188 |
QAbstractAxis* |
|
188 | QAbstractAxis *m_axisY; | |
189 | }; |
|
189 | }; | |
190 |
|
190 | |||
191 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDeclarativeParserStatus |
|
191 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDeclarativeParserStatus | |
@@ -224,8 +224,8 public Q_SLOTS: | |||||
224 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
224 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
225 |
|
225 | |||
226 | private: |
|
226 | private: | |
227 |
QAbstractAxis* |
|
227 | QAbstractAxis *m_axisX; | |
228 |
QAbstractAxis* |
|
228 | QAbstractAxis *m_axisY; | |
229 | }; |
|
229 | }; | |
230 |
|
230 | |||
231 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDeclarativeParserStatus |
|
231 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDeclarativeParserStatus | |
@@ -264,8 +264,8 public Q_SLOTS: | |||||
264 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
264 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
265 |
|
265 | |||
266 | private: |
|
266 | private: | |
267 |
QAbstractAxis* |
|
267 | QAbstractAxis *m_axisX; | |
268 |
QAbstractAxis* |
|
268 | QAbstractAxis *m_axisY; | |
269 | }; |
|
269 | }; | |
270 |
|
270 | |||
271 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDeclarativeParserStatus |
|
271 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDeclarativeParserStatus | |
@@ -304,8 +304,8 public Q_SLOTS: | |||||
304 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
304 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
305 |
|
305 | |||
306 | private: |
|
306 | private: | |
307 |
QAbstractAxis* |
|
307 | QAbstractAxis *m_axisX; | |
308 |
QAbstractAxis* |
|
308 | QAbstractAxis *m_axisY; | |
309 | }; |
|
309 | }; | |
310 |
|
310 | |||
311 | QTCOMMERCIALCHART_END_NAMESPACE |
|
311 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -81,7 +81,7 void DeclarativeCategoryAxis::remove(const QString &label) | |||||
81 | QCategoryAxis::remove(label); |
|
81 | QCategoryAxis::remove(label); | |
82 | } |
|
82 | } | |
83 |
|
83 | |||
84 |
void DeclarativeCategoryAxis::replace(const QString& |
|
84 | void DeclarativeCategoryAxis::replace(const QString &oldLabel, const QString &newLabel) | |
85 | { |
|
85 | { | |
86 | QCategoryAxis::replaceLabel(oldLabel, newLabel); |
|
86 | QCategoryAxis::replaceLabel(oldLabel, newLabel); | |
87 | } |
|
87 | } |
@@ -68,7 +68,7 public: // from QDeclarativeParserStatus | |||||
68 | public Q_SLOTS: |
|
68 | public Q_SLOTS: | |
69 | Q_INVOKABLE void append(const QString &label, qreal categoryEndValue); |
|
69 | Q_INVOKABLE void append(const QString &label, qreal categoryEndValue); | |
70 | Q_INVOKABLE void remove(const QString &label); |
|
70 | Q_INVOKABLE void remove(const QString &label); | |
71 |
Q_INVOKABLE void replace(const QString& |
|
71 | Q_INVOKABLE void replace(const QString &oldLabel, const QString &newLabel); | |
72 | static void appendAxisChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
72 | static void appendAxisChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
73 |
|
73 | |||
74 | private: |
|
74 | private: |
@@ -368,7 +368,7 void DeclarativeChart::componentComplete() | |||||
368 | QDeclarativeItem::componentComplete(); |
|
368 | QDeclarativeItem::componentComplete(); | |
369 | } |
|
369 | } | |
370 |
|
370 | |||
371 |
void DeclarativeChart::handleAxisXSet(QAbstractAxis* |
|
371 | void DeclarativeChart::handleAxisXSet(QAbstractAxis *axis) | |
372 | { |
|
372 | { | |
373 | // qDebug() << "DeclarativeChart::handleAxisXSet" << sender() << axis; |
|
373 | // qDebug() << "DeclarativeChart::handleAxisXSet" << sender() << axis; | |
374 | if (axis && qobject_cast<QAbstractSeries *>(sender())) |
|
374 | if (axis && qobject_cast<QAbstractSeries *>(sender())) | |
@@ -377,7 +377,7 void DeclarativeChart::handleAxisXSet(QAbstractAxis* axis) | |||||
377 | qWarning() << "Trying to set axisX to null."; |
|
377 | qWarning() << "Trying to set axisX to null."; | |
378 | } |
|
378 | } | |
379 |
|
379 | |||
380 |
void DeclarativeChart::handleAxisYSet(QAbstractAxis* |
|
380 | void DeclarativeChart::handleAxisYSet(QAbstractAxis *axis) | |
381 | { |
|
381 | { | |
382 | // qDebug() << "DeclarativeChart::handleAxisYSet" << sender() << axis; |
|
382 | // qDebug() << "DeclarativeChart::handleAxisYSet" << sender() << axis; | |
383 | if (axis && qobject_cast<QAbstractSeries *>(sender())) |
|
383 | if (axis && qobject_cast<QAbstractSeries *>(sender())) | |
@@ -473,7 +473,7 QFont DeclarativeChart::titleFont() const | |||||
473 | return m_chart->titleFont(); |
|
473 | return m_chart->titleFont(); | |
474 | } |
|
474 | } | |
475 |
|
475 | |||
476 |
void DeclarativeChart::setTitleFont(const QFont& |
|
476 | void DeclarativeChart::setTitleFont(const QFont &font) | |
477 | { |
|
477 | { | |
478 | m_chart->setTitleFont(font); |
|
478 | m_chart->setTitleFont(font); | |
479 | } |
|
479 | } | |
@@ -669,17 +669,17 void DeclarativeChart::createDefaultAxes() | |||||
669 | qWarning() << "ChartView.createDefaultAxes() is deprecated. Axes are created automatically."; |
|
669 | qWarning() << "ChartView.createDefaultAxes() is deprecated. Axes are created automatically."; | |
670 | } |
|
670 | } | |
671 |
|
671 | |||
672 |
void DeclarativeChart::createDefaultAxes(QAbstractSeries* |
|
672 | void DeclarativeChart::createDefaultAxes(QAbstractSeries *series) | |
673 | { |
|
673 | { | |
674 | foreach (QAbstractSeries *s, m_chart->series()) { |
|
674 | foreach (QAbstractSeries *s, m_chart->series()) { | |
675 | // If there is already an x axis of the correct type, re-use it |
|
675 | // If there is already an x axis of the correct type, re-use it | |
676 | if (!m_chart->axisX(series) && s != series && m_chart->axisX(s) |
|
676 | if (!m_chart->axisX(series) && s != series && m_chart->axisX(s) | |
677 |
|
|
677 | && m_chart->axisX(s)->type() == series->d_ptr->defaultAxisType(Qt::Horizontal)) | |
678 | m_chart->setAxisX(m_chart->axisX(s), series); |
|
678 | m_chart->setAxisX(m_chart->axisX(s), series); | |
679 |
|
679 | |||
680 | // If there is already a y axis of the correct type, re-use it |
|
680 | // If there is already a y axis of the correct type, re-use it | |
681 | if (!m_chart->axisY(series) && s != series && m_chart->axisY(s) |
|
681 | if (!m_chart->axisY(series) && s != series && m_chart->axisY(s) | |
682 |
|
|
682 | && m_chart->axisY(s)->type() == series->d_ptr->defaultAxisType(Qt::Vertical)) | |
683 | m_chart->setAxisY(m_chart->axisY(s), series); |
|
683 | m_chart->setAxisY(m_chart->axisY(s), series); | |
684 | } |
|
684 | } | |
685 |
|
685 |
@@ -72,7 +72,7 public: | |||||
72 | enum Animation { |
|
72 | enum Animation { | |
73 | NoAnimation = 0x0, |
|
73 | NoAnimation = 0x0, | |
74 | GridAxisAnimations = 0x1, |
|
74 | GridAxisAnimations = 0x1, | |
75 | SeriesAnimations =0x2, |
|
75 | SeriesAnimations = 0x2, | |
76 | AllAnimations = 0x3 |
|
76 | AllAnimations = 0x3 | |
77 | }; |
|
77 | }; | |
78 |
|
78 | |||
@@ -108,7 +108,7 public: | |||||
108 | QString title(); |
|
108 | QString title(); | |
109 | QLegend *legend(); |
|
109 | QLegend *legend(); | |
110 | QFont titleFont() const; |
|
110 | QFont titleFont() const; | |
111 |
void setTitleFont(const QFont& |
|
111 | void setTitleFont(const QFont &font); | |
112 | void setTitleColor(QColor color); |
|
112 | void setTitleColor(QColor color); | |
113 | QColor titleColor(); |
|
113 | QColor titleColor(); | |
114 | void setBackgroundColor(QColor color); |
|
114 | void setBackgroundColor(QColor color); | |
@@ -120,7 +120,7 public: | |||||
120 | qreal bottomMargin(); |
|
120 | qreal bottomMargin(); | |
121 | qreal leftMargin(); |
|
121 | qreal leftMargin(); | |
122 | qreal rightMargin(); |
|
122 | qreal rightMargin(); | |
123 |
void createDefaultAxes(QAbstractSeries* |
|
123 | void createDefaultAxes(QAbstractSeries *series); | |
124 | //TODO this is depreciated: |
|
124 | //TODO this is depreciated: | |
125 | DeclarativeMargins *minimumMargins() { return m_margins; } |
|
125 | DeclarativeMargins *minimumMargins() { return m_margins; } | |
126 |
|
126 | |||
@@ -153,8 +153,8 Q_SIGNALS: | |||||
153 | void minimumMarginsChanged(); |
|
153 | void minimumMarginsChanged(); | |
154 | Q_REVISION(2) void marginsChanged(); |
|
154 | Q_REVISION(2) void marginsChanged(); | |
155 | void plotAreaChanged(QRectF plotArea); |
|
155 | void plotAreaChanged(QRectF plotArea); | |
156 |
void seriesAdded(QAbstractSeries* |
|
156 | void seriesAdded(QAbstractSeries *series); | |
157 |
void seriesRemoved(QAbstractSeries* |
|
157 | void seriesRemoved(QAbstractSeries *series); | |
158 |
|
158 | |||
159 | public Q_SLOTS: |
|
159 | public Q_SLOTS: | |
160 | void changeMinimumMargins(int top, int bottom, int left, int right); |
|
160 | void changeMinimumMargins(int top, int bottom, int left, int right); |
@@ -41,10 +41,10 void DeclarativePieSeries::componentComplete() | |||||
41 | foreach (QObject *child, children()) { |
|
41 | foreach (QObject *child, children()) { | |
42 | if (qobject_cast<QPieSlice *>(child)) { |
|
42 | if (qobject_cast<QPieSlice *>(child)) { | |
43 | QPieSeries::append(qobject_cast<QPieSlice *>(child)); |
|
43 | QPieSeries::append(qobject_cast<QPieSlice *>(child)); | |
44 | } else if(qobject_cast<QVPieModelMapper *>(child)) { |
|
44 | } else if (qobject_cast<QVPieModelMapper *>(child)) { | |
45 | QVPieModelMapper *mapper = qobject_cast<QVPieModelMapper *>(child); |
|
45 | QVPieModelMapper *mapper = qobject_cast<QVPieModelMapper *>(child); | |
46 | mapper->setSeries(this); |
|
46 | mapper->setSeries(this); | |
47 | } else if(qobject_cast<QHPieModelMapper *>(child)) { |
|
47 | } else if (qobject_cast<QHPieModelMapper *>(child)) { | |
48 | QHPieModelMapper *mapper = qobject_cast<QHPieModelMapper *>(child); |
|
48 | QHPieModelMapper *mapper = qobject_cast<QHPieModelMapper *>(child); | |
49 | mapper->setSeries(this); |
|
49 | mapper->setSeries(this); | |
50 | } |
|
50 | } | |
@@ -65,14 +65,14 void DeclarativePieSeries::appendSeriesChildren(QDeclarativeListProperty<QObject | |||||
65 |
|
65 | |||
66 | QPieSlice *DeclarativePieSeries::at(int index) |
|
66 | QPieSlice *DeclarativePieSeries::at(int index) | |
67 | { |
|
67 | { | |
68 | QList<QPieSlice*> sliceList = slices(); |
|
68 | QList<QPieSlice *> sliceList = slices(); | |
69 | if (index >= 0 && index < sliceList.count()) |
|
69 | if (index >= 0 && index < sliceList.count()) | |
70 | return sliceList[index]; |
|
70 | return sliceList[index]; | |
71 |
|
71 | |||
72 | return 0; |
|
72 | return 0; | |
73 | } |
|
73 | } | |
74 |
|
74 | |||
75 |
QPieSlice* |
|
75 | QPieSlice *DeclarativePieSeries::find(QString label) | |
76 | { |
|
76 | { | |
77 | foreach (QPieSlice *slice, slices()) { |
|
77 | foreach (QPieSlice *slice, slices()) { | |
78 | if (slice->label() == label) |
|
78 | if (slice->label() == label) | |
@@ -81,7 +81,7 QPieSlice* DeclarativePieSeries::find(QString label) | |||||
81 | return 0; |
|
81 | return 0; | |
82 | } |
|
82 | } | |
83 |
|
83 | |||
84 |
QPieSlice* |
|
84 | QPieSlice *DeclarativePieSeries::append(QString label, qreal value) | |
85 | { |
|
85 | { | |
86 | QPieSlice *slice = new QPieSlice(this); |
|
86 | QPieSlice *slice = new QPieSlice(this); | |
87 | slice->setLabel(label); |
|
87 | slice->setLabel(label); | |
@@ -100,13 +100,13 void DeclarativePieSeries::clear() | |||||
100 | QPieSeries::clear(); |
|
100 | QPieSeries::clear(); | |
101 | } |
|
101 | } | |
102 |
|
102 | |||
103 | void DeclarativePieSeries::handleAdded(QList<QPieSlice*> slices) |
|
103 | void DeclarativePieSeries::handleAdded(QList<QPieSlice *> slices) | |
104 | { |
|
104 | { | |
105 | foreach (QPieSlice *slice, slices) |
|
105 | foreach (QPieSlice *slice, slices) | |
106 | emit sliceAdded(slice); |
|
106 | emit sliceAdded(slice); | |
107 | } |
|
107 | } | |
108 |
|
108 | |||
109 | void DeclarativePieSeries::handleRemoved(QList<QPieSlice*> slices) |
|
109 | void DeclarativePieSeries::handleRemoved(QList<QPieSlice *> slices) | |
110 | { |
|
110 | { | |
111 | foreach (QPieSlice *slice, slices) |
|
111 | foreach (QPieSlice *slice, slices) | |
112 | emit sliceRemoved(slice); |
|
112 | emit sliceRemoved(slice); |
@@ -54,13 +54,13 public: | |||||
54 | void componentComplete(); |
|
54 | void componentComplete(); | |
55 |
|
55 | |||
56 | Q_SIGNALS: |
|
56 | Q_SIGNALS: | |
57 |
void sliceAdded(QPieSlice* |
|
57 | void sliceAdded(QPieSlice *slice); | |
58 |
void sliceRemoved(QPieSlice* |
|
58 | void sliceRemoved(QPieSlice *slice); | |
59 |
|
59 | |||
60 | public Q_SLOTS: |
|
60 | public Q_SLOTS: | |
61 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
61 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
62 | void handleAdded(QList<QPieSlice*> slices); |
|
62 | void handleAdded(QList<QPieSlice *> slices); | |
63 | void handleRemoved(QList<QPieSlice*> slices); |
|
63 | void handleRemoved(QList<QPieSlice *> slices); | |
64 | }; |
|
64 | }; | |
65 |
|
65 | |||
66 | QTCOMMERCIALCHART_END_NAMESPACE |
|
66 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -47,10 +47,10 void DeclarativeXySeries::componentComplete() | |||||
47 | if (qobject_cast<DeclarativeXYPoint *>(child)) { |
|
47 | if (qobject_cast<DeclarativeXYPoint *>(child)) { | |
48 | DeclarativeXYPoint *point = qobject_cast<DeclarativeXYPoint *>(child); |
|
48 | DeclarativeXYPoint *point = qobject_cast<DeclarativeXYPoint *>(child); | |
49 | series->append(point->x(), point->y()); |
|
49 | series->append(point->x(), point->y()); | |
50 | } else if(qobject_cast<QVXYModelMapper *>(child)) { |
|
50 | } else if (qobject_cast<QVXYModelMapper *>(child)) { | |
51 | QVXYModelMapper *mapper = qobject_cast<QVXYModelMapper *>(child); |
|
51 | QVXYModelMapper *mapper = qobject_cast<QVXYModelMapper *>(child); | |
52 | mapper->setSeries(series); |
|
52 | mapper->setSeries(series); | |
53 | } else if(qobject_cast<QHXYModelMapper *>(child)) { |
|
53 | } else if (qobject_cast<QHXYModelMapper *>(child)) { | |
54 | QHXYModelMapper *mapper = qobject_cast<QHXYModelMapper *>(child); |
|
54 | QHXYModelMapper *mapper = qobject_cast<QHXYModelMapper *>(child); | |
55 | mapper->setSeries(series); |
|
55 | mapper->setSeries(series); | |
56 | } |
|
56 | } |
@@ -62,7 +62,7 class ChartQmlPlugin : public QDeclarativeExtensionPlugin | |||||
62 | Q_PLUGIN_METADATA(IID "org.qt-project.foo") |
|
62 | Q_PLUGIN_METADATA(IID "org.qt-project.foo") | |
63 | #endif |
|
63 | #endif | |
64 |
|
64 | |||
65 |
|
|
65 | public: | |
66 | virtual void registerTypes(const char *uri) |
|
66 | virtual void registerTypes(const char *uri) | |
67 | { |
|
67 | { | |
68 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); |
|
68 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); |
@@ -42,16 +42,15 QString QChartsPlugin::name() const | |||||
42 |
|
42 | |||
43 | QString QChartsPlugin::includeFile() const |
|
43 | QString QChartsPlugin::includeFile() const | |
44 | { |
|
44 | { | |
45 |
|
|
45 | #ifdef linux | |
46 | QString myNewLine = "\n"; |
|
46 | QString myNewLine = "\n"; | |
47 |
|
|
47 | #endif | |
48 |
|
|
48 | #ifdef WIN32 | |
49 | QString myNewLine = "\n\r"; |
|
49 | QString myNewLine = "\n\r"; | |
50 |
|
|
50 | #endif | |
51 |
|
|
51 | #ifdef __APPLE__ | |
52 | QString myNewLine = "\n"; |
|
52 | QString myNewLine = "\n"; | |
53 |
|
|
53 | #endif | |
54 |
|
||||
55 | return "<qchartview.h>" + myNewLine + "#include <chartsnamespace.h>"; |
|
54 | return "<qchartview.h>" + myNewLine + "#include <chartsnamespace.h>"; | |
56 | } |
|
55 | } | |
57 |
|
56 | |||
@@ -80,7 +79,7 bool QChartsPlugin::isContainer() const | |||||
80 | return false; |
|
79 | return false; | |
81 | } |
|
80 | } | |
82 |
|
81 | |||
83 |
QWidget* |
|
82 | QWidget *QChartsPlugin::createWidget(QWidget *parent) | |
84 | { |
|
83 | { | |
85 | return new QChartView(new QChart(), parent); |
|
84 | return new QChartView(new QChart(), parent); | |
86 | } |
|
85 | } |
@@ -23,7 +23,7 | |||||
23 |
|
23 | |||
24 | #include <QDesignerCustomWidgetInterface> |
|
24 | #include <QDesignerCustomWidgetInterface> | |
25 |
|
25 | |||
26 | class QChartsPlugin: public QObject,public QDesignerCustomWidgetInterface |
|
26 | class QChartsPlugin: public QObject, public QDesignerCustomWidgetInterface | |
27 | { |
|
27 | { | |
28 |
|
28 | |||
29 | #ifdef QT5_QUICK_1 |
|
29 | #ifdef QT5_QUICK_1 |
General Comments 0
You need to be logged in to leave comments.
Login now