##// END OF EJS Templates
Renamed appendBarSet to append, removeBarSet to remove
sauimone -
r1194:d962cd819f79
parent child
Show More
@@ -222,7 +222,7 QChart* ThemeWidget::createBarChart(int valueCount) const
222 QBarSet *set = new QBarSet("Bar set " + QString::number(i));
222 QBarSet *set = new QBarSet("Bar set " + QString::number(i));
223 foreach (Data data, m_dataTable[i])
223 foreach (Data data, m_dataTable[i])
224 *set << data.first.y();
224 *set << data.first.y();
225 series->appendBarSet(set);
225 series->append(set);
226 }
226 }
227 chart->addSeries(series);
227 chart->addSeries(series);
228
228
@@ -53,11 +53,11 int main(int argc, char *argv[])
53 //![3]
53 //![3]
54 QBarSeries* series = new QBarSeries();
54 QBarSeries* series = new QBarSeries();
55 series->setCategories(categories);
55 series->setCategories(categories);
56 series->appendBarSet(set0);
56 series->append(set0);
57 series->appendBarSet(set1);
57 series->append(set1);
58 series->appendBarSet(set2);
58 series->append(set2);
59 series->appendBarSet(set3);
59 series->append(set3);
60 series->appendBarSet(set4);
60 series->append(set4);
61
61
62 //![3]
62 //![3]
63
63
@@ -53,11 +53,11 int main(int argc, char *argv[])
53 //![3]
53 //![3]
54 QGroupedBarSeries* series = new QGroupedBarSeries();
54 QGroupedBarSeries* series = new QGroupedBarSeries();
55 series->setCategories(categories);
55 series->setCategories(categories);
56 series->appendBarSet(set0);
56 series->append(set0);
57 series->appendBarSet(set1);
57 series->append(set1);
58 series->appendBarSet(set2);
58 series->append(set2);
59 series->appendBarSet(set3);
59 series->append(set3);
60 series->appendBarSet(set4);
60 series->append(set4);
61
61
62 //![3]
62 //![3]
63
63
@@ -53,11 +53,11 int main(int argc, char *argv[])
53 //![3]
53 //![3]
54 QPercentBarSeries* series = new QPercentBarSeries();
54 QPercentBarSeries* series = new QPercentBarSeries();
55 series->setCategories(categories);
55 series->setCategories(categories);
56 series->appendBarSet(set0);
56 series->append(set0);
57 series->appendBarSet(set1);
57 series->append(set1);
58 series->appendBarSet(set2);
58 series->append(set2);
59 series->appendBarSet(set3);
59 series->append(set3);
60 series->appendBarSet(set4);
60 series->append(set4);
61 //![3]
61 //![3]
62
62
63 //![4]
63 //![4]
@@ -53,11 +53,11 int main(int argc, char *argv[])
53 //![3]
53 //![3]
54 QStackedBarSeries* series = new QStackedBarSeries();
54 QStackedBarSeries* series = new QStackedBarSeries();
55 series->setCategories(categories);
55 series->setCategories(categories);
56 series->appendBarSet(set0);
56 series->append(set0);
57 series->appendBarSet(set1);
57 series->append(set1);
58 series->appendBarSet(set2);
58 series->append(set2);
59 series->appendBarSet(set3);
59 series->append(set3);
60 series->appendBarSet(set4);
60 series->append(set4);
61 //![3]
61 //![3]
62
62
63 //![4]
63 //![4]
@@ -86,10 +86,10 int main(int argc, char *argv[])
86 foreach (QString week, weeks )
86 foreach (QString week, weeks )
87 *weeklyCrop << (qrand() % 20);
87 *weeklyCrop << (qrand() % 20);
88 // Get the drilldown series from season series and add crop to it.
88 // Get the drilldown series from season series and add crop to it.
89 seasonSeries->drilldownSeries(month)->appendBarSet(weeklyCrop);
89 seasonSeries->drilldownSeries(month)->append(weeklyCrop);
90 *monthlyCrop << weeklyCrop->sum();
90 *monthlyCrop << weeklyCrop->sum();
91 }
91 }
92 seasonSeries->appendBarSet(monthlyCrop);
92 seasonSeries->append(monthlyCrop);
93 }
93 }
94 //! [5]
94 //! [5]
95
95
@@ -107,7 +107,7 void QBarSeries::setCategories(QBarCategories categories)
107 /*!
107 /*!
108 Adds a set of bars to series. Takes ownership of \a set.
108 Adds a set of bars to series. Takes ownership of \a set.
109 */
109 */
110 bool QBarSeries::appendBarSet(QBarSet *set)
110 bool QBarSeries::append(QBarSet *set)
111 {
111 {
112 Q_D(QBarSeries);
112 Q_D(QBarSeries);
113 if ((d->m_barSets.contains(set)) || (set == 0)) {
113 if ((d->m_barSets.contains(set)) || (set == 0)) {
@@ -123,7 +123,7 bool QBarSeries::appendBarSet(QBarSet *set)
123 /*!
123 /*!
124 Removes a set of bars from series. Releases ownership of \a set. Doesn't delete \a set.
124 Removes a set of bars from series. Releases ownership of \a set. Doesn't delete \a set.
125 */
125 */
126 bool QBarSeries::removeBarSet(QBarSet *set)
126 bool QBarSeries::remove(QBarSet *set)
127 {
127 {
128 Q_D(QBarSeries);
128 Q_D(QBarSeries);
129 if (!d->m_barSets.contains(set)) {
129 if (!d->m_barSets.contains(set)) {
@@ -139,7 +139,7 bool QBarSeries::removeBarSet(QBarSet *set)
139 /*!
139 /*!
140 Adds a list of barsets to series. Takes ownership of \a sets.
140 Adds a list of barsets to series. Takes ownership of \a sets.
141 */
141 */
142 bool QBarSeries::appendBarSets(QList<QBarSet* > sets)
142 bool QBarSeries::append(QList<QBarSet* > sets)
143 {
143 {
144 Q_D(QBarSeries);
144 Q_D(QBarSeries);
145 foreach (QBarSet* set, sets) {
145 foreach (QBarSet* set, sets) {
@@ -164,7 +164,7 bool QBarSeries::appendBarSets(QList<QBarSet* > sets)
164 /*!
164 /*!
165 Removes a list of barsets from series. Releases ownership of \a sets. Doesn't delete \a sets.
165 Removes a list of barsets from series. Releases ownership of \a sets. Doesn't delete \a sets.
166 */
166 */
167 bool QBarSeries::removeBarSets(QList<QBarSet* > sets)
167 bool QBarSeries::remove(QList<QBarSet* > sets)
168 {
168 {
169 Q_D(QBarSeries);
169 Q_D(QBarSeries);
170
170
@@ -513,7 +513,7 void QBarSeriesPrivate::initializeDataFromModel()
513 QBarSet* barSet = new QBarSet(m_model->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString());
513 QBarSet* barSet = new QBarSet(m_model->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString());
514 for(int m = m_mapper->first(); m < m_mapper->first() + rowCount; m++)
514 for(int m = m_mapper->first(); m < m_mapper->first() + rowCount; m++)
515 *barSet << m_model->data(m_model->index(m, i), Qt::DisplayRole).toDouble();
515 *barSet << m_model->data(m_model->index(m, i), Qt::DisplayRole).toDouble();
516 q->appendBarSet(barSet);
516 q->append(barSet);
517 }
517 }
518 } else {
518 } else {
519 if (m_mapCategories >= m_model->rowCount())
519 if (m_mapCategories >= m_model->rowCount())
@@ -533,7 +533,7 void QBarSeriesPrivate::initializeDataFromModel()
533 QBarSet* barSet = new QBarSet(m_model->headerData(i, Qt::Vertical, Qt::DisplayRole).toString());
533 QBarSet* barSet = new QBarSet(m_model->headerData(i, Qt::Vertical, Qt::DisplayRole).toString());
534 for(int m = m_mapper->first(); m < m_mapper->first() + columnCount; m++)
534 for(int m = m_mapper->first(); m < m_mapper->first() + columnCount; m++)
535 *barSet << m_model->data(m_model->index(i, m), Qt::DisplayRole).toDouble();
535 *barSet << m_model->data(m_model->index(i, m), Qt::DisplayRole).toDouble();
536 q->appendBarSet(barSet);
536 q->append(barSet);
537 }
537 }
538 }
538 }
539 emit restructuredBars();
539 emit restructuredBars();
@@ -46,10 +46,10 public:
46 QAbstractSeries::SeriesType type() const;
46 QAbstractSeries::SeriesType type() const;
47 void setCategories(QBarCategories categories);
47 void setCategories(QBarCategories categories);
48
48
49 bool appendBarSet(QBarSet *set); // Takes ownership of set
49 bool append(QBarSet *set); // Takes ownership of set
50 bool removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set
50 bool remove(QBarSet *set); // Releases ownership, doesn't delete set
51 bool appendBarSets(QList<QBarSet* > sets);
51 bool append(QList<QBarSet* > sets);
52 bool removeBarSets(QList<QBarSet* > sets);
52 bool remove(QList<QBarSet* > sets);
53 int barsetCount() const;
53 int barsetCount() const;
54 int categoryCount() const;
54 int categoryCount() const;
55 QList<QBarSet*> barSets() const;
55 QList<QBarSet*> barSets() const;
@@ -45,14 +45,14 private slots:
45 void type();
45 void type();
46 void setCategories_data();
46 void setCategories_data();
47 void setCategories();
47 void setCategories();
48 void appendBarSet_data();
48 void append_data();
49 void appendBarSet();
49 void append();
50 void removeBarSet_data();
50 void remove_data();
51 void removeBarSet();
51 void remove();
52 void appendBarSets_data();
52 void appendList_data();
53 void appendBarSets();
53 void appendList();
54 void removeBarSets_data();
54 void removeList_data();
55 void removeBarSets();
55 void removeList();
56 void barsetCount_data();
56 void barsetCount_data();
57 void barsetCount();
57 void barsetCount();
58 void categoryCount_data();
58 void categoryCount_data();
@@ -96,14 +96,14 void tst_QBarSeries::init()
96
96
97 for (int i=0; i<5; i++) {
97 for (int i=0; i<5; i++) {
98 m_testSets.append(new QBarSet("testset"));
98 m_testSets.append(new QBarSet("testset"));
99 m_barseries_with_sets->appendBarSet(m_testSets.at(i));
99 m_barseries_with_sets->append(m_testSets.at(i));
100 }
100 }
101 }
101 }
102
102
103 void tst_QBarSeries::cleanup()
103 void tst_QBarSeries::cleanup()
104 {
104 {
105 foreach(QBarSet* s, m_testSets) {
105 foreach(QBarSet* s, m_testSets) {
106 m_barseries_with_sets->removeBarSet(s);
106 m_barseries_with_sets->remove(s);
107 delete s;
107 delete s;
108 }
108 }
109 m_testSets.clear();
109 m_testSets.clear();
@@ -168,11 +168,11 void tst_QBarSeries::setCategories()
168 }
168 }
169 }
169 }
170
170
171 void tst_QBarSeries::appendBarSet_data()
171 void tst_QBarSeries::append_data()
172 {
172 {
173 }
173 }
174
174
175 void tst_QBarSeries::appendBarSet()
175 void tst_QBarSeries::append()
176 {
176 {
177 QVERIFY(m_barseries->barsetCount() == 0);
177 QVERIFY(m_barseries->barsetCount() == 0);
178
178
@@ -180,56 +180,56 void tst_QBarSeries::appendBarSet()
180
180
181 // Try adding barset
181 // Try adding barset
182 QBarSet *barset = new QBarSet("testset");
182 QBarSet *barset = new QBarSet("testset");
183 ret = m_barseries->appendBarSet(barset);
183 ret = m_barseries->append(barset);
184
184
185 QVERIFY(ret == true);
185 QVERIFY(ret == true);
186 QVERIFY(m_barseries->barsetCount() == 1);
186 QVERIFY(m_barseries->barsetCount() == 1);
187
187
188 // Try adding another set
188 // Try adding another set
189 QBarSet *barset2 = new QBarSet("testset2");
189 QBarSet *barset2 = new QBarSet("testset2");
190 ret = m_barseries->appendBarSet(barset2);
190 ret = m_barseries->append(barset2);
191
191
192 QVERIFY(ret == true);
192 QVERIFY(ret == true);
193 QVERIFY(m_barseries->barsetCount() == 2);
193 QVERIFY(m_barseries->barsetCount() == 2);
194
194
195 // Try adding same set again
195 // Try adding same set again
196 ret = m_barseries->appendBarSet(barset2);
196 ret = m_barseries->append(barset2);
197 QVERIFY(ret == false);
197 QVERIFY(ret == false);
198 QVERIFY(m_barseries->barsetCount() == 2);
198 QVERIFY(m_barseries->barsetCount() == 2);
199
199
200 // Try adding null set
200 // Try adding null set
201 ret = m_barseries->appendBarSet(0);
201 ret = m_barseries->append(0);
202 QVERIFY(ret == false);
202 QVERIFY(ret == false);
203 QVERIFY(m_barseries->barsetCount() == 2);
203 QVERIFY(m_barseries->barsetCount() == 2);
204
204
205 }
205 }
206
206
207 void tst_QBarSeries::removeBarSet_data()
207 void tst_QBarSeries::remove_data()
208 {
208 {
209 }
209 }
210
210
211 void tst_QBarSeries::removeBarSet()
211 void tst_QBarSeries::remove()
212 {
212 {
213 int count = m_testSets.count();
213 int count = m_testSets.count();
214 QVERIFY(m_barseries_with_sets->barsetCount() == count);
214 QVERIFY(m_barseries_with_sets->barsetCount() == count);
215
215
216 // Try to remove null pointer (should not remove, should not crash)
216 // Try to remove null pointer (should not remove, should not crash)
217 bool ret = false;
217 bool ret = false;
218 ret = m_barseries_with_sets->removeBarSet(0);
218 ret = m_barseries_with_sets->remove(0);
219 QVERIFY(ret == false);
219 QVERIFY(ret == false);
220 QVERIFY(m_barseries_with_sets->barsetCount() == count);
220 QVERIFY(m_barseries_with_sets->barsetCount() == count);
221
221
222 // Try to remove invalid pointer (should not remove, should not crash)
222 // Try to remove invalid pointer (should not remove, should not crash)
223 ret = m_barseries_with_sets->removeBarSet((QBarSet*) (m_testSets.at(0) + 1) );
223 ret = m_barseries_with_sets->remove((QBarSet*) (m_testSets.at(0) + 1) );
224 QVERIFY(ret == false);
224 QVERIFY(ret == false);
225 QVERIFY(m_barseries_with_sets->barsetCount() == count);
225 QVERIFY(m_barseries_with_sets->barsetCount() == count);
226
226
227 // remove some sets
227 // remove some sets
228 ret = m_barseries_with_sets->removeBarSet(m_testSets.at(2));
228 ret = m_barseries_with_sets->remove(m_testSets.at(2));
229 QVERIFY(ret == true);
229 QVERIFY(ret == true);
230 ret = m_barseries_with_sets->removeBarSet(m_testSets.at(3));
230 ret = m_barseries_with_sets->remove(m_testSets.at(3));
231 QVERIFY(ret == true);
231 QVERIFY(ret == true);
232 ret = m_barseries_with_sets->removeBarSet(m_testSets.at(4));
232 ret = m_barseries_with_sets->remove(m_testSets.at(4));
233 QVERIFY(ret == true);
233 QVERIFY(ret == true);
234
234
235 QVERIFY(m_barseries_with_sets->barsetCount() == 2);
235 QVERIFY(m_barseries_with_sets->barsetCount() == 2);
@@ -242,19 +242,19 void tst_QBarSeries::removeBarSet()
242 // Try removing all sets again (should be ok, even if some sets have already been removed)
242 // Try removing all sets again (should be ok, even if some sets have already been removed)
243 ret = false;
243 ret = false;
244 for (int i=0; i<count; i++) {
244 for (int i=0; i<count; i++) {
245 ret |= m_barseries_with_sets->removeBarSet(m_testSets.at(i));
245 ret |= m_barseries_with_sets->remove(m_testSets.at(i));
246 }
246 }
247
247
248 QVERIFY(ret == true);
248 QVERIFY(ret == true);
249 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
249 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
250 }
250 }
251
251
252 void tst_QBarSeries::appendBarSets_data()
252 void tst_QBarSeries::appendList_data()
253 {
253 {
254
254
255 }
255 }
256
256
257 void tst_QBarSeries::appendBarSets()
257 void tst_QBarSeries::appendList()
258 {
258 {
259 int count = 5;
259 int count = 5;
260 QVERIFY(m_barseries->barsetCount() == 0);
260 QVERIFY(m_barseries->barsetCount() == 0);
@@ -266,25 +266,25 void tst_QBarSeries::appendBarSets()
266
266
267 // Append new sets (should succeed, count should match the count of sets)
267 // Append new sets (should succeed, count should match the count of sets)
268 bool ret = false;
268 bool ret = false;
269 ret = m_barseries->appendBarSets(sets);
269 ret = m_barseries->append(sets);
270 QVERIFY(ret == true);
270 QVERIFY(ret == true);
271 QVERIFY(m_barseries->barsetCount() == count);
271 QVERIFY(m_barseries->barsetCount() == count);
272
272
273 // Append same sets again (should fail, count should remain same)
273 // Append same sets again (should fail, count should remain same)
274 ret = m_barseries->appendBarSets(sets);
274 ret = m_barseries->append(sets);
275 QVERIFY(ret == false);
275 QVERIFY(ret == false);
276 QVERIFY(m_barseries->barsetCount() == count);
276 QVERIFY(m_barseries->barsetCount() == count);
277
277
278 // Try append empty list (should succeed, but count should remain same)
278 // Try append empty list (should succeed, but count should remain same)
279 QList<QBarSet*> invalidList;
279 QList<QBarSet*> invalidList;
280 ret = m_barseries->appendBarSets(invalidList);
280 ret = m_barseries->append(invalidList);
281 QVERIFY(ret == true);
281 QVERIFY(ret == true);
282 QVERIFY(m_barseries->barsetCount() == count);
282 QVERIFY(m_barseries->barsetCount() == count);
283
283
284 // Try append list with one new and one existing set (should fail, count remains same)
284 // Try append list with one new and one existing set (should fail, count remains same)
285 invalidList.append(new QBarSet("ok set"));
285 invalidList.append(new QBarSet("ok set"));
286 invalidList.append(sets.at(0));
286 invalidList.append(sets.at(0));
287 ret = m_barseries->appendBarSets(invalidList);
287 ret = m_barseries->append(invalidList);
288 QVERIFY(ret == false);
288 QVERIFY(ret == false);
289 QVERIFY(m_barseries->barsetCount() == count);
289 QVERIFY(m_barseries->barsetCount() == count);
290
290
@@ -293,17 +293,17 void tst_QBarSeries::appendBarSets()
293 invalidList2.append(0);
293 invalidList2.append(0);
294 invalidList2.append(0);
294 invalidList2.append(0);
295 invalidList2.append(0);
295 invalidList2.append(0);
296 ret = m_barseries->appendBarSets(invalidList2);
296 ret = m_barseries->append(invalidList2);
297 QVERIFY(ret == false);
297 QVERIFY(ret == false);
298 QVERIFY(m_barseries->barsetCount() == count);
298 QVERIFY(m_barseries->barsetCount() == count);
299 }
299 }
300
300
301 void tst_QBarSeries::removeBarSets_data()
301 void tst_QBarSeries::removeList_data()
302 {
302 {
303
303
304 }
304 }
305
305
306 void tst_QBarSeries::removeBarSets()
306 void tst_QBarSeries::removeList()
307 {
307 {
308 int count = m_testSets.count();
308 int count = m_testSets.count();
309 QVERIFY(m_barseries_with_sets->barsetCount() == count);
309 QVERIFY(m_barseries_with_sets->barsetCount() == count);
@@ -311,7 +311,7 void tst_QBarSeries::removeBarSets()
311 // Try removing empty list of sets (should return false, since no barsets were removed)
311 // Try removing empty list of sets (should return false, since no barsets were removed)
312 bool ret = false;
312 bool ret = false;
313 QList<QBarSet*> invalidList;
313 QList<QBarSet*> invalidList;
314 ret = m_barseries_with_sets->removeBarSets(invalidList);
314 ret = m_barseries_with_sets->remove(invalidList);
315 QVERIFY(ret == false);
315 QVERIFY(ret == false);
316 QVERIFY(m_barseries_with_sets->barsetCount() == count);
316 QVERIFY(m_barseries_with_sets->barsetCount() == count);
317
317
@@ -321,22 +321,22 void tst_QBarSeries::removeBarSets()
321 invalidList.append(0);
321 invalidList.append(0);
322
322
323 // Try removing null pointers from list (should return false, should not crash, should not remove anything)
323 // Try removing null pointers from list (should return false, should not crash, should not remove anything)
324 ret = m_barseries_with_sets->removeBarSets(invalidList);
324 ret = m_barseries_with_sets->remove(invalidList);
325 QVERIFY(ret == false);
325 QVERIFY(ret == false);
326 QVERIFY(m_barseries_with_sets->barsetCount() == count);
326 QVERIFY(m_barseries_with_sets->barsetCount() == count);
327
327
328 // remove all sets (should return true, since sets were removed)
328 // remove all sets (should return true, since sets were removed)
329 ret = m_barseries_with_sets->removeBarSets(m_testSets);
329 ret = m_barseries_with_sets->remove(m_testSets);
330 QVERIFY(ret == true);
330 QVERIFY(ret == true);
331 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
331 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
332
332
333 // Try removing invalid list again (should return false, since no barsets were removed)
333 // Try removing invalid list again (should return false, since no barsets were removed)
334 ret = m_barseries_with_sets->removeBarSets(invalidList);
334 ret = m_barseries_with_sets->remove(invalidList);
335 QVERIFY(ret == false);
335 QVERIFY(ret == false);
336 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
336 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
337
337
338 // remove all sets again (should return false, since barsets were already removed)
338 // remove all sets again (should return false, since barsets were already removed)
339 ret = m_barseries_with_sets->removeBarSets(m_testSets);
339 ret = m_barseries_with_sets->remove(m_testSets);
340 QVERIFY(ret == false);
340 QVERIFY(ret == false);
341 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
341 QVERIFY(m_barseries_with_sets->barsetCount() == 0);
342 }
342 }
@@ -440,11 +440,11 void tst_QBarSeries::mouseclicked()
440
440
441 QBarSet* set1 = new QBarSet(QString("set 1"));
441 QBarSet* set1 = new QBarSet(QString("set 1"));
442 *set1 << QPointF(0,10) << QPointF(1,10) << QPointF(2,10);
442 *set1 << QPointF(0,10) << QPointF(1,10) << QPointF(2,10);
443 series->appendBarSet(set1);
443 series->append(set1);
444
444
445 QBarSet* set2 = new QBarSet(QString("set 2"));
445 QBarSet* set2 = new QBarSet(QString("set 2"));
446 *set2 << QPointF(0.5,10) << QPointF(1.5,10) << QPointF(2.5,10);
446 *set2 << QPointF(0.5,10) << QPointF(1.5,10) << QPointF(2.5,10);
447 series->appendBarSet(set2);
447 series->append(set2);
448
448
449 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
449 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
450 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
450 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
@@ -577,11 +577,11 void tst_QBarSeries::mousehovered()
577
577
578 QBarSet* set1 = new QBarSet(QString("set 1"));
578 QBarSet* set1 = new QBarSet(QString("set 1"));
579 *set1 << QPointF(0.1,10) << QPointF(1.1,10) << QPointF(2.1,10);
579 *set1 << QPointF(0.1,10) << QPointF(1.1,10) << QPointF(2.1,10);
580 series->appendBarSet(set1);
580 series->append(set1);
581
581
582 QBarSet* set2 = new QBarSet(QString("set 2"));
582 QBarSet* set2 = new QBarSet(QString("set 2"));
583 *set2 << QPointF(0.4,10) << QPointF(1.4,10) << QPointF(2.4,10);
583 *set2 << QPointF(0.4,10) << QPointF(1.4,10) << QPointF(2.4,10);
584 series->appendBarSet(set2);
584 series->append(set2);
585
585
586 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
586 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
587 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
587 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
@@ -109,11 +109,11 void tst_QGroupedBarSeries::mouseclicked()
109
109
110 QBarSet* set1 = new QBarSet(QString("set 1"));
110 QBarSet* set1 = new QBarSet(QString("set 1"));
111 *set1 << 10 << 10 << 10;
111 *set1 << 10 << 10 << 10;
112 series->appendBarSet(set1);
112 series->append(set1);
113
113
114 QBarSet* set2 = new QBarSet(QString("set 2"));
114 QBarSet* set2 = new QBarSet(QString("set 2"));
115 *set2 << 10 << 10 << 10;
115 *set2 << 10 << 10 << 10;
116 series->appendBarSet(set2);
116 series->append(set2);
117
117
118 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
118 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
119 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
119 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
@@ -246,11 +246,11 void tst_QGroupedBarSeries::mousehovered()
246
246
247 QBarSet* set1 = new QBarSet(QString("set 1"));
247 QBarSet* set1 = new QBarSet(QString("set 1"));
248 *set1 << 10 << 10 << 10;
248 *set1 << 10 << 10 << 10;
249 series->appendBarSet(set1);
249 series->append(set1);
250
250
251 QBarSet* set2 = new QBarSet(QString("set 2"));
251 QBarSet* set2 = new QBarSet(QString("set 2"));
252 *set2 << 10 << 10 << 10;
252 *set2 << 10 << 10 << 10;
253 series->appendBarSet(set2);
253 series->append(set2);
254
254
255 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
255 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
256 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
256 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
@@ -106,11 +106,11 void tst_QPercentBarSeries::mouseclicked()
106
106
107 QBarSet* set1 = new QBarSet(QString("set 1"));
107 QBarSet* set1 = new QBarSet(QString("set 1"));
108 *set1 << 10 << 10 << 10;
108 *set1 << 10 << 10 << 10;
109 series->appendBarSet(set1);
109 series->append(set1);
110
110
111 QBarSet* set2 = new QBarSet(QString("set 2"));
111 QBarSet* set2 = new QBarSet(QString("set 2"));
112 *set2 << 10 << 10 << 10;
112 *set2 << 10 << 10 << 10;
113 series->appendBarSet(set2);
113 series->append(set2);
114
114
115 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
115 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
116 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
116 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
@@ -243,11 +243,11 void tst_QPercentBarSeries::mousehovered()
243
243
244 QBarSet* set1 = new QBarSet(QString("set 1"));
244 QBarSet* set1 = new QBarSet(QString("set 1"));
245 *set1 << 10 << 10 << 10;
245 *set1 << 10 << 10 << 10;
246 series->appendBarSet(set1);
246 series->append(set1);
247
247
248 QBarSet* set2 = new QBarSet(QString("set 2"));
248 QBarSet* set2 = new QBarSet(QString("set 2"));
249 *set2 << 10 << 10 << 10;
249 *set2 << 10 << 10 << 10;
250 series->appendBarSet(set2);
250 series->append(set2);
251
251
252 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
252 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
253 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
253 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
@@ -106,11 +106,11 void tst_QStackedBarSeries::mouseclicked()
106
106
107 QBarSet* set1 = new QBarSet(QString("set 1"));
107 QBarSet* set1 = new QBarSet(QString("set 1"));
108 *set1 << 10 << 10 << 10;
108 *set1 << 10 << 10 << 10;
109 series->appendBarSet(set1);
109 series->append(set1);
110
110
111 QBarSet* set2 = new QBarSet(QString("set 2"));
111 QBarSet* set2 = new QBarSet(QString("set 2"));
112 *set2 << 10 << 10 << 10;
112 *set2 << 10 << 10 << 10;
113 series->appendBarSet(set2);
113 series->append(set2);
114
114
115 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
115 QSignalSpy setSpy1(set1, SIGNAL(clicked(QString)));
116 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
116 QSignalSpy setSpy2(set2, SIGNAL(clicked(QString)));
@@ -243,11 +243,11 void tst_QStackedBarSeries::mousehovered()
243
243
244 QBarSet* set1 = new QBarSet(QString("set 1"));
244 QBarSet* set1 = new QBarSet(QString("set 1"));
245 *set1 << 10 << 10 << 10;
245 *set1 << 10 << 10 << 10;
246 series->appendBarSet(set1);
246 series->append(set1);
247
247
248 QBarSet* set2 = new QBarSet(QString("set 2"));
248 QBarSet* set2 = new QBarSet(QString("set 2"));
249 *set2 << 10 << 10 << 10;
249 *set2 << 10 << 10 << 10;
250 series->appendBarSet(set2);
250 series->append(set2);
251
251
252 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
252 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
253 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
253 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
@@ -288,7 +288,7 void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QS
288 QBarSet *set = new QBarSet("set" + QString::number(j));
288 QBarSet *set = new QBarSet("set" + QString::number(j));
289 for (int i(0); i < column.count(); i++)
289 for (int i(0); i < column.count(); i++)
290 *set << column.at(i);
290 *set << column.at(i);
291 series->appendBarSet(set);
291 series->append(set);
292 }
292 }
293
293
294 m_chart->addSeries(series);
294 m_chart->addSeries(series);
@@ -183,7 +183,7 void Widget::refreshChart()
183 qDebug() << "Putting 0 for the missing data" << " : " << QString("%1").arg(selectedYearsInts[i]);
183 qDebug() << "Putting 0 for the missing data" << " : " << QString("%1").arg(selectedYearsInts[i]);
184 }
184 }
185 }
185 }
186 series0->appendBarSet(barSet);
186 series0->append(barSet);
187 }
187 }
188 // add the serie to the chart
188 // add the serie to the chart
189 chartView->chart()->addSeries(series0);
189 chartView->chart()->addSeries(series0);
General Comments 0
You need to be logged in to leave comments. Login now