From d1edc6bf68dac82d98a5b621e6077e9bd9d14126 2012-04-03 07:31:42 From: Jani Honkonen Date: 2012-04-03 07:31:42 Subject: [PATCH] Make scatterinteractions compile --- diff --git a/examples/examples.pro b/examples/examples.pro index 8f41a7f..d377a04 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -13,7 +13,7 @@ SUBDIRS += \ piechartdrilldown \ #presenterchart \ scatterchart \ - #scatterinteractions \ + scatterinteractions \ #splinechart \ stackedbarchart \ stackedbarchartdrilldown \ diff --git a/examples/scatterinteractions/mainwindow.cpp b/examples/scatterinteractions/mainwindow.cpp index 90beab6..eefdfe7 100644 --- a/examples/scatterinteractions/mainwindow.cpp +++ b/examples/scatterinteractions/mainwindow.cpp @@ -19,20 +19,15 @@ ****************************************************************************/ #include "mainwindow.h" -#include -#include -#include -#include +#include QTCOMMERCIALCHART_USE_NAMESPACE MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { - QChartView *chartView = new QChartView(this); - chartView->setChartTitle("Click to remove scatter point"); - chartView->setRenderHint(QPainter::Antialiasing); - setCentralWidget(chartView); + QChart *chart = new QChart(); + chart->setTitle("Click to remove scatter point"); m_scatter = new QScatterSeries(); for(qreal x(0.5); x <= 4.0; x += 0.5) { @@ -41,11 +36,15 @@ MainWindow::MainWindow(QWidget *parent) } } - chartView->addSeries(m_scatter); - chartView->axisX()->setRange(0,4.5); - chartView->axisY()->setRange(0,4.5); + chart->addSeries(m_scatter); + chart->axisX()->setRange(0, 4.5); + chart->axisY()->setRange(0, 4.5); connect(m_scatter, SIGNAL(clicked(const QPointF&)), this, SLOT(handleClickedPoint(const QPointF&))); + + QChartView *chartView = new QChartView(chart); + chartView->setRenderHint(QPainter::Antialiasing); + setCentralWidget(chartView); } MainWindow::~MainWindow()