From e5d6ed20234dbaa01a555ea127582f89f2d342cd 2012-06-05 07:46:38 From: sauimone Date: 2012-06-05 07:46:38 Subject: [PATCH] fixed crash in legend example --- diff --git a/examples/legend/mainwidget.cpp b/examples/legend/mainwidget.cpp index c6278aa..f9c2d0b 100644 --- a/examples/legend/mainwidget.cpp +++ b/examples/legend/mainwidget.cpp @@ -54,7 +54,6 @@ MainWidget::MainWidget(QWidget *parent) : m_chart = new QChart(); m_chartView = new QChartView(m_chart, this); m_chartView->setRubberBand(QChartView::HorizonalRubberBand); - m_chart->setAnimationOptions(QChart::SeriesAnimations); //![1] // Create custom scene and view, where detached legend will be drawn @@ -143,9 +142,8 @@ void MainWidget::addBarset() void MainWidget::removeBarset() { - m_series->clear(); -// QList sets = m_series->barSets(); -// if (sets.count() > 0) { -// m_series->remove(sets.at(sets.count()-1)); -// } + QList sets = m_series->barSets(); + if (sets.count() > 0) { + m_series->remove(sets.at(sets.count()-1)); + } }