diff --git a/src/areachart/qareaseries.cpp b/src/areachart/qareaseries.cpp index 3d291c6..479d88f 100644 --- a/src/areachart/qareaseries.cpp +++ b/src/areachart/qareaseries.cpp @@ -175,6 +175,10 @@ QAreaSeries::QAreaSeries(QObject *parent) */ QAreaSeries::~QAreaSeries() { + Q_D(QAreaSeries); + if(d->m_dataset){ + d->m_dataset->removeSeries(this); + } } /*! diff --git a/src/barchart/horizontal/bar/qhorizontalbarseries.cpp b/src/barchart/horizontal/bar/qhorizontalbarseries.cpp index f4cb015..2e5a68f 100644 --- a/src/barchart/horizontal/bar/qhorizontalbarseries.cpp +++ b/src/barchart/horizontal/bar/qhorizontalbarseries.cpp @@ -64,6 +64,14 @@ QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent) : { } +QHorizontalBarSeries::~QHorizontalBarSeries() +{ + Q_D(QHorizontalBarSeries); + if(d->m_dataset) { + d->m_dataset->removeSeries(this); + } +} + QAbstractSeries::SeriesType QHorizontalBarSeries::type() const { return QAbstractSeries::SeriesTypeHorizontalBar; diff --git a/src/barchart/horizontal/bar/qhorizontalbarseries.h b/src/barchart/horizontal/bar/qhorizontalbarseries.h index 7edcb2f..64fe387 100644 --- a/src/barchart/horizontal/bar/qhorizontalbarseries.h +++ b/src/barchart/horizontal/bar/qhorizontalbarseries.h @@ -32,6 +32,7 @@ class QTCOMMERCIALCHART_EXPORT QHorizontalBarSeries : public QAbstractBarSeries Q_OBJECT public: explicit QHorizontalBarSeries(QObject *parent = 0); + ~QHorizontalBarSeries(); QAbstractSeries::SeriesType type() const; private: diff --git a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp index ce247e0..489502a 100644 --- a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp +++ b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp @@ -18,7 +18,13 @@ QAbstractSeries::SeriesType QHorizontalPercentBarSeries::type() const return QAbstractSeries::SeriesTypeHorizontalPercentBar; } - +QHorizontalPercentBarSeries::~QHorizontalPercentBarSeries() +{ + Q_D(QHorizontalPercentBarSeries); + if(d->m_dataset) { + d->m_dataset->removeSeries(this); + } +} /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h index eaa1ebd..778dc83 100644 --- a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h +++ b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h @@ -32,6 +32,7 @@ class QTCOMMERCIALCHART_EXPORT QHorizontalPercentBarSeries : public QAbstractBar Q_OBJECT public: explicit QHorizontalPercentBarSeries(QObject *parent = 0); + ~QHorizontalPercentBarSeries(); QAbstractSeries::SeriesType type() const; private: diff --git a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp index b7cadc3..7bd1dce 100644 --- a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp +++ b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp @@ -13,13 +13,19 @@ QHorizontalStackedBarSeries::QHorizontalStackedBarSeries(QObject *parent) : { } +QHorizontalStackedBarSeries::~QHorizontalStackedBarSeries() +{ + Q_D(QHorizontalStackedBarSeries); + if(d->m_dataset) { + d->m_dataset->removeSeries(this); + } +} + QAbstractSeries::SeriesType QHorizontalStackedBarSeries::type() const { return QAbstractSeries::SeriesTypeHorizontalStackedBar; } - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QHorizontalStackedBarSeriesPrivate::QHorizontalStackedBarSeriesPrivate(QHorizontalStackedBarSeries *q) : QAbstractBarSeriesPrivate(q) diff --git a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h index c63ef68..b980b6f 100644 --- a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h +++ b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h @@ -32,6 +32,7 @@ class QTCOMMERCIALCHART_EXPORT QHorizontalStackedBarSeries : public QAbstractBar Q_OBJECT public: explicit QHorizontalStackedBarSeries(QObject *parent = 0); + ~QHorizontalStackedBarSeries(); QAbstractSeries::SeriesType type() const; private: diff --git a/src/barchart/vertical/bar/qbarseries.cpp b/src/barchart/vertical/bar/qbarseries.cpp index cfb4d6d..82b8159 100644 --- a/src/barchart/vertical/bar/qbarseries.cpp +++ b/src/barchart/vertical/bar/qbarseries.cpp @@ -73,13 +73,12 @@ QAbstractSeries::SeriesType QBarSeries::type() const return QAbstractSeries::SeriesTypeBar; } -QBarSeries::~QBarSeries() { - +QBarSeries::~QBarSeries() +{ Q_D(QBarSeries); if(d->m_dataset) { d->m_dataset->removeSeries(this); } - } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/barchart/vertical/percent/qpercentbarseries.cpp b/src/barchart/vertical/percent/qpercentbarseries.cpp index 398778b..5e6ce59 100644 --- a/src/barchart/vertical/percent/qpercentbarseries.cpp +++ b/src/barchart/vertical/percent/qpercentbarseries.cpp @@ -64,6 +64,14 @@ QPercentBarSeries::QPercentBarSeries(QObject *parent) { } +QPercentBarSeries::~QPercentBarSeries() +{ + Q_D(QPercentBarSeries); + if(d->m_dataset) { + d->m_dataset->removeSeries(this); + } +} + /*! Returns QChartSeries::SeriesTypePercentBar. */ diff --git a/src/barchart/vertical/percent/qpercentbarseries.h b/src/barchart/vertical/percent/qpercentbarseries.h index 1045c7a..904ce8e 100644 --- a/src/barchart/vertical/percent/qpercentbarseries.h +++ b/src/barchart/vertical/percent/qpercentbarseries.h @@ -33,6 +33,7 @@ class QTCOMMERCIALCHART_EXPORT QPercentBarSeries : public QAbstractBarSeries Q_OBJECT public: explicit QPercentBarSeries(QObject *parent = 0); + ~QPercentBarSeries(); QAbstractSeries::SeriesType type() const; private: diff --git a/src/barchart/vertical/stacked/qstackedbarseries.cpp b/src/barchart/vertical/stacked/qstackedbarseries.cpp index 28290a0..1e9e417 100644 --- a/src/barchart/vertical/stacked/qstackedbarseries.cpp +++ b/src/barchart/vertical/stacked/qstackedbarseries.cpp @@ -65,6 +65,13 @@ QStackedBarSeries::QStackedBarSeries(QObject *parent) { } +QStackedBarSeries::~QStackedBarSeries() +{ + Q_D(QStackedBarSeries); + if(d->m_dataset) { + d->m_dataset->removeSeries(this); + } +} /*! Returns QChartSeries::SeriesTypeStackedBar. */ diff --git a/src/barchart/vertical/stacked/qstackedbarseries.h b/src/barchart/vertical/stacked/qstackedbarseries.h index b5fae6c..b700a74 100644 --- a/src/barchart/vertical/stacked/qstackedbarseries.h +++ b/src/barchart/vertical/stacked/qstackedbarseries.h @@ -33,6 +33,7 @@ class QTCOMMERCIALCHART_EXPORT QStackedBarSeries : public QAbstractBarSeries Q_OBJECT public: explicit QStackedBarSeries(QObject *parent = 0); + ~QStackedBarSeries(); QAbstractSeries::SeriesType type() const; private: