diff --git a/examples/piechartdrilldown/drilldownchart.cpp b/examples/piechartdrilldown/drilldownchart.cpp index 3c20b3f..b594584 100644 --- a/examples/piechartdrilldown/drilldownchart.cpp +++ b/examples/piechartdrilldown/drilldownchart.cpp @@ -34,7 +34,7 @@ DrilldownChart::~DrilldownChart() } -void DrilldownChart::changeSeries(QSeries* series) +void DrilldownChart::changeSeries(QAbstractSeries* series) { // NOTE: if the series is owned by the chart it will be deleted // here the "window" owns the series... diff --git a/examples/piechartdrilldown/drilldownchart.h b/examples/piechartdrilldown/drilldownchart.h index b6c7186..5cadc3e 100644 --- a/examples/piechartdrilldown/drilldownchart.h +++ b/examples/piechartdrilldown/drilldownchart.h @@ -23,7 +23,7 @@ #include QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QSeries; +class QAbstractSeries; class QPieSlice; QTCOMMERCIALCHART_END_NAMESPACE @@ -35,13 +35,13 @@ class DrilldownChart : public QChart public: explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); ~DrilldownChart(); - void changeSeries(QSeries* series); + void changeSeries(QAbstractSeries* series); public Q_SLOTS: void handleSliceClicked(QPieSlice* slice); private: - QSeries* m_currentSeries; + QAbstractSeries* m_currentSeries; }; #endif // DRILLDOWNCHART_H diff --git a/examples/piechartdrilldown/drilldownslice.cpp b/examples/piechartdrilldown/drilldownslice.cpp index bd7bb7e..d6d2ac1 100644 --- a/examples/piechartdrilldown/drilldownslice.cpp +++ b/examples/piechartdrilldown/drilldownslice.cpp @@ -22,7 +22,7 @@ QTCOMMERCIALCHART_USE_NAMESPACE -DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QSeries* drilldownSeries) +DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QAbstractSeries* drilldownSeries) :m_drilldownSeries(drilldownSeries), m_prefix(prefix) { @@ -39,7 +39,7 @@ DrilldownSlice::~DrilldownSlice() } -QSeries* DrilldownSlice::drilldownSeries() const +QAbstractSeries* DrilldownSlice::drilldownSeries() const { return m_drilldownSeries; } diff --git a/examples/piechartdrilldown/drilldownslice.h b/examples/piechartdrilldown/drilldownslice.h index e01e50c..92d4e4c 100644 --- a/examples/piechartdrilldown/drilldownslice.h +++ b/examples/piechartdrilldown/drilldownslice.h @@ -23,7 +23,7 @@ #include QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QSeries; +class QAbstractSeries; QTCOMMERCIALCHART_END_NAMESPACE QTCOMMERCIALCHART_USE_NAMESPACE @@ -33,9 +33,9 @@ class DrilldownSlice : public QPieSlice Q_OBJECT public: - DrilldownSlice(qreal value, QString prefix, QSeries* drilldownSeries); + DrilldownSlice(qreal value, QString prefix, QAbstractSeries* drilldownSeries); virtual ~DrilldownSlice(); - QSeries* drilldownSeries() const; + QAbstractSeries* drilldownSeries() const; public Q_SLOTS: void updateLabel(); @@ -43,7 +43,7 @@ public Q_SLOTS: void hideHighlight(); private: - QSeries* m_drilldownSeries; + QAbstractSeries* m_drilldownSeries; QString m_prefix; }; diff --git a/examples/presenterchart/chartview.cpp b/examples/presenterchart/chartview.cpp index 56224df..697993b 100644 --- a/examples/presenterchart/chartview.cpp +++ b/examples/presenterchart/chartview.cpp @@ -79,7 +79,7 @@ m_index(-1),m_chart(chart) //![3] //![4] - foreach (QSeries* series, m_series) { + foreach (QAbstractSeries* series, m_series) { QObject::connect(series,SIGNAL(clicked(QPointF)),this,SLOT(handlePointClicked(QPointF))); } //![4] diff --git a/examples/presenterchart/chartview.h b/examples/presenterchart/chartview.h index be979cc..0e032a3 100644 --- a/examples/presenterchart/chartview.h +++ b/examples/presenterchart/chartview.h @@ -40,7 +40,7 @@ public slots: private: QTimer m_timer; - QList m_series; + QList m_series; QStringList m_titles; int m_index; QChart *m_chart; diff --git a/examples/stackedbarchartdrilldown/drilldownchart.cpp b/examples/stackedbarchartdrilldown/drilldownchart.cpp index 1a7aba5..90e75d3 100644 --- a/examples/stackedbarchartdrilldown/drilldownchart.cpp +++ b/examples/stackedbarchartdrilldown/drilldownchart.cpp @@ -29,7 +29,7 @@ DrilldownChart::DrilldownChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) { } -void DrilldownChart::changeSeries(QSeries* series) +void DrilldownChart::changeSeries(QAbstractSeries *series) { if (m_currentSeries) removeSeries(m_currentSeries); diff --git a/examples/stackedbarchartdrilldown/drilldownchart.h b/examples/stackedbarchartdrilldown/drilldownchart.h index fe3b772..7a84f96 100644 --- a/examples/stackedbarchartdrilldown/drilldownchart.h +++ b/examples/stackedbarchartdrilldown/drilldownchart.h @@ -33,13 +33,13 @@ class DrilldownChart : public QChart public: explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); - void changeSeries(QSeries* series); + void changeSeries(QAbstractSeries *series); public Q_SLOTS: void handleClicked(QBarSet *barset, QString category, Qt::MouseButtons button); private: - QSeries* m_currentSeries; + QAbstractSeries* m_currentSeries; }; //! [2] diff --git a/qmlplugin/declarativeareaseries.cpp b/qmlplugin/declarativeareaseries.cpp index 2144b48..68edbcd 100644 --- a/qmlplugin/declarativeareaseries.cpp +++ b/qmlplugin/declarativeareaseries.cpp @@ -30,7 +30,7 @@ DeclarativeAreaSeries::DeclarativeAreaSeries(QObject *parent) : { } -QSeries *DeclarativeAreaSeries::series() +QAbstractSeries *DeclarativeAreaSeries::series() { return this; } diff --git a/qmlplugin/declarativeareaseries.h b/qmlplugin/declarativeareaseries.h index 440a252..a9428f4 100644 --- a/qmlplugin/declarativeareaseries.h +++ b/qmlplugin/declarativeareaseries.h @@ -37,7 +37,7 @@ public: explicit DeclarativeAreaSeries(QObject *parent = 0); public: - QSeries *series(); + QAbstractSeries *series(); QDeclarativeListProperty points(); QDeclarativeListProperty lowerPoints(); diff --git a/qmlplugin/declarativelineseries.cpp b/qmlplugin/declarativelineseries.cpp index 8d50d8f..9c5934c 100644 --- a/qmlplugin/declarativelineseries.cpp +++ b/qmlplugin/declarativelineseries.cpp @@ -30,7 +30,7 @@ DeclarativeLineSeries::DeclarativeLineSeries(QObject *parent) : { } -QSeries *DeclarativeLineSeries::series() +QAbstractSeries *DeclarativeLineSeries::series() { return this; } diff --git a/qmlplugin/declarativelineseries.h b/qmlplugin/declarativelineseries.h index 056d918..2b50631 100644 --- a/qmlplugin/declarativelineseries.h +++ b/qmlplugin/declarativelineseries.h @@ -37,7 +37,7 @@ public: explicit DeclarativeLineSeries(QObject *parent = 0); public: - QSeries *series(); + QAbstractSeries *series(); QDeclarativeListProperty points(); }; diff --git a/qmlplugin/declarativescatterseries.cpp b/qmlplugin/declarativescatterseries.cpp index ea7419c..0376631 100644 --- a/qmlplugin/declarativescatterseries.cpp +++ b/qmlplugin/declarativescatterseries.cpp @@ -30,7 +30,7 @@ DeclarativeScatterSeries::DeclarativeScatterSeries(QObject *parent) : { } -QSeries *DeclarativeScatterSeries::series() +QAbstractSeries *DeclarativeScatterSeries::series() { return this; } diff --git a/qmlplugin/declarativescatterseries.h b/qmlplugin/declarativescatterseries.h index d0fe8cb..7471052 100644 --- a/qmlplugin/declarativescatterseries.h +++ b/qmlplugin/declarativescatterseries.h @@ -37,7 +37,7 @@ public: explicit DeclarativeScatterSeries(QObject *parent = 0); public: - QSeries *series(); + QAbstractSeries *series(); QDeclarativeListProperty points(); }; diff --git a/qmlplugin/declarativesplineseries.cpp b/qmlplugin/declarativesplineseries.cpp index b81f459..41648f2 100644 --- a/qmlplugin/declarativesplineseries.cpp +++ b/qmlplugin/declarativesplineseries.cpp @@ -29,7 +29,7 @@ DeclarativeSplineSeries::DeclarativeSplineSeries(QObject *parent) : { } -QSeries *DeclarativeSplineSeries::series() +QAbstractSeries *DeclarativeSplineSeries::series() { return this; } diff --git a/qmlplugin/declarativesplineseries.h b/qmlplugin/declarativesplineseries.h index 8fe90d6..344ff27 100644 --- a/qmlplugin/declarativesplineseries.h +++ b/qmlplugin/declarativesplineseries.h @@ -37,7 +37,7 @@ public: explicit DeclarativeSplineSeries(QObject *parent = 0); public: - QSeries *series(); + QAbstractSeries *series(); QDeclarativeListProperty points(); }; diff --git a/qmlplugin/declarativexyseries.cpp b/qmlplugin/declarativexyseries.cpp index 55c16b2..92d5839 100644 --- a/qmlplugin/declarativexyseries.cpp +++ b/qmlplugin/declarativexyseries.cpp @@ -39,7 +39,7 @@ void DeclarativeXySeries::classBegin() void DeclarativeXySeries::componentComplete() { - QSeries *thisObj = reinterpret_cast(series()); + QAbstractSeries *thisObj = reinterpret_cast(series()); DeclarativeChart *declarativeChart = qobject_cast(thisObj->parent()); if (declarativeChart) { diff --git a/qmlplugin/declarativexyseries.h b/qmlplugin/declarativexyseries.h index 54c7068..b9174e2 100644 --- a/qmlplugin/declarativexyseries.h +++ b/qmlplugin/declarativexyseries.h @@ -29,7 +29,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QChart; -class QSeries; +class QAbstractSeries; class DeclarativeXySeries : public QDeclarativeParserStatus { @@ -44,7 +44,7 @@ public: // from QDeclarativeParserStatus virtual void componentComplete(); public: - virtual QSeries *series() = 0; + virtual QAbstractSeries *series() = 0; virtual QDeclarativeListProperty points() = 0; public Q_SLOTS: diff --git a/src/areachart/qareaseries.cpp b/src/areachart/qareaseries.cpp index 4c03618..4ba613a 100644 --- a/src/areachart/qareaseries.cpp +++ b/src/areachart/qareaseries.cpp @@ -58,7 +58,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \fn virtual QSeriesType QAreaSeries::type() const \brief Returns type of series. - \sa QSeries, QSeriesType + \sa QAbstractSeries, QSeriesType */ /*! @@ -113,7 +113,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE When series object is added to QChartView or QChart instance ownerships is transferred. */ QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries) - : QSeries(*new QAreaSeriesPrivate(upperSeries,lowerSeries,this),upperSeries) + : QAbstractSeries(*new QAreaSeriesPrivate(upperSeries,lowerSeries,this),upperSeries) { } @@ -126,9 +126,9 @@ QAreaSeries::~QAreaSeries() } -QSeries::QSeriesType QAreaSeries::type() const +QAbstractSeries::QSeriesType QAreaSeries::type() const { - return QSeries::SeriesTypeArea; + return QAbstractSeries::SeriesTypeArea; } QLineSeries* QAreaSeries::upperSeries() const @@ -211,7 +211,7 @@ QAbstractItemModel* QAreaSeries::model() const //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QAreaSeriesPrivate::QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries,QAreaSeries* q) : - QSeriesPrivate(q), + QAbstractSeriesPrivate(q), m_upperSeries(upperSeries), m_lowerSeries(lowerSeries), m_pointsVisible(false) diff --git a/src/areachart/qareaseries.h b/src/areachart/qareaseries.h index f2cc6cd..daa49c6 100644 --- a/src/areachart/qareaseries.h +++ b/src/areachart/qareaseries.h @@ -22,7 +22,7 @@ #define QAREASERIES_H #include -#include +#include #include #include @@ -30,7 +30,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QLineSeries; class QAreaSeriesPrivate; -class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QSeries +class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QAbstractSeries { Q_OBJECT public: @@ -38,7 +38,7 @@ public: ~QAreaSeries(); public: - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; QLineSeries* upperSeries() const; QLineSeries* lowerSeries() const; diff --git a/src/areachart/qareaseries_p.h b/src/areachart/qareaseries_p.h index 56e3c95..0aa2a28 100644 --- a/src/areachart/qareaseries_p.h +++ b/src/areachart/qareaseries_p.h @@ -30,13 +30,13 @@ #ifndef QAREASERIES_P_H #define QAREASERIES_P_H -#include "qseries_p.h" +#include "qabstractseries_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE class QAreaSeries; -class QAreaSeriesPrivate: public QSeriesPrivate +class QAreaSeriesPrivate: public QAbstractSeriesPrivate { Q_OBJECT diff --git a/src/barchart/barchartmodel_p.h b/src/barchart/barchartmodel_p.h index c229d78..74454dc 100644 --- a/src/barchart/barchartmodel_p.h +++ b/src/barchart/barchartmodel_p.h @@ -24,7 +24,7 @@ #include #include #include "qchartglobal.h" -#include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/barchart/qbarseries.cpp b/src/barchart/qbarseries.cpp index 7d6da42..c96221f 100644 --- a/src/barchart/qbarseries.cpp +++ b/src/barchart/qbarseries.cpp @@ -74,7 +74,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE QBarSeries is QObject which is a child of a \a parent. */ QBarSeries::QBarSeries(QBarCategories categories, QObject *parent) : - QSeries(*new QBarSeriesPrivate(categories, this),parent) + QAbstractSeries(*new QBarSeriesPrivate(categories, this),parent) { } @@ -90,16 +90,16 @@ QBarSeries::~QBarSeries() \internal */ QBarSeries::QBarSeries(QBarSeriesPrivate &d, QObject *parent) : - QSeries(d,parent) + QAbstractSeries(d,parent) { } /*! Returns the type of series. Derived classes override this. */ -QSeries::QSeriesType QBarSeries::type() const +QAbstractSeries::QSeriesType QBarSeries::type() const { - return QSeries::SeriesTypeBar; + return QAbstractSeries::SeriesTypeBar; } /*! @@ -269,7 +269,8 @@ void QBarSeries::setLabelsVisible(bool visible) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -QBarSeriesPrivate::QBarSeriesPrivate(QBarCategories categories, QBarSeries *q) : QSeriesPrivate(q), +QBarSeriesPrivate::QBarSeriesPrivate(QBarCategories categories, QBarSeries *q) : + QAbstractSeriesPrivate(q), m_internalModel(new BarChartModel(categories,this)), m_model(0), m_mapCategories(-1), diff --git a/src/barchart/qbarseries.h b/src/barchart/qbarseries.h index 8415261..1676ccf 100644 --- a/src/barchart/qbarseries.h +++ b/src/barchart/qbarseries.h @@ -21,7 +21,7 @@ #ifndef BARSERIES_H #define BARSERIES_H -#include +#include #include class QModelIndex; @@ -36,14 +36,14 @@ class BarCategory; class QBarSeriesPrivate; // Container for series -class QTCOMMERCIALCHART_EXPORT QBarSeries : public QSeries +class QTCOMMERCIALCHART_EXPORT QBarSeries : public QAbstractSeries { Q_OBJECT public: explicit QBarSeries(QBarCategories categories, QObject *parent = 0); virtual ~QBarSeries(); - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; void appendBarSet(QBarSet *set); // Takes ownership of set void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set diff --git a/src/barchart/qbarseries_p.h b/src/barchart/qbarseries_p.h index 20a11fc..7254338 100644 --- a/src/barchart/qbarseries_p.h +++ b/src/barchart/qbarseries_p.h @@ -2,16 +2,16 @@ #define QBARSERIES_P_H #include "qbarseries.h" -#include "qseries_p.h" +#include "qabstractseries_p.h" #include -#include +#include class QModelIndex; QTCOMMERCIALCHART_BEGIN_NAMESPACE // Container for series -class QBarSeriesPrivate : public QSeriesPrivate +class QBarSeriesPrivate : public QAbstractSeriesPrivate { Q_OBJECT public: diff --git a/src/barchart/qpercentbarseries.cpp b/src/barchart/qpercentbarseries.cpp index c6952f1..d03900f 100644 --- a/src/barchart/qpercentbarseries.cpp +++ b/src/barchart/qpercentbarseries.cpp @@ -44,7 +44,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \fn virtual QSeriesType QPercentBarSeries::type() const \brief Returns type of series. - \sa QSeries, QSeriesType + \sa QAbstractSeries, QSeriesType */ /*! @@ -56,9 +56,9 @@ QPercentBarSeries::QPercentBarSeries(QBarCategories categories, QObject *parent) { } -QSeries::QSeriesType QPercentBarSeries::type() const +QAbstractSeries::QSeriesType QPercentBarSeries::type() const { - return QSeries::SeriesTypePercentBar; + return QAbstractSeries::SeriesTypePercentBar; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/barchart/qpercentbarseries.h b/src/barchart/qpercentbarseries.h index 8919a87..feabf0f 100644 --- a/src/barchart/qpercentbarseries.h +++ b/src/barchart/qpercentbarseries.h @@ -33,7 +33,7 @@ class QTCOMMERCIALCHART_EXPORT QPercentBarSeries : public QBarSeries Q_OBJECT public: explicit QPercentBarSeries(QBarCategories categories, QObject *parent = 0); - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; private: Q_DECLARE_PRIVATE(QPercentBarSeries) Q_DISABLE_COPY(QPercentBarSeries) diff --git a/src/barchart/qstackedbarseries.cpp b/src/barchart/qstackedbarseries.cpp index e691a84..e416176 100644 --- a/src/barchart/qstackedbarseries.cpp +++ b/src/barchart/qstackedbarseries.cpp @@ -44,7 +44,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \fn virtual QSeriesType QStackedBarSeries::type() const \brief Returns type of series. - \sa QSeries, QSeriesType + \sa QSeriesType */ /*! @@ -56,9 +56,9 @@ QStackedBarSeries::QStackedBarSeries(QBarCategories categories, QObject *parent) { } -QSeries::QSeriesType QStackedBarSeries::type() const +QAbstractSeries::QSeriesType QStackedBarSeries::type() const { - return QSeries::SeriesTypeStackedBar; + return QAbstractSeries::SeriesTypeStackedBar; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/barchart/qstackedbarseries.h b/src/barchart/qstackedbarseries.h index 7bf4c27..c3ac425 100644 --- a/src/barchart/qstackedbarseries.h +++ b/src/barchart/qstackedbarseries.h @@ -33,7 +33,7 @@ class QTCOMMERCIALCHART_EXPORT QStackedBarSeries : public QBarSeries Q_OBJECT public: explicit QStackedBarSeries(QBarCategories categories, QObject *parent = 0); - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; private: Q_DECLARE_PRIVATE(QStackedBarSeries) Q_DISABLE_COPY(QStackedBarSeries) diff --git a/src/chartdataset.cpp b/src/chartdataset.cpp index d0eeb55..e67532b 100644 --- a/src/chartdataset.cpp +++ b/src/chartdataset.cpp @@ -21,7 +21,7 @@ #include "chartdataset_p.h" #include "qchartaxis.h" #include "qchartaxis_p.h" -#include "qseries_p.h" +#include "qabstractseries_p.h" #include "qbarseries.h" #include "qstackedbarseries.h" #include "qpercentbarseries.h" @@ -41,7 +41,7 @@ ChartDataSet::~ChartDataSet() { } -void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY) +void ChartDataSet::addSeries(QAbstractSeries* series, QChartAxis *axisY) { if(axisY==0) axisY = m_axisY; @@ -75,21 +75,21 @@ void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY) series->d_ptr->scaleDomain(*domain); - if(series->type() == QSeries::SeriesTypeBar || series->type() == QSeries::SeriesTypeStackedBar || series->type() == QSeries::SeriesTypePercentBar) - { + if(series->type() == QAbstractSeries::SeriesTypeBar + || series->type() == QAbstractSeries::SeriesTypeStackedBar + || series->type() == QAbstractSeries::SeriesTypePercentBar) { QBarSeries* barSeries = static_cast(series); setupCategories(barSeries); } - if (series->type()== QSeries::SeriesTypePie && m_seriesAxisMap.count()==0) - { + if (series->type()== QAbstractSeries::SeriesTypePie && m_seriesAxisMap.count() == 0) { axisX()->hide(); this->axisY()->hide(); } m_seriesAxisMap.insert(series,axisY); - QMapIterator i(m_indexSeriesMap); + QMapIterator i(m_indexSeriesMap); int key=0; while (i.hasNext()) { @@ -106,7 +106,7 @@ void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY) } -QChartAxis* ChartDataSet::removeSeries(QSeries* series) +QChartAxis* ChartDataSet::removeSeries(QAbstractSeries* series) { QChartAxis* axis = m_seriesAxisMap.value(series); @@ -148,9 +148,9 @@ QChartAxis* ChartDataSet::removeSeries(QSeries* series) void ChartDataSet::removeAllSeries() { - QList series = m_seriesAxisMap.keys(); + QList series = m_seriesAxisMap.keys(); QList axes; - foreach(QSeries* s , series) { + foreach(QAbstractSeries *s , series) { QChartAxis* axis = removeSeries(s); if(axis==axisY()) continue; int i = axes.indexOf(axis); @@ -191,10 +191,10 @@ void ChartDataSet::zoomOutDomain(const QRectF& rect, const QSizeF& size) } } -int ChartDataSet::seriesCount(QSeries::QSeriesType type) +int ChartDataSet::seriesCount(QAbstractSeries::QSeriesType type) { int count=0; - QMapIterator i(m_seriesAxisMap); + QMapIterator i(m_seriesAxisMap); while (i.hasNext()) { i.next(); if(i.key()->type()==type) count++; @@ -202,9 +202,9 @@ int ChartDataSet::seriesCount(QSeries::QSeriesType type) return count; } -int ChartDataSet::seriesIndex(QSeries *series) +int ChartDataSet::seriesIndex(QAbstractSeries *series) { - QMapIterator i(m_indexSeriesMap); + QMapIterator i(m_indexSeriesMap); while (i.hasNext()) { i.next(); if (i.value() == series) @@ -213,13 +213,13 @@ int ChartDataSet::seriesIndex(QSeries *series) return -1; } -QChartAxis* ChartDataSet::axisY(QSeries* series) const +QChartAxis* ChartDataSet::axisY(QAbstractSeries *series) const { if(series == 0) return m_axisY; return m_seriesAxisMap.value(series); } -Domain* ChartDataSet::domain(QSeries* series) const +Domain* ChartDataSet::domain(QAbstractSeries *series) const { QChartAxis* axis = m_seriesAxisMap.value(series); if(axis){ diff --git a/src/chartdataset_p.h b/src/chartdataset_p.h index 94bb18c..9b1441b 100644 --- a/src/chartdataset_p.h +++ b/src/chartdataset_p.h @@ -30,7 +30,7 @@ #ifndef CHARTDATASET_P_H #define CHARTDATASET_P_H -#include "qseries.h" +#include "qabstractseries.h" #include "domain_p.h" #include @@ -46,38 +46,38 @@ public: ChartDataSet(QObject* parent=0); virtual ~ChartDataSet(); - void addSeries(QSeries* series,QChartAxis *axisY = 0); - QChartAxis* removeSeries(QSeries* series); + void addSeries(QAbstractSeries* series,QChartAxis *axisY = 0); + QChartAxis* removeSeries(QAbstractSeries* series); void removeAllSeries(); void zoomInDomain(const QRectF& rect, const QSizeF& size); void zoomOutDomain(const QRectF& rect, const QSizeF& size); void scrollDomain(int dx,int dy,const QSizeF& size); - int seriesCount(QSeries::QSeriesType type); - int seriesIndex(QSeries *series); + int seriesCount(QAbstractSeries::QSeriesType type); + int seriesIndex(QAbstractSeries *series); - Domain* domain(QSeries* series) const; + Domain* domain(QAbstractSeries* series) const; Domain* domain(QChartAxis* axis) const; QChartAxis* axisX() const { return m_axisX; } - QChartAxis* axisY(QSeries* series = 0) const; + QChartAxis* axisY(QAbstractSeries *series = 0) const; Q_SIGNALS: - void seriesAdded(QSeries* series,Domain* domain); - void seriesRemoved(QSeries* series); + void seriesAdded(QAbstractSeries* series, Domain* domain); + void seriesRemoved(QAbstractSeries* series); void axisAdded(QChartAxis* axis,Domain* domain); void axisRemoved(QChartAxis* axis); private: QStringList createLabels(QChartAxis* axis,qreal min, qreal max); - void calculateDomain(QSeries* series,Domain* domain); + void calculateDomain(QAbstractSeries* series,Domain* domain); void setupCategories(QBarSeries* series); private: - QMap m_seriesAxisMap; - QMap m_axisDomainMap; - QMap m_indexSeriesMap; + QMap m_seriesAxisMap; + QMap m_axisDomainMap; + QMap m_indexSeriesMap; QChartAxis* m_axisX; QChartAxis* m_axisY; diff --git a/src/chartpresenter.cpp b/src/chartpresenter.cpp index 7544cd2..4ba8b03 100644 --- a/src/chartpresenter.cpp +++ b/src/chartpresenter.cpp @@ -24,7 +24,7 @@ #include "chartdataset_p.h" #include "charttheme_p.h" #include "chartanimator_p.h" -#include "qseries_p.h" +#include "qabstractseries_p.h" #include "qareaseries.h" #include "axis_p.h" #include "areachartitem_p.h" @@ -146,7 +146,7 @@ void ChartPresenter::handleAxisRemoved(QChartAxis* axis) } -void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) +void ChartPresenter::handleSeriesAdded(QAbstractSeries* series,Domain* domain) { Chart *item = series->d_ptr->createGraphics(this); Q_ASSERT(item); @@ -158,13 +158,13 @@ void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) m_chartItems.insert(series,item); } -void ChartPresenter::handleSeriesRemoved(QSeries* series) +void ChartPresenter::handleSeriesRemoved(QAbstractSeries* series) { Chart* item = m_chartItems.take(series); Q_ASSERT(item); if(m_animator) { //small hack to handle area animations - if(series->type()==QSeries::SeriesTypeArea){ + if(series->type() == QAbstractSeries::SeriesTypeArea){ QAreaSeries* areaSeries = static_cast(series); AreaChartItem* area = static_cast(item); m_animator->removeAnimation(area->upperLineItem()); @@ -207,14 +207,14 @@ void ChartPresenter::setAnimationOptions(QChart::AnimationOptions options) void ChartPresenter::resetAllElements() { - QList axisList = m_axisItems.uniqueKeys(); - QList seriesList = m_chartItems.uniqueKeys(); + QList axisList = m_axisItems.uniqueKeys(); + QList seriesList = m_chartItems.uniqueKeys(); - foreach(QChartAxis* axis, axisList) { + foreach(QChartAxis *axis, axisList) { handleAxisRemoved(axis); handleAxisAdded(axis,m_dataset->domain(axis)); } - foreach(QSeries* series, seriesList) { + foreach(QAbstractSeries *series, seriesList) { handleSeriesRemoved(series); handleSeriesAdded(series,m_dataset->domain(series)); } diff --git a/src/chartpresenter_p.h b/src/chartpresenter_p.h index 7eb993b..cdcc1b8 100644 --- a/src/chartpresenter_p.h +++ b/src/chartpresenter_p.h @@ -30,7 +30,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class Chart; -class QSeries; +class QAbstractSeries; class ChartDataSet; class Domain; class Axis; @@ -87,8 +87,8 @@ public: //TODO: fix me QRectF margins() const { return m_chartMargins;} public Q_SLOTS: - void handleSeriesAdded(QSeries* series,Domain* domain); - void handleSeriesRemoved(QSeries* series); + void handleSeriesAdded(QAbstractSeries* series,Domain* domain); + void handleSeriesRemoved(QAbstractSeries* series); void handleAxisAdded(QChartAxis* axis,Domain* domain); void handleAxisRemoved(QChartAxis* axis); void updateLayout(); @@ -102,8 +102,8 @@ private: ChartAnimator* m_animator; ChartDataSet* m_dataset; ChartTheme *m_chartTheme; - QMap m_chartItems; - QMap m_axisItems; + QMap m_chartItems; + QMap m_axisItems; QRectF m_rect; QRectF m_chartRect; QChart::AnimationOptions m_options; diff --git a/src/charttheme_p.h b/src/charttheme_p.h index 48e50c7..eae6593 100644 --- a/src/charttheme_p.h +++ b/src/charttheme_p.h @@ -29,7 +29,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartItem; -class QSeries; class LineChartItem; class QLineSeries; class BarChartItem; diff --git a/src/legend/legendmarker.cpp b/src/legend/legendmarker.cpp index 7e2f2c2..2302f85 100644 --- a/src/legend/legendmarker.cpp +++ b/src/legend/legendmarker.cpp @@ -35,7 +35,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -LegendMarker::LegendMarker(QSeries* series,QLegend *legend) : QGraphicsObject(legend), +LegendMarker::LegendMarker(QAbstractSeries *series, QLegend *legend) : QGraphicsObject(legend), m_series(series), m_markerRect(0,0,10.0,10.0), m_boundingRect(0,0,0,0), @@ -179,7 +179,7 @@ void XYLegendMarker::updated() { setLabel(m_series->name()); - if(m_series->type()== QSeries::SeriesTypeScatter) + if(m_series->type()== QAbstractSeries::SeriesTypeScatter) { setBrush(m_series->brush()); diff --git a/src/legend/legendmarker_p.h b/src/legend/legendmarker_p.h index e849727..4687180 100644 --- a/src/legend/legendmarker_p.h +++ b/src/legend/legendmarker_p.h @@ -29,7 +29,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QSeries; +class QAbstractSeries; class QAreaSeries; class QXYSeries; class QBarSet; @@ -43,7 +43,7 @@ class LegendMarker : public QGraphicsObject Q_OBJECT public: - explicit LegendMarker(QSeries* m_series,QLegend *parent); + explicit LegendMarker(QAbstractSeries *m_series, QLegend *parent); void setPen(const QPen &pen); QPen pen() const; @@ -55,7 +55,7 @@ public: void setLabel(const QString label); QString label() const; - QSeries* series() const { return m_series;} + QAbstractSeries *series() const { return m_series;} void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); @@ -74,7 +74,7 @@ public Q_SLOTS: virtual void updated() = 0; protected: - QSeries* m_series; + QAbstractSeries *m_series; QRectF m_markerRect; QRectF m_boundingRect; QLegend* m_legend; diff --git a/src/legend/qlegend.cpp b/src/legend/qlegend.cpp index 096f110..7ae8fa6 100644 --- a/src/legend/qlegend.cpp +++ b/src/legend/qlegend.cpp @@ -20,8 +20,8 @@ #include "qlegend.h" #include "qlegend_p.h" -#include "qseries.h" -#include "qseries_p.h" +#include "qabstractseries.h" +#include "qabstractseries_p.h" #include "qchart_p.h" #include "legendmarker_p.h" @@ -56,7 +56,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \mainclass - \sa QChart, QSeries + \sa QChart, QAbstractSeries */ /*! @@ -91,8 +91,8 @@ d_ptr(new QLegendPrivate(chart->d_ptr->m_presenter,this)) setFlags(QGraphicsItem::ItemClipsChildrenToShape); setEnabled(false); // By default legend is disabled setVisible(false); - QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesAdded(QSeries*,Domain*)),d_ptr.data(),SLOT(handleSeriesAdded(QSeries*,Domain*))); - QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesRemoved(QSeries*)),d_ptr.data(),SLOT(handleSeriesRemoved(QSeries*))); + QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesAdded(QAbstractSeries *, Domain *)),d_ptr.data(),SLOT(handleSeriesAdded(QAbstractSeries *,Domain*))); + QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesRemoved(QAbstractSeries *)),d_ptr.data(),SLOT(handleSeriesRemoved(QAbstractSeries *))); } QLegend::~QLegend() @@ -396,7 +396,7 @@ void QLegendPrivate::updateLayout() m_presenter->updateLayout(); } -void QLegendPrivate::handleSeriesAdded(QSeries *series, Domain *domain) +void QLegendPrivate::handleSeriesAdded(QAbstractSeries *series, Domain *domain) { Q_UNUSED(domain) @@ -404,7 +404,7 @@ void QLegendPrivate::handleSeriesAdded(QSeries *series, Domain *domain) foreach(LegendMarker* marker , markers) m_markers->addToGroup(marker); - if(series->type()==QSeries::SeriesTypePie) + if(series->type() == QAbstractSeries::SeriesTypePie) { QPieSeries *pieSeries = static_cast(series); QObject::connect(pieSeries,SIGNAL(added(QList)),this,SLOT(handleUpdateSeries())); @@ -414,7 +414,7 @@ void QLegendPrivate::handleSeriesAdded(QSeries *series, Domain *domain) updateLayout(); } -void QLegendPrivate::handleSeriesRemoved(QSeries *series) +void QLegendPrivate::handleSeriesRemoved(QAbstractSeries *series) { QList items = m_markers->childItems(); @@ -426,7 +426,7 @@ void QLegendPrivate::handleSeriesRemoved(QSeries *series) } } - if(series->type()==QSeries::SeriesTypePie) + if(series->type() == QAbstractSeries::SeriesTypePie) { QPieSeries *pieSeries = static_cast(series); QObject::disconnect(pieSeries,SIGNAL(added(QList)),this,SLOT(handleUpdateSeries())); @@ -439,7 +439,7 @@ void QLegendPrivate::handleSeriesRemoved(QSeries *series) void QLegendPrivate::handleUpdateSeries() { //TODO: reimplement to be optimal - QSeries* series = qobject_cast (sender()); + QAbstractSeries* series = qobject_cast (sender()); Q_ASSERT(series); handleSeriesRemoved(series); handleSeriesAdded(series,0); diff --git a/src/legend/qlegend.h b/src/legend/qlegend.h index 355074c..a6488d7 100644 --- a/src/legend/qlegend.h +++ b/src/legend/qlegend.h @@ -37,8 +37,6 @@ class QBarSeries; class QPieSeries; class QAreaSeries; class LegendScrollButton; -class QSeries; - class QChart; class QLegendPrivate; diff --git a/src/legend/qlegend_p.h b/src/legend/qlegend_p.h index f5bbbb2..e190033 100644 --- a/src/legend/qlegend_p.h +++ b/src/legend/qlegend_p.h @@ -35,6 +35,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartPresenter; +class QAbstractSeries; class QLegendPrivate : public QObject { @@ -47,8 +48,8 @@ public: void updateLayout(); public Q_SLOTS: - void handleSeriesAdded(QSeries *series, Domain *domain); - void handleSeriesRemoved(QSeries *series); + void handleSeriesAdded(QAbstractSeries *series, Domain *domain); + void handleSeriesRemoved(QAbstractSeries *series); void handleUpdateSeries(); //TODO remove this function private: diff --git a/src/linechart/qlineseries.cpp b/src/linechart/qlineseries.cpp index fb65d45..7c6da12 100644 --- a/src/linechart/qlineseries.cpp +++ b/src/linechart/qlineseries.cpp @@ -51,7 +51,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \fn virtual QSeriesType QLineSeries::type() const \brief Returns type of series. - \sa QSeries, QSeriesType + \sa QAbstractSeries, QSeriesType */ /*! @@ -78,9 +78,9 @@ QLineSeries::~QLineSeries() { } -QSeries::QSeriesType QLineSeries::type() const +QAbstractSeries::QSeriesType QLineSeries::type() const { - return QSeries::SeriesTypeLine; + return QAbstractSeries::SeriesTypeLine; } /* diff --git a/src/linechart/qlineseries.h b/src/linechart/qlineseries.h index 1714a45..ef087f1 100644 --- a/src/linechart/qlineseries.h +++ b/src/linechart/qlineseries.h @@ -35,7 +35,7 @@ public: explicit QLineSeries(QObject *parent = 0); ~QLineSeries(); - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; protected: QLineSeries(QLineSeriesPrivate &d,QObject *parent = 0); diff --git a/src/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 0a48457..c83027e 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -112,7 +112,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Constructs a series object which is a child of \a parent. */ QPieSeries::QPieSeries(QObject *parent) : - QSeries(*new QPieSeriesPrivate(this),parent) + QAbstractSeries(*new QPieSeriesPrivate(this),parent) { } @@ -128,9 +128,9 @@ QPieSeries::~QPieSeries() /*! Returns QChartSeries::SeriesTypePie. */ -QSeries::QSeriesType QPieSeries::type() const +QAbstractSeries::QSeriesType QPieSeries::type() const { - return QSeries::SeriesTypePie; + return QAbstractSeries::SeriesTypePie; } /*! @@ -521,8 +521,8 @@ void QPieSeries::setModelMapping(int modelValuesLine, int modelLabelsLine, Qt::O /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -QPieSeriesPrivate::QPieSeriesPrivate(QPieSeries *parent) - :QSeriesPrivate(parent), +QPieSeriesPrivate::QPieSeriesPrivate(QPieSeries *parent) : + QAbstractSeriesPrivate(parent), m_pieRelativeHorPos(0.5), m_pieRelativeVerPos(0.5), m_pieRelativeSize(0.7), diff --git a/src/piechart/qpieseries.h b/src/piechart/qpieseries.h index 98b7460..b34d88b 100644 --- a/src/piechart/qpieseries.h +++ b/src/piechart/qpieseries.h @@ -21,13 +21,13 @@ #ifndef PIESERIES_H #define PIESERIES_H -#include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE class QPieSeriesPrivate; class QPieSlice; -class QTCOMMERCIALCHART_EXPORT QPieSeries : public QSeries +class QTCOMMERCIALCHART_EXPORT QPieSeries : public QAbstractSeries { Q_OBJECT Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition) diff --git a/src/piechart/qpieseries_p.h b/src/piechart/qpieseries_p.h index 580d8c1..5100c03 100644 --- a/src/piechart/qpieseries_p.h +++ b/src/piechart/qpieseries_p.h @@ -22,13 +22,13 @@ #define QPIESERIES_P_H #include "qpieseries.h" -#include "qseries_p.h" +#include "qabstractseries_p.h" class QModelIndex; QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QPieSeriesPrivate : public QSeriesPrivate +class QPieSeriesPrivate : public QAbstractSeriesPrivate { Q_OBJECT diff --git a/src/qseries.cpp b/src/qabstractseries.cpp similarity index 84% rename from src/qseries.cpp rename to src/qabstractseries.cpp index 6b6dfbb..c124a40 100644 --- a/src/qseries.cpp +++ b/src/qabstractseries.cpp @@ -18,13 +18,13 @@ ** ****************************************************************************/ -#include "qseries.h" -#include "qseries_p.h" +#include "qabstractseries.h" +#include "qabstractseries_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! - \class QSeries + \class QAbstractSeries \brief Base class for all QtCommercial Chart series. \mainclass @@ -34,7 +34,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \enum QSeries::QSeriesType + \enum QAbstractSeries::QSeriesType The type of the series object. @@ -49,12 +49,12 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \fn QSeriesType QSeries::type() const + \fn QSeriesType QAbstractSeries::type() const \brief The type of the series. */ /*! - \fn bool QSeries::setModel(QAbstractItemModel *model) + \fn bool QAbstractSeries::setModel(QAbstractItemModel *model) \brief Use the \a model to provide data for the series. The model overrides possible user data set with QChartSeries type specific data setters. For example if you call both QScatterSeries::addData() and QScatterSeries::setModel, only the data provided by the model is @@ -62,12 +62,12 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \property QSeries::name + \property QAbstractSeries::name \brief name of the series property */ /*! - \fn void QSeries::setName(const QString& name) + \fn void QAbstractSeries::setName(const QString& name) \brief Sets a \a name for the series. The name of a series is shown in the legend for QXYSeries. @@ -80,7 +80,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \internal \brief Constructs ChartSeries object with \a parent. */ -QSeries::QSeries(QSeriesPrivate &d, QObject *parent) : +QAbstractSeries::QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent) : QObject(parent), d_ptr(&d) { @@ -89,19 +89,19 @@ QSeries::QSeries(QSeriesPrivate &d, QObject *parent) : /*! \brief Virtual destructor for the chart series. */ -QSeries::~QSeries() +QAbstractSeries::~QAbstractSeries() { } /*! \brief Returns the pointer to the model that is used as the series data source */ -QAbstractItemModel* QSeries::model() const +QAbstractItemModel* QAbstractSeries::model() const { return d_ptr->m_model; } -void QSeries::setName(const QString& name) +void QAbstractSeries::setName(const QString& name) { d_ptr->m_name = name; } @@ -110,23 +110,23 @@ void QSeries::setName(const QString& name) \brief Returns the name of the series. \sa setName() */ -QString QSeries::name() const +QString QAbstractSeries::name() const { return d_ptr->m_name; } /////////////////////////////////////////////////////////////////////////////////////////////////// -QSeriesPrivate::QSeriesPrivate(QSeries* q): q_ptr(q),m_model(0) +QAbstractSeriesPrivate::QAbstractSeriesPrivate(QAbstractSeries* q): q_ptr(q),m_model(0) { } -QSeriesPrivate::~QSeriesPrivate() +QAbstractSeriesPrivate::~QAbstractSeriesPrivate() { } -#include "moc_qseries.cpp" -#include "moc_qseries_p.cpp" +#include "moc_qabstractseries.cpp" +#include "moc_qabstractseries_p.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/qseries.h b/src/qabstractseries.h similarity index 88% rename from src/qseries.h rename to src/qabstractseries.h index c4a08b5..98dd281 100644 --- a/src/qseries.h +++ b/src/qabstractseries.h @@ -18,8 +18,8 @@ ** ****************************************************************************/ -#ifndef QSERIES_H -#define QSERIES_H +#ifndef QABSTRACTSERIES_H +#define QABSTRACTSERIES_H #include #include @@ -29,9 +29,9 @@ class QAbstractItemModel; QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QSeriesPrivate; +class QAbstractSeriesPrivate; -class QTCOMMERCIALCHART_EXPORT QSeries : public QObject +class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) @@ -50,10 +50,10 @@ public: }; protected: - QSeries(QSeriesPrivate &d, QObject *parent = 0); + QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); public: - ~QSeries(); + ~QAbstractSeries(); virtual QSeriesType type() const = 0; virtual bool setModel(QAbstractItemModel* model) = 0; QAbstractItemModel* model() const; @@ -61,7 +61,7 @@ public: QString name() const; protected: - QScopedPointer d_ptr; + QScopedPointer d_ptr; friend class ChartDataSet; friend class ChartPresenter; friend class QLegendPrivate; diff --git a/src/qseries_p.h b/src/qabstractseries_p.h similarity index 85% rename from src/qseries_p.h rename to src/qabstractseries_p.h index 788f538..4080a9f 100644 --- a/src/qseries_p.h +++ b/src/qabstractseries_p.h @@ -27,10 +27,10 @@ // // We mean it. -#ifndef QSERIES_P_H -#define QSERIES_P_H +#ifndef QABSTRACTSERIES_P_H +#define QABSTRACTSERIES_P_H -#include "qseries.h" +#include "qabstractseries.h" class QAbstractItemModel; @@ -42,23 +42,23 @@ class Chart; class LegendMarker; class QLegend; -class QSeriesPrivate : public QObject +class QAbstractSeriesPrivate : public QObject { Q_OBJECT public: - QSeriesPrivate(QSeries *q); - ~QSeriesPrivate(); + QAbstractSeriesPrivate(QAbstractSeries *q); + ~QAbstractSeriesPrivate(); virtual void scaleDomain(Domain& domain) = 0; virtual Chart* createGraphics(ChartPresenter* presenter) = 0; virtual QList createLegendMarker(QLegend* legend) = 0; protected: - QSeries *q_ptr; + QAbstractSeries *q_ptr; QAbstractItemModel *m_model; QString m_name; - friend class QSeries; + friend class QAbstractSeries; }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/qchart.cpp b/src/qchart.cpp index a5433f1..afb7271 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -91,7 +91,7 @@ QChart::~QChart() If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and the y axis). */ -void QChart::addSeries(QSeries* series, QChartAxis* axisY) +void QChart::addSeries(QAbstractSeries *series, QChartAxis *axisY) { Q_ASSERT(series); d_ptr->m_dataset->addSeries(series, axisY); @@ -103,7 +103,7 @@ void QChart::addSeries(QSeries* series, QChartAxis* axisY) It does not delete the pointed QChartSeries data object \sa addSeries(), removeAllSeries() */ -void QChart::removeSeries(QSeries* series) +void QChart::removeSeries(QAbstractSeries *series) { Q_ASSERT(series); d_ptr->m_dataset->removeSeries(series); @@ -282,7 +282,7 @@ QChartAxis* QChart::axisX() const Returns the pointer to the y axis object of the \a series If no \a series is provided then default Y axis of the chart is returned. */ -QChartAxis* QChart::axisY(QSeries* series) const +QChartAxis* QChart::axisY(QAbstractSeries *series) const { return d_ptr->m_dataset->axisY(series); } @@ -401,8 +401,8 @@ QChartPrivate::~QChartPrivate() void QChartPrivate::createConnections() { - QObject::connect(m_dataset,SIGNAL(seriesAdded(QSeries*,Domain*)),m_presenter,SLOT(handleSeriesAdded(QSeries*,Domain*))); - QObject::connect(m_dataset,SIGNAL(seriesRemoved(QSeries*)),m_presenter,SLOT(handleSeriesRemoved(QSeries*))); + QObject::connect(m_dataset,SIGNAL(seriesAdded(QAbstractSeries *, Domain *)),m_presenter,SLOT(handleSeriesAdded(QAbstractSeries *, Domain *))); + QObject::connect(m_dataset,SIGNAL(seriesRemoved(QAbstractSeries *)),m_presenter,SLOT(handleSeriesRemoved(QAbstractSeries *))); QObject::connect(m_dataset,SIGNAL(axisAdded(QChartAxis*,Domain*)),m_presenter,SLOT(handleAxisAdded(QChartAxis*,Domain*))); QObject::connect(m_dataset,SIGNAL(axisRemoved(QChartAxis*)),m_presenter,SLOT(handleAxisRemoved(QChartAxis*))); } diff --git a/src/qchart.h b/src/qchart.h index c966dec..8194eb8 100644 --- a/src/qchart.h +++ b/src/qchart.h @@ -21,7 +21,7 @@ #ifndef QCHART_H #define QCHART_H -#include +#include #include #include @@ -29,7 +29,7 @@ class QGraphicsSceneResizeEvent; QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QSeries; +class QAbstractSeries; class QChartAxis; class QLegend; struct QChartPrivate; @@ -63,8 +63,8 @@ public: explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); ~QChart(); - void addSeries(QSeries *series, QChartAxis *axisY = 0); - void removeSeries(QSeries *series); + void addSeries(QAbstractSeries *series, QChartAxis *axisY = 0); + void removeSeries(QAbstractSeries *series); void removeAllSeries(); void setTheme(QChart::ChartTheme theme); @@ -97,7 +97,7 @@ public: void scrollDown(); QChartAxis* axisX() const; - QChartAxis* axisY(QSeries* series = 0) const; + QChartAxis* axisY(QAbstractSeries* series = 0) const; QLegend* legend() const; QRectF margins() const; diff --git a/src/qchartview.h b/src/qchartview.h index d0e4b66..ee6b524 100644 --- a/src/qchartview.h +++ b/src/qchartview.h @@ -22,7 +22,7 @@ #define QCHARTVIEW_H #include -#include +#include #include #include diff --git a/src/scatterseries/qscatterseries.cpp b/src/scatterseries/qscatterseries.cpp index 230ba27..65efd1a 100644 --- a/src/scatterseries/qscatterseries.cpp +++ b/src/scatterseries/qscatterseries.cpp @@ -58,7 +58,7 @@ /*! \fn QChartSeriesType QScatterSeries::type() const \brief Returns QChartSeries::SeriesTypeScatter. - \sa QSeries, QSeriesType + \sa QAbstractSeries, QSeriesType */ QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -77,9 +77,9 @@ QScatterSeries::~QScatterSeries() { } -QSeries::QSeriesType QScatterSeries::type() const +QAbstractSeries::QSeriesType QScatterSeries::type() const { - return QSeries::SeriesTypeScatter; + return QAbstractSeries::SeriesTypeScatter; } /*! diff --git a/src/scatterseries/qscatterseries.h b/src/scatterseries/qscatterseries.h index 09bed80..5472572 100644 --- a/src/scatterseries/qscatterseries.h +++ b/src/scatterseries/qscatterseries.h @@ -41,7 +41,7 @@ public: explicit QScatterSeries(QObject *parent = 0); ~QScatterSeries(); - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; MarkerShape shape() const; void setShape(MarkerShape shape); diff --git a/src/splinechart/qsplineseries.cpp b/src/splinechart/qsplineseries.cpp index 14765bd..9449288 100644 --- a/src/splinechart/qsplineseries.cpp +++ b/src/splinechart/qsplineseries.cpp @@ -55,9 +55,9 @@ QSplineSeries::QSplineSeries(QObject *parent) : { } -QSeries::QSeriesType QSplineSeries::type() const +QAbstractSeries::QSeriesType QSplineSeries::type() const { - return QSeries::SeriesTypeSpline; + return QAbstractSeries::SeriesTypeSpline; } QPointF QSplineSeries::controlPoint(int index) const diff --git a/src/splinechart/qsplineseries.h b/src/splinechart/qsplineseries.h index 604eeef..22d54f1 100644 --- a/src/splinechart/qsplineseries.h +++ b/src/splinechart/qsplineseries.h @@ -37,7 +37,7 @@ class QTCOMMERCIALCHART_EXPORT QSplineSeries : public QLineSeries public: explicit QSplineSeries(QObject *parent = 0); - QSeries::QSeriesType type() const; + QAbstractSeries::QSeriesType type() const; QPointF controlPoint(int index) const; void setModelMappingRange(int first, int count); diff --git a/src/src.pro b/src/src.pro index 9733d37..d7dab0d 100644 --- a/src/src.pro +++ b/src/src.pro @@ -14,7 +14,7 @@ SOURCES += \ $$PWD/domain.cpp \ $$PWD/qchart.cpp \ $$PWD/qchartview.cpp \ - $$PWD/qseries.cpp \ + $$PWD/qabstractseries.cpp \ $$PWD/chartbackground.cpp \ $$PWD/chart.cpp \ $$PWD/scroller.cpp @@ -30,11 +30,11 @@ PRIVATE_HEADERS += \ $$PWD/qchart_p.h \ $$PWD/qchartview_p.h \ $$PWD/scroller_p.h \ - $$PWD/qseries_p.h + $$PWD/qabstractseries_p.h PUBLIC_HEADERS += \ $$PWD/qchart.h \ $$PWD/qchartglobal.h \ - $$PWD/qseries.h \ + $$PWD/qabstractseries.h \ $$PWD/qchartview.h include(animations/animations.pri) diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index b5ec425..60a9f7c 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -94,7 +94,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Constructs empty series object which is a child of \a parent. When series object is added to QChartView or QChart instance ownerships is transferred. */ -QXYSeries::QXYSeries(QXYSeriesPrivate &d,QObject *parent):QSeries(d,parent) +QXYSeries::QXYSeries(QXYSeriesPrivate &d,QObject *parent) : QAbstractSeries(d, parent) { } @@ -622,16 +622,15 @@ int QXYSeries::mapCount() const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q): QSeriesPrivate(q), -m_mapX(-1), -m_mapY(-1), -m_mapFirst(0), -m_mapCount(0), -m_mapLimited(false), -m_mapOrientation( Qt::Vertical), -m_pointsVisible(false) +QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q) : QAbstractSeriesPrivate(q), + m_mapX(-1), + m_mapY(-1), + m_mapFirst(0), + m_mapCount(0), + m_mapLimited(false), + m_mapOrientation( Qt::Vertical), + m_pointsVisible(false) { - } void QXYSeriesPrivate::scaleDomain(Domain& domain) diff --git a/src/xychart/qxyseries.h b/src/xychart/qxyseries.h index 18e57b5..3312d08 100644 --- a/src/xychart/qxyseries.h +++ b/src/xychart/qxyseries.h @@ -22,7 +22,7 @@ #define QXYSERIES_H #include -#include +#include #include #include @@ -32,7 +32,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QXYSeriesPrivate; -class QTCOMMERCIALCHART_EXPORT QXYSeries : public QSeries +class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries { Q_OBJECT protected: diff --git a/src/xychart/qxyseries_p.h b/src/xychart/qxyseries_p.h index deb9b01..734d053 100644 --- a/src/xychart/qxyseries_p.h +++ b/src/xychart/qxyseries_p.h @@ -30,13 +30,13 @@ #ifndef QXYSERIES_P_H #define QXYSERIES_P_H -#include "qseries_p.h" +#include "qabstractseries_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE class QXYSeries; -class QXYSeriesPrivate: public QSeriesPrivate +class QXYSeriesPrivate: public QAbstractSeriesPrivate { Q_OBJECT diff --git a/test/auto/chartdataset/tst_chartdataset.cpp b/test/auto/chartdataset/tst_chartdataset.cpp index 4f02641..406d8c0 100644 --- a/test/auto/chartdataset/tst_chartdataset.cpp +++ b/test/auto/chartdataset/tst_chartdataset.cpp @@ -26,10 +26,10 @@ QTCOMMERCIALCHART_USE_NAMESPACE -Q_DECLARE_METATYPE(Domain*) -Q_DECLARE_METATYPE(QChartAxis*) -Q_DECLARE_METATYPE(QSeries*) -Q_DECLARE_METATYPE(QLineSeries*) +Q_DECLARE_METATYPE(Domain *) +Q_DECLARE_METATYPE(QChartAxis *) +Q_DECLARE_METATYPE(QAbstractSeries *) +Q_DECLARE_METATYPE(QLineSeries *) class tst_ChartDataSet: public QObject { @@ -138,8 +138,8 @@ void tst_ChartDataSet::addSeries() QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); - QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*))); - QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*))); + QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *,Domain*))); + QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); dataSet.addSeries(series0,axis0); dataSet.addSeries(series1,axis1); @@ -180,10 +180,10 @@ void tst_ChartDataSet::removeSeries() dataSet.addSeries(series1,axis1); dataSet.addSeries(series2,axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); - QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*))); - QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); + QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); dataSet.removeSeries(series0); dataSet.removeSeries(series1); @@ -217,10 +217,10 @@ void tst_ChartDataSet::removeAllSeries() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); - QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*))); - QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); + QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); dataSet.removeAllSeries(); @@ -293,10 +293,10 @@ void tst_ChartDataSet::seriesCount() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); - QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*))); - QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); + QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); QCOMPARE(dataSet.seriesCount(series0->type()),3); QCOMPARE(spy0.count(), 0); @@ -422,10 +422,10 @@ void tst_ChartDataSet::domain() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); - QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*))); - QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); + QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); QVERIFY(dataSet.domain(axis0)==dataSet.domain(series0)); QVERIFY(dataSet.domain(axis1)==dataSet.domain(series1)); diff --git a/test/auto/qchart/tst_qchart.cpp b/test/auto/qchart/tst_qchart.cpp index e7851d3..0e8f7ce 100644 --- a/test/auto/qchart/tst_qchart.cpp +++ b/test/auto/qchart/tst_qchart.cpp @@ -11,8 +11,8 @@ QTCOMMERCIALCHART_USE_NAMESPACE -Q_DECLARE_METATYPE(QChartAxis*) -Q_DECLARE_METATYPE(QSeries*) +Q_DECLARE_METATYPE(QChartAxis *) +Q_DECLARE_METATYPE(QAbstractSeries *) Q_DECLARE_METATYPE(QChart::AnimationOption) Q_DECLARE_METATYPE(QBrush) Q_DECLARE_METATYPE(QPen) @@ -156,17 +156,17 @@ void tst_QChart::qchart() void tst_QChart::addSeries_data() { - QTest::addColumn("series"); - QTest::addColumn("axis"); + QTest::addColumn("series"); + QTest::addColumn("axis"); - QSeries* series0 = new QLineSeries(this); - QSeries* series1 = new QAreaSeries(static_cast(series0)); - QSeries* series2 = new QScatterSeries(this); - QSeries* series3 = new QSplineSeries(this); - QSeries* series4 = new QPieSeries(this); - QSeries* series5 = new QBarSeries(QBarCategories(),this); - QSeries* series6 = new QPercentBarSeries(QBarCategories(),this); - QSeries* series7 = new QStackedBarSeries(QBarCategories(),this); + QAbstractSeries* series0 = new QLineSeries(this); + QAbstractSeries* series1 = new QAreaSeries(static_cast(series0)); + QAbstractSeries* series2 = new QScatterSeries(this); + QAbstractSeries* series3 = new QSplineSeries(this); + QAbstractSeries* series4 = new QPieSeries(this); + QAbstractSeries* series5 = new QBarSeries(QBarCategories(),this); + QAbstractSeries* series6 = new QPercentBarSeries(QBarCategories(),this); + QAbstractSeries* series7 = new QStackedBarSeries(QBarCategories(),this); QChartAxis* axis = new QChartAxis(this); @@ -191,8 +191,8 @@ void tst_QChart::addSeries_data() void tst_QChart::addSeries() { - QFETCH(QSeries*, series); - QFETCH(QChartAxis*, axis); + QFETCH(QAbstractSeries *, series); + QFETCH(QChartAxis *, axis); m_view->show(); QTest::qWaitForWindowShown(m_view); if(!axis) axis = m_chart->axisY(); @@ -384,8 +384,8 @@ void tst_QChart::removeSeries_data() void tst_QChart::removeSeries() { - QFETCH(QSeries*, series); - QFETCH(QChartAxis*, axis); + QFETCH(QAbstractSeries *, series); + QFETCH(QChartAxis *, axis); m_view->show(); QTest::qWaitForWindowShown(m_view); if(!axis) axis = m_chart->axisY(); diff --git a/test/tablemodelchart/tablewidget.h b/test/tablemodelchart/tablewidget.h index dfcb4b1..437bb06 100644 --- a/test/tablemodelchart/tablewidget.h +++ b/test/tablemodelchart/tablewidget.h @@ -31,7 +31,6 @@ class CustomTableModel; class QTableView; class QRadioButton; class QSpinBox; -//class QSeries; class TableWidget : public QWidget {