From 2c85b9e659bd567068cdabaee8a4ce57f729ee06 2012-03-29 12:30:34 From: Jani Honkonen Date: 2012-03-29 12:30:34 Subject: [PATCH] make piechartdrilldown compile again --- diff --git a/examples/examples.pro b/examples/examples.pro index 9906c48..e115fb6 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -11,7 +11,7 @@ SUBDIRS += \ #multichart \ percentbarchart \ piechart \ - #piechartdrilldown \ + piechartdrilldown \ #presenterchart \ scatterchart \ #scatterinteractions \ diff --git a/examples/piechartdrilldown/main.cpp b/examples/piechartdrilldown/main.cpp index ac10c17..2f12274 100644 --- a/examples/piechartdrilldown/main.cpp +++ b/examples/piechartdrilldown/main.cpp @@ -39,11 +39,11 @@ private: QString m_prefix; }; -class DrilldownChart : public QChartView +class DrilldownChart : public QChart { Q_OBJECT public: - explicit DrilldownChart(QWidget *parent = 0):QChartView(parent), m_currentSeries(0) {} + explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0):QChart(parent, wFlags), m_currentSeries(0) {} void changeSeries(QSeries* series) { @@ -53,7 +53,7 @@ public: removeSeries(m_currentSeries); m_currentSeries = series; addSeries(series); - setChartTitle(series->name()); + setTitle(series->name()); } public Q_SLOTS: @@ -75,9 +75,8 @@ int main(int argc, char *argv[]) QMainWindow window; - DrilldownChart* drilldownChart = new DrilldownChart(&window); - drilldownChart->setRenderHint(QPainter::Antialiasing); - drilldownChart->setChartTheme(QChart::ChartThemeLight); + DrilldownChart* drilldownChart = new DrilldownChart(); + drilldownChart->setTheme(QChart::ChartThemeLight); drilldownChart->setAnimationOptions(QChart::AllAnimations); QPieSeries* yearSeries = new QPieSeries(&window); @@ -104,7 +103,9 @@ int main(int argc, char *argv[]) drilldownChart->changeSeries(yearSeries); - window.setCentralWidget(drilldownChart); + QChartView* chartView = new QChartView(drilldownChart); + chartView->setRenderHint(QPainter::Antialiasing); + window.setCentralWidget(chartView); window.resize(800, 600); window.show();