##// END OF EJS Templates
Fixes chart presenter crash on exit
Michal Klocek -
r981:dc6e36e81b8a
parent child
Show More
@@ -33,18 +33,18 m_index(-1),m_chart(chart)
33 m_timer.setInterval(3000);
33 m_timer.setInterval(3000);
34
34
35 //![1]
35 //![1]
36 QLineSeries* series0 = new QLineSeries(this);
36 QLineSeries* series0 = new QLineSeries();
37 QPen blue(Qt::blue);
37 QPen blue(Qt::blue);
38 blue.setWidth(3);
38 blue.setWidth(3);
39 series0->setPen(blue);
39 series0->setPen(blue);
40
40
41 QScatterSeries* series1 = new QScatterSeries(this);
41 QScatterSeries* series1 = new QScatterSeries();
42 QPen red(Qt::red);
42 QPen red(Qt::red);
43 red.setWidth(3);
43 red.setWidth(3);
44 series1->setPen(red);
44 series1->setPen(red);
45 series1->setBrush(Qt::white);
45 series1->setBrush(Qt::white);
46
46
47 QSplineSeries* series2 = new QSplineSeries(this);
47 QSplineSeries* series2 = new QSplineSeries();
48 QPen green(Qt::green);
48 QPen green(Qt::green);
49 green.setWidth(3);
49 green.setWidth(3);
50 series2->setPen(green);
50 series2->setPen(green);
@@ -91,6 +91,7 ChartView::~ChartView()
91 {
91 {
92 if(m_series.size()==0) return;
92 if(m_series.size()==0) return;
93 m_chart->removeSeries(m_series.at(m_index));
93 m_chart->removeSeries(m_series.at(m_index));
94 m_series.removeLast(); //remove QAreaSeries instance since they will be deleted when QLineSeries instance is gone
94 qDeleteAll(m_series);
95 qDeleteAll(m_series);
95 }
96 }
96
97
General Comments 0
You need to be logged in to leave comments. Login now