@@ -285,9 +285,9 public: | |||
|
285 | 285 | m_slice(0) |
|
286 | 286 | { |
|
287 | 287 | // create chart |
|
288 |
m_chartView = |
|
|
289 |
m_chartView-> |
|
|
290 | m_chartView->setAnimationOptions(QChart::AllAnimations); | |
|
288 | m_chartView = new QChartView(new QChart()); | |
|
289 | m_chartView->chart()->setTitle("Piechart customization"); | |
|
290 | m_chartView->chart()->setAnimationOptions(QChart::AllAnimations); | |
|
291 | 291 | |
|
292 | 292 | // create series |
|
293 | 293 | m_series = new QPieSeries(); |
@@ -297,7 +297,7 public: | |||
|
297 | 297 | *m_series << new CustomSlice(40.0, "Slice 4"); |
|
298 | 298 | *m_series << new CustomSlice(50.0, "Slice 5"); |
|
299 | 299 | m_series->setLabelsVisible(); |
|
300 | m_chartView->addSeries(m_series); | |
|
300 | m_chartView->chart()->addSeries(m_series); | |
|
301 | 301 | |
|
302 | 302 | connect(m_series, SIGNAL(clicked(QPieSlice*, Qt::MouseButtons)), this, SLOT(handleSliceClicked(QPieSlice*, Qt::MouseButtons))); |
|
303 | 303 | |
@@ -449,13 +449,13 public Q_SLOTS: | |||
|
449 | 449 | void updateChartSettings() |
|
450 | 450 | { |
|
451 | 451 | QChart::ChartTheme theme = (QChart::ChartTheme) m_themeComboBox->itemData(m_themeComboBox->currentIndex()).toInt(); |
|
452 |
m_chartView-> |
|
|
452 | m_chartView->chart()->setTheme(theme); | |
|
453 | 453 | m_chartView->setRenderHint(QPainter::Antialiasing, m_aaCheckBox->isChecked()); |
|
454 | 454 | |
|
455 | 455 | if (m_animationsCheckBox->checkState() == Qt::Checked) |
|
456 | m_chartView->setAnimationOptions(QChart::AllAnimations); | |
|
456 | m_chartView->chart()->setAnimationOptions(QChart::AllAnimations); | |
|
457 | 457 | else |
|
458 | m_chartView->setAnimationOptions(QChart::NoAnimation); | |
|
458 | m_chartView->chart()->setAnimationOptions(QChart::NoAnimation); | |
|
459 | 459 | } |
|
460 | 460 | |
|
461 | 461 | void updateSerieSettings() |
General Comments 0
You need to be logged in to leave comments.
Login now