##// END OF EJS Templates
Renamed QSeries to QAbstractSeries
Tero Ahola -
r988:8a36a6921f5a
parent child
Show More
@@ -34,7 +34,7 DrilldownChart::~DrilldownChart()
34 34
35 35 }
36 36
37 void DrilldownChart::changeSeries(QSeries* series)
37 void DrilldownChart::changeSeries(QAbstractSeries* series)
38 38 {
39 39 // NOTE: if the series is owned by the chart it will be deleted
40 40 // here the "window" owns the series...
@@ -23,7 +23,7
23 23 #include <QChart>
24 24
25 25 QTCOMMERCIALCHART_BEGIN_NAMESPACE
26 class QSeries;
26 class QAbstractSeries;
27 27 class QPieSlice;
28 28 QTCOMMERCIALCHART_END_NAMESPACE
29 29
@@ -35,13 +35,13 class DrilldownChart : public QChart
35 35 public:
36 36 explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
37 37 ~DrilldownChart();
38 void changeSeries(QSeries* series);
38 void changeSeries(QAbstractSeries* series);
39 39
40 40 public Q_SLOTS:
41 41 void handleSliceClicked(QPieSlice* slice);
42 42
43 43 private:
44 QSeries* m_currentSeries;
44 QAbstractSeries* m_currentSeries;
45 45 };
46 46
47 47 #endif // DRILLDOWNCHART_H
@@ -22,7 +22,7
22 22
23 23 QTCOMMERCIALCHART_USE_NAMESPACE
24 24
25 DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QSeries* drilldownSeries)
25 DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QAbstractSeries* drilldownSeries)
26 26 :m_drilldownSeries(drilldownSeries),
27 27 m_prefix(prefix)
28 28 {
@@ -39,7 +39,7 DrilldownSlice::~DrilldownSlice()
39 39
40 40 }
41 41
42 QSeries* DrilldownSlice::drilldownSeries() const
42 QAbstractSeries* DrilldownSlice::drilldownSeries() const
43 43 {
44 44 return m_drilldownSeries;
45 45 }
@@ -23,7 +23,7
23 23 #include <QPieSlice>
24 24
25 25 QTCOMMERCIALCHART_BEGIN_NAMESPACE
26 class QSeries;
26 class QAbstractSeries;
27 27 QTCOMMERCIALCHART_END_NAMESPACE
28 28
29 29 QTCOMMERCIALCHART_USE_NAMESPACE
@@ -33,9 +33,9 class DrilldownSlice : public QPieSlice
33 33 Q_OBJECT
34 34
35 35 public:
36 DrilldownSlice(qreal value, QString prefix, QSeries* drilldownSeries);
36 DrilldownSlice(qreal value, QString prefix, QAbstractSeries* drilldownSeries);
37 37 virtual ~DrilldownSlice();
38 QSeries* drilldownSeries() const;
38 QAbstractSeries* drilldownSeries() const;
39 39
40 40 public Q_SLOTS:
41 41 void updateLabel();
@@ -43,7 +43,7 public Q_SLOTS:
43 43 void hideHighlight();
44 44
45 45 private:
46 QSeries* m_drilldownSeries;
46 QAbstractSeries* m_drilldownSeries;
47 47 QString m_prefix;
48 48 };
49 49
@@ -79,7 +79,7 m_index(-1),m_chart(chart)
79 79 //![3]
80 80
81 81 //![4]
82 foreach (QSeries* series, m_series) {
82 foreach (QAbstractSeries* series, m_series) {
83 83 QObject::connect(series,SIGNAL(clicked(QPointF)),this,SLOT(handlePointClicked(QPointF)));
84 84 }
85 85 //![4]
@@ -40,7 +40,7 public slots:
40 40
41 41 private:
42 42 QTimer m_timer;
43 QList<QSeries*> m_series;
43 QList<QAbstractSeries *> m_series;
44 44 QStringList m_titles;
45 45 int m_index;
46 46 QChart *m_chart;
@@ -29,7 +29,7 DrilldownChart::DrilldownChart(QGraphicsItem *parent, Qt::WindowFlags wFlags)
29 29 {
30 30 }
31 31
32 void DrilldownChart::changeSeries(QSeries* series)
32 void DrilldownChart::changeSeries(QAbstractSeries *series)
33 33 {
34 34 if (m_currentSeries)
35 35 removeSeries(m_currentSeries);
@@ -33,13 +33,13 class DrilldownChart : public QChart
33 33 public:
34 34 explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
35 35
36 void changeSeries(QSeries* series);
36 void changeSeries(QAbstractSeries *series);
37 37
38 38 public Q_SLOTS:
39 39 void handleClicked(QBarSet *barset, QString category, Qt::MouseButtons button);
40 40
41 41 private:
42 QSeries* m_currentSeries;
42 QAbstractSeries* m_currentSeries;
43 43 };
44 44 //! [2]
45 45
@@ -30,7 +30,7 DeclarativeAreaSeries::DeclarativeAreaSeries(QObject *parent) :
30 30 {
31 31 }
32 32
33 QSeries *DeclarativeAreaSeries::series()
33 QAbstractSeries *DeclarativeAreaSeries::series()
34 34 {
35 35 return this;
36 36 }
@@ -37,7 +37,7 public:
37 37 explicit DeclarativeAreaSeries(QObject *parent = 0);
38 38
39 39 public:
40 QSeries *series();
40 QAbstractSeries *series();
41 41 QDeclarativeListProperty<DeclarativeXyPoint> points();
42 42 QDeclarativeListProperty<DeclarativeXyPoint> lowerPoints();
43 43
@@ -30,7 +30,7 DeclarativeLineSeries::DeclarativeLineSeries(QObject *parent) :
30 30 {
31 31 }
32 32
33 QSeries *DeclarativeLineSeries::series()
33 QAbstractSeries *DeclarativeLineSeries::series()
34 34 {
35 35 return this;
36 36 }
@@ -37,7 +37,7 public:
37 37 explicit DeclarativeLineSeries(QObject *parent = 0);
38 38
39 39 public:
40 QSeries *series();
40 QAbstractSeries *series();
41 41 QDeclarativeListProperty<DeclarativeXyPoint> points();
42 42 };
43 43
@@ -30,7 +30,7 DeclarativeScatterSeries::DeclarativeScatterSeries(QObject *parent) :
30 30 {
31 31 }
32 32
33 QSeries *DeclarativeScatterSeries::series()
33 QAbstractSeries *DeclarativeScatterSeries::series()
34 34 {
35 35 return this;
36 36 }
@@ -37,7 +37,7 public:
37 37 explicit DeclarativeScatterSeries(QObject *parent = 0);
38 38
39 39 public:
40 QSeries *series();
40 QAbstractSeries *series();
41 41 QDeclarativeListProperty<DeclarativeXyPoint> points();
42 42 };
43 43
@@ -29,7 +29,7 DeclarativeSplineSeries::DeclarativeSplineSeries(QObject *parent) :
29 29 {
30 30 }
31 31
32 QSeries *DeclarativeSplineSeries::series()
32 QAbstractSeries *DeclarativeSplineSeries::series()
33 33 {
34 34 return this;
35 35 }
@@ -37,7 +37,7 public:
37 37 explicit DeclarativeSplineSeries(QObject *parent = 0);
38 38
39 39 public:
40 QSeries *series();
40 QAbstractSeries *series();
41 41 QDeclarativeListProperty<DeclarativeXyPoint> points();
42 42 };
43 43
@@ -39,7 +39,7 void DeclarativeXySeries::classBegin()
39 39
40 40 void DeclarativeXySeries::componentComplete()
41 41 {
42 QSeries *thisObj = reinterpret_cast<QSeries *>(series());
42 QAbstractSeries *thisObj = reinterpret_cast<QAbstractSeries *>(series());
43 43 DeclarativeChart *declarativeChart = qobject_cast<DeclarativeChart *>(thisObj->parent());
44 44
45 45 if (declarativeChart) {
@@ -29,7 +29,7
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 31 class QChart;
32 class QSeries;
32 class QAbstractSeries;
33 33
34 34 class DeclarativeXySeries : public QDeclarativeParserStatus
35 35 {
@@ -44,7 +44,7 public: // from QDeclarativeParserStatus
44 44 virtual void componentComplete();
45 45
46 46 public:
47 virtual QSeries *series() = 0;
47 virtual QAbstractSeries *series() = 0;
48 48 virtual QDeclarativeListProperty<DeclarativeXyPoint> points() = 0;
49 49
50 50 public Q_SLOTS:
@@ -58,7 +58,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
58 58 /*!
59 59 \fn virtual QSeriesType QAreaSeries::type() const
60 60 \brief Returns type of series.
61 \sa QSeries, QSeriesType
61 \sa QAbstractSeries, QSeriesType
62 62 */
63 63
64 64 /*!
@@ -113,7 +113,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
113 113 When series object is added to QChartView or QChart instance ownerships is transferred.
114 114 */
115 115 QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries)
116 : QSeries(*new QAreaSeriesPrivate(upperSeries,lowerSeries,this),upperSeries)
116 : QAbstractSeries(*new QAreaSeriesPrivate(upperSeries,lowerSeries,this),upperSeries)
117 117 {
118 118 }
119 119
@@ -126,9 +126,9 QAreaSeries::~QAreaSeries()
126 126 }
127 127
128 128
129 QSeries::QSeriesType QAreaSeries::type() const
129 QAbstractSeries::QSeriesType QAreaSeries::type() const
130 130 {
131 return QSeries::SeriesTypeArea;
131 return QAbstractSeries::SeriesTypeArea;
132 132 }
133 133
134 134 QLineSeries* QAreaSeries::upperSeries() const
@@ -211,7 +211,7 QAbstractItemModel* QAreaSeries::model() const
211 211 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
212 212
213 213 QAreaSeriesPrivate::QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries,QAreaSeries* q) :
214 QSeriesPrivate(q),
214 QAbstractSeriesPrivate(q),
215 215 m_upperSeries(upperSeries),
216 216 m_lowerSeries(lowerSeries),
217 217 m_pointsVisible(false)
@@ -22,7 +22,7
22 22 #define QAREASERIES_H
23 23
24 24 #include <qchartglobal.h>
25 #include <qseries.h>
25 #include <qabstractseries.h>
26 26 #include <QPen>
27 27 #include <QBrush>
28 28
@@ -30,7 +30,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30 class QLineSeries;
31 31 class QAreaSeriesPrivate;
32 32
33 class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QSeries
33 class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QAbstractSeries
34 34 {
35 35 Q_OBJECT
36 36 public:
@@ -38,7 +38,7 public:
38 38 ~QAreaSeries();
39 39
40 40 public:
41 QSeries::QSeriesType type() const;
41 QAbstractSeries::QSeriesType type() const;
42 42
43 43 QLineSeries* upperSeries() const;
44 44 QLineSeries* lowerSeries() const;
@@ -30,13 +30,13
30 30 #ifndef QAREASERIES_P_H
31 31 #define QAREASERIES_P_H
32 32
33 #include "qseries_p.h"
33 #include "qabstractseries_p.h"
34 34
35 35 QTCOMMERCIALCHART_BEGIN_NAMESPACE
36 36
37 37 class QAreaSeries;
38 38
39 class QAreaSeriesPrivate: public QSeriesPrivate
39 class QAreaSeriesPrivate: public QAbstractSeriesPrivate
40 40 {
41 41 Q_OBJECT
42 42
@@ -24,7 +24,7
24 24 #include <QObject>
25 25 #include <QStringList>
26 26 #include "qchartglobal.h"
27 #include <qseries.h>
27 #include <qabstractseries.h>
28 28
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
@@ -74,7 +74,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
74 74 QBarSeries is QObject which is a child of a \a parent.
75 75 */
76 76 QBarSeries::QBarSeries(QBarCategories categories, QObject *parent) :
77 QSeries(*new QBarSeriesPrivate(categories, this),parent)
77 QAbstractSeries(*new QBarSeriesPrivate(categories, this),parent)
78 78 {
79 79 }
80 80
@@ -90,16 +90,16 QBarSeries::~QBarSeries()
90 90 \internal
91 91 */
92 92 QBarSeries::QBarSeries(QBarSeriesPrivate &d, QObject *parent) :
93 QSeries(d,parent)
93 QAbstractSeries(d,parent)
94 94 {
95 95 }
96 96
97 97 /*!
98 98 Returns the type of series. Derived classes override this.
99 99 */
100 QSeries::QSeriesType QBarSeries::type() const
100 QAbstractSeries::QSeriesType QBarSeries::type() const
101 101 {
102 return QSeries::SeriesTypeBar;
102 return QAbstractSeries::SeriesTypeBar;
103 103 }
104 104
105 105 /*!
@@ -269,7 +269,8 void QBarSeries::setLabelsVisible(bool visible)
269 269
270 270 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
271 271
272 QBarSeriesPrivate::QBarSeriesPrivate(QBarCategories categories, QBarSeries *q) : QSeriesPrivate(q),
272 QBarSeriesPrivate::QBarSeriesPrivate(QBarCategories categories, QBarSeries *q) :
273 QAbstractSeriesPrivate(q),
273 274 m_internalModel(new BarChartModel(categories,this)),
274 275 m_model(0),
275 276 m_mapCategories(-1),
@@ -21,7 +21,7
21 21 #ifndef BARSERIES_H
22 22 #define BARSERIES_H
23 23
24 #include <qseries.h>
24 #include <qabstractseries.h>
25 25 #include <QStringList>
26 26
27 27 class QModelIndex;
@@ -36,14 +36,14 class BarCategory;
36 36 class QBarSeriesPrivate;
37 37
38 38 // Container for series
39 class QTCOMMERCIALCHART_EXPORT QBarSeries : public QSeries
39 class QTCOMMERCIALCHART_EXPORT QBarSeries : public QAbstractSeries
40 40 {
41 41 Q_OBJECT
42 42 public:
43 43 explicit QBarSeries(QBarCategories categories, QObject *parent = 0);
44 44 virtual ~QBarSeries();
45 45
46 QSeries::QSeriesType type() const;
46 QAbstractSeries::QSeriesType type() const;
47 47
48 48 void appendBarSet(QBarSet *set); // Takes ownership of set
49 49 void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set
@@ -2,16 +2,16
2 2 #define QBARSERIES_P_H
3 3
4 4 #include "qbarseries.h"
5 #include "qseries_p.h"
5 #include "qabstractseries_p.h"
6 6 #include <QStringList>
7 #include <QSeries>
7 #include <QAbstractSeries>
8 8
9 9 class QModelIndex;
10 10
11 11 QTCOMMERCIALCHART_BEGIN_NAMESPACE
12 12
13 13 // Container for series
14 class QBarSeriesPrivate : public QSeriesPrivate
14 class QBarSeriesPrivate : public QAbstractSeriesPrivate
15 15 {
16 16 Q_OBJECT
17 17 public:
@@ -44,7 +44,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
44 44 /*!
45 45 \fn virtual QSeriesType QPercentBarSeries::type() const
46 46 \brief Returns type of series.
47 \sa QSeries, QSeriesType
47 \sa QAbstractSeries, QSeriesType
48 48 */
49 49
50 50 /*!
@@ -56,9 +56,9 QPercentBarSeries::QPercentBarSeries(QBarCategories categories, QObject *parent)
56 56 {
57 57 }
58 58
59 QSeries::QSeriesType QPercentBarSeries::type() const
59 QAbstractSeries::QSeriesType QPercentBarSeries::type() const
60 60 {
61 return QSeries::SeriesTypePercentBar;
61 return QAbstractSeries::SeriesTypePercentBar;
62 62 }
63 63
64 64 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -33,7 +33,7 class QTCOMMERCIALCHART_EXPORT QPercentBarSeries : public QBarSeries
33 33 Q_OBJECT
34 34 public:
35 35 explicit QPercentBarSeries(QBarCategories categories, QObject *parent = 0);
36 QSeries::QSeriesType type() const;
36 QAbstractSeries::QSeriesType type() const;
37 37 private:
38 38 Q_DECLARE_PRIVATE(QPercentBarSeries)
39 39 Q_DISABLE_COPY(QPercentBarSeries)
@@ -44,7 +44,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
44 44 /*!
45 45 \fn virtual QSeriesType QStackedBarSeries::type() const
46 46 \brief Returns type of series.
47 \sa QSeries, QSeriesType
47 \sa QSeriesType
48 48 */
49 49
50 50 /*!
@@ -56,9 +56,9 QStackedBarSeries::QStackedBarSeries(QBarCategories categories, QObject *parent)
56 56 {
57 57 }
58 58
59 QSeries::QSeriesType QStackedBarSeries::type() const
59 QAbstractSeries::QSeriesType QStackedBarSeries::type() const
60 60 {
61 return QSeries::SeriesTypeStackedBar;
61 return QAbstractSeries::SeriesTypeStackedBar;
62 62 }
63 63
64 64 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -33,7 +33,7 class QTCOMMERCIALCHART_EXPORT QStackedBarSeries : public QBarSeries
33 33 Q_OBJECT
34 34 public:
35 35 explicit QStackedBarSeries(QBarCategories categories, QObject *parent = 0);
36 QSeries::QSeriesType type() const;
36 QAbstractSeries::QSeriesType type() const;
37 37 private:
38 38 Q_DECLARE_PRIVATE(QStackedBarSeries)
39 39 Q_DISABLE_COPY(QStackedBarSeries)
@@ -21,7 +21,7
21 21 #include "chartdataset_p.h"
22 22 #include "qchartaxis.h"
23 23 #include "qchartaxis_p.h"
24 #include "qseries_p.h"
24 #include "qabstractseries_p.h"
25 25 #include "qbarseries.h"
26 26 #include "qstackedbarseries.h"
27 27 #include "qpercentbarseries.h"
@@ -41,7 +41,7 ChartDataSet::~ChartDataSet()
41 41 {
42 42 }
43 43
44 void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY)
44 void ChartDataSet::addSeries(QAbstractSeries* series, QChartAxis *axisY)
45 45 {
46 46 if(axisY==0) axisY = m_axisY;
47 47
@@ -75,21 +75,21 void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY)
75 75
76 76 series->d_ptr->scaleDomain(*domain);
77 77
78 if(series->type() == QSeries::SeriesTypeBar || series->type() == QSeries::SeriesTypeStackedBar || series->type() == QSeries::SeriesTypePercentBar)
79 {
78 if(series->type() == QAbstractSeries::SeriesTypeBar
79 || series->type() == QAbstractSeries::SeriesTypeStackedBar
80 || series->type() == QAbstractSeries::SeriesTypePercentBar) {
80 81 QBarSeries* barSeries = static_cast<QBarSeries*>(series);
81 82 setupCategories(barSeries);
82 83 }
83 84
84 if (series->type()== QSeries::SeriesTypePie && m_seriesAxisMap.count()==0)
85 {
85 if (series->type()== QAbstractSeries::SeriesTypePie && m_seriesAxisMap.count() == 0) {
86 86 axisX()->hide();
87 87 this->axisY()->hide();
88 88 }
89 89
90 90 m_seriesAxisMap.insert(series,axisY);
91 91
92 QMapIterator<int, QSeries*> i(m_indexSeriesMap);
92 QMapIterator<int, QAbstractSeries*> i(m_indexSeriesMap);
93 93
94 94 int key=0;
95 95 while (i.hasNext()) {
@@ -106,7 +106,7 void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY)
106 106
107 107 }
108 108
109 QChartAxis* ChartDataSet::removeSeries(QSeries* series)
109 QChartAxis* ChartDataSet::removeSeries(QAbstractSeries* series)
110 110 {
111 111 QChartAxis* axis = m_seriesAxisMap.value(series);
112 112
@@ -148,9 +148,9 QChartAxis* ChartDataSet::removeSeries(QSeries* series)
148 148
149 149 void ChartDataSet::removeAllSeries()
150 150 {
151 QList<QSeries*> series = m_seriesAxisMap.keys();
151 QList<QAbstractSeries*> series = m_seriesAxisMap.keys();
152 152 QList<QChartAxis*> axes;
153 foreach(QSeries* s , series) {
153 foreach(QAbstractSeries *s , series) {
154 154 QChartAxis* axis = removeSeries(s);
155 155 if(axis==axisY()) continue;
156 156 int i = axes.indexOf(axis);
@@ -191,10 +191,10 void ChartDataSet::zoomOutDomain(const QRectF& rect, const QSizeF& size)
191 191 }
192 192 }
193 193
194 int ChartDataSet::seriesCount(QSeries::QSeriesType type)
194 int ChartDataSet::seriesCount(QAbstractSeries::QSeriesType type)
195 195 {
196 196 int count=0;
197 QMapIterator<QSeries*, QChartAxis*> i(m_seriesAxisMap);
197 QMapIterator<QAbstractSeries*, QChartAxis*> i(m_seriesAxisMap);
198 198 while (i.hasNext()) {
199 199 i.next();
200 200 if(i.key()->type()==type) count++;
@@ -202,9 +202,9 int ChartDataSet::seriesCount(QSeries::QSeriesType type)
202 202 return count;
203 203 }
204 204
205 int ChartDataSet::seriesIndex(QSeries *series)
205 int ChartDataSet::seriesIndex(QAbstractSeries *series)
206 206 {
207 QMapIterator<int, QSeries*> i(m_indexSeriesMap);
207 QMapIterator<int, QAbstractSeries*> i(m_indexSeriesMap);
208 208 while (i.hasNext()) {
209 209 i.next();
210 210 if (i.value() == series)
@@ -213,13 +213,13 int ChartDataSet::seriesIndex(QSeries *series)
213 213 return -1;
214 214 }
215 215
216 QChartAxis* ChartDataSet::axisY(QSeries* series) const
216 QChartAxis* ChartDataSet::axisY(QAbstractSeries *series) const
217 217 {
218 218 if(series == 0) return m_axisY;
219 219 return m_seriesAxisMap.value(series);
220 220 }
221 221
222 Domain* ChartDataSet::domain(QSeries* series) const
222 Domain* ChartDataSet::domain(QAbstractSeries *series) const
223 223 {
224 224 QChartAxis* axis = m_seriesAxisMap.value(series);
225 225 if(axis){
@@ -30,7 +30,7
30 30 #ifndef CHARTDATASET_P_H
31 31 #define CHARTDATASET_P_H
32 32
33 #include "qseries.h"
33 #include "qabstractseries.h"
34 34 #include "domain_p.h"
35 35 #include <QVector>
36 36
@@ -46,38 +46,38 public:
46 46 ChartDataSet(QObject* parent=0);
47 47 virtual ~ChartDataSet();
48 48
49 void addSeries(QSeries* series,QChartAxis *axisY = 0);
50 QChartAxis* removeSeries(QSeries* series);
49 void addSeries(QAbstractSeries* series,QChartAxis *axisY = 0);
50 QChartAxis* removeSeries(QAbstractSeries* series);
51 51 void removeAllSeries();
52 52
53 53 void zoomInDomain(const QRectF& rect, const QSizeF& size);
54 54 void zoomOutDomain(const QRectF& rect, const QSizeF& size);
55 55 void scrollDomain(int dx,int dy,const QSizeF& size);
56 56
57 int seriesCount(QSeries::QSeriesType type);
58 int seriesIndex(QSeries *series);
57 int seriesCount(QAbstractSeries::QSeriesType type);
58 int seriesIndex(QAbstractSeries *series);
59 59
60 Domain* domain(QSeries* series) const;
60 Domain* domain(QAbstractSeries* series) const;
61 61 Domain* domain(QChartAxis* axis) const;
62 62
63 63 QChartAxis* axisX() const { return m_axisX; }
64 QChartAxis* axisY(QSeries* series = 0) const;
64 QChartAxis* axisY(QAbstractSeries *series = 0) const;
65 65
66 66 Q_SIGNALS:
67 void seriesAdded(QSeries* series,Domain* domain);
68 void seriesRemoved(QSeries* series);
67 void seriesAdded(QAbstractSeries* series, Domain* domain);
68 void seriesRemoved(QAbstractSeries* series);
69 69 void axisAdded(QChartAxis* axis,Domain* domain);
70 70 void axisRemoved(QChartAxis* axis);
71 71
72 72 private:
73 73 QStringList createLabels(QChartAxis* axis,qreal min, qreal max);
74 void calculateDomain(QSeries* series,Domain* domain);
74 void calculateDomain(QAbstractSeries* series,Domain* domain);
75 75 void setupCategories(QBarSeries* series);
76 76
77 77 private:
78 QMap<QSeries*, QChartAxis*> m_seriesAxisMap;
78 QMap<QAbstractSeries *, QChartAxis *> m_seriesAxisMap;
79 79 QMap<QChartAxis*, Domain*> m_axisDomainMap;
80 QMap<int,QSeries*> m_indexSeriesMap;
80 QMap<int, QAbstractSeries *> m_indexSeriesMap;
81 81 QChartAxis* m_axisX;
82 82 QChartAxis* m_axisY;
83 83
@@ -24,7 +24,7
24 24 #include "chartdataset_p.h"
25 25 #include "charttheme_p.h"
26 26 #include "chartanimator_p.h"
27 #include "qseries_p.h"
27 #include "qabstractseries_p.h"
28 28 #include "qareaseries.h"
29 29 #include "axis_p.h"
30 30 #include "areachartitem_p.h"
@@ -146,7 +146,7 void ChartPresenter::handleAxisRemoved(QChartAxis* axis)
146 146 }
147 147
148 148
149 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain)
149 void ChartPresenter::handleSeriesAdded(QAbstractSeries* series,Domain* domain)
150 150 {
151 151 Chart *item = series->d_ptr->createGraphics(this);
152 152 Q_ASSERT(item);
@@ -158,13 +158,13 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain)
158 158 m_chartItems.insert(series,item);
159 159 }
160 160
161 void ChartPresenter::handleSeriesRemoved(QSeries* series)
161 void ChartPresenter::handleSeriesRemoved(QAbstractSeries* series)
162 162 {
163 163 Chart* item = m_chartItems.take(series);
164 164 Q_ASSERT(item);
165 165 if(m_animator) {
166 166 //small hack to handle area animations
167 if(series->type()==QSeries::SeriesTypeArea){
167 if(series->type() == QAbstractSeries::SeriesTypeArea){
168 168 QAreaSeries* areaSeries = static_cast<QAreaSeries*>(series);
169 169 AreaChartItem* area = static_cast<AreaChartItem*>(item);
170 170 m_animator->removeAnimation(area->upperLineItem());
@@ -208,13 +208,13 void ChartPresenter::setAnimationOptions(QChart::AnimationOptions options)
208 208 void ChartPresenter::resetAllElements()
209 209 {
210 210 QList<QChartAxis*> axisList = m_axisItems.uniqueKeys();
211 QList<QSeries*> seriesList = m_chartItems.uniqueKeys();
211 QList<QAbstractSeries *> seriesList = m_chartItems.uniqueKeys();
212 212
213 213 foreach(QChartAxis* axis, axisList) {
214 214 handleAxisRemoved(axis);
215 215 handleAxisAdded(axis,m_dataset->domain(axis));
216 216 }
217 foreach(QSeries* series, seriesList) {
217 foreach(QAbstractSeries *series, seriesList) {
218 218 handleSeriesRemoved(series);
219 219 handleSeriesAdded(series,m_dataset->domain(series));
220 220 }
@@ -30,7 +30,7
30 30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
31 31
32 32 class Chart;
33 class QSeries;
33 class QAbstractSeries;
34 34 class ChartDataSet;
35 35 class Domain;
36 36 class Axis;
@@ -87,8 +87,8 public: //TODO: fix me
87 87 QRectF margins() const { return m_chartMargins;}
88 88
89 89 public Q_SLOTS:
90 void handleSeriesAdded(QSeries* series,Domain* domain);
91 void handleSeriesRemoved(QSeries* series);
90 void handleSeriesAdded(QAbstractSeries* series,Domain* domain);
91 void handleSeriesRemoved(QAbstractSeries* series);
92 92 void handleAxisAdded(QChartAxis* axis,Domain* domain);
93 93 void handleAxisRemoved(QChartAxis* axis);
94 94 void updateLayout();
@@ -102,7 +102,7 private:
102 102 ChartAnimator* m_animator;
103 103 ChartDataSet* m_dataset;
104 104 ChartTheme *m_chartTheme;
105 QMap<QSeries*,Chart*> m_chartItems;
105 QMap<QAbstractSeries *, Chart *> m_chartItems;
106 106 QMap<QChartAxis*,Axis*> m_axisItems;
107 107 QRectF m_rect;
108 108 QRectF m_chartRect;
@@ -29,7 +29,6
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 31 class ChartItem;
32 class QSeries;
33 32 class LineChartItem;
34 33 class QLineSeries;
35 34 class BarChartItem;
@@ -35,7 +35,7
35 35
36 36 QTCOMMERCIALCHART_BEGIN_NAMESPACE
37 37
38 LegendMarker::LegendMarker(QSeries* series,QLegend *legend) : QGraphicsObject(legend),
38 LegendMarker::LegendMarker(QAbstractSeries *series, QLegend *legend) : QGraphicsObject(legend),
39 39 m_series(series),
40 40 m_markerRect(0,0,10.0,10.0),
41 41 m_boundingRect(0,0,0,0),
@@ -179,7 +179,7 void XYLegendMarker::updated()
179 179 {
180 180 setLabel(m_series->name());
181 181
182 if(m_series->type()== QSeries::SeriesTypeScatter)
182 if(m_series->type()== QAbstractSeries::SeriesTypeScatter)
183 183 {
184 184 setBrush(m_series->brush());
185 185
@@ -29,7 +29,7
29 29
30 30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
31 31
32 class QSeries;
32 class QAbstractSeries;
33 33 class QAreaSeries;
34 34 class QXYSeries;
35 35 class QBarSet;
@@ -43,7 +43,7 class LegendMarker : public QGraphicsObject
43 43 Q_OBJECT
44 44
45 45 public:
46 explicit LegendMarker(QSeries* m_series,QLegend *parent);
46 explicit LegendMarker(QAbstractSeries *m_series, QLegend *parent);
47 47
48 48 void setPen(const QPen &pen);
49 49 QPen pen() const;
@@ -55,7 +55,7 public:
55 55 void setLabel(const QString label);
56 56 QString label() const;
57 57
58 QSeries* series() const { return m_series;}
58 QAbstractSeries *series() const { return m_series;}
59 59
60 60 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
61 61
@@ -74,7 +74,7 public Q_SLOTS:
74 74 virtual void updated() = 0;
75 75
76 76 protected:
77 QSeries* m_series;
77 QAbstractSeries *m_series;
78 78 QRectF m_markerRect;
79 79 QRectF m_boundingRect;
80 80 QLegend* m_legend;
@@ -20,8 +20,8
20 20
21 21 #include "qlegend.h"
22 22 #include "qlegend_p.h"
23 #include "qseries.h"
24 #include "qseries_p.h"
23 #include "qabstractseries.h"
24 #include "qabstractseries_p.h"
25 25 #include "qchart_p.h"
26 26
27 27 #include "legendmarker_p.h"
@@ -56,7 +56,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
56 56
57 57 \mainclass
58 58
59 \sa QChart, QSeries
59 \sa QChart, QAbstractSeries
60 60 */
61 61
62 62 /*!
@@ -91,8 +91,8 d_ptr(new QLegendPrivate(chart->d_ptr->m_presenter,this))
91 91 setFlags(QGraphicsItem::ItemClipsChildrenToShape);
92 92 setEnabled(false); // By default legend is disabled
93 93 setVisible(false);
94 QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesAdded(QSeries*,Domain*)),d_ptr.data(),SLOT(handleSeriesAdded(QSeries*,Domain*)));
95 QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesRemoved(QSeries*)),d_ptr.data(),SLOT(handleSeriesRemoved(QSeries*)));
94 QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesAdded(QAbstractSeries *, Domain *)),d_ptr.data(),SLOT(handleSeriesAdded(QAbstractSeries *,Domain*)));
95 QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesRemoved(QAbstractSeries *)),d_ptr.data(),SLOT(handleSeriesRemoved(QAbstractSeries *)));
96 96 }
97 97
98 98 QLegend::~QLegend()
@@ -396,7 +396,7 void QLegendPrivate::updateLayout()
396 396 m_presenter->updateLayout();
397 397 }
398 398
399 void QLegendPrivate::handleSeriesAdded(QSeries *series, Domain *domain)
399 void QLegendPrivate::handleSeriesAdded(QAbstractSeries *series, Domain *domain)
400 400 {
401 401 Q_UNUSED(domain)
402 402
@@ -404,7 +404,7 void QLegendPrivate::handleSeriesAdded(QSeries *series, Domain *domain)
404 404 foreach(LegendMarker* marker , markers)
405 405 m_markers->addToGroup(marker);
406 406
407 if(series->type()==QSeries::SeriesTypePie)
407 if(series->type() == QAbstractSeries::SeriesTypePie)
408 408 {
409 409 QPieSeries *pieSeries = static_cast<QPieSeries *>(series);
410 410 QObject::connect(pieSeries,SIGNAL(added(QList<QPieSlice*>)),this,SLOT(handleUpdateSeries()));
@@ -414,7 +414,7 void QLegendPrivate::handleSeriesAdded(QSeries *series, Domain *domain)
414 414 updateLayout();
415 415 }
416 416
417 void QLegendPrivate::handleSeriesRemoved(QSeries *series)
417 void QLegendPrivate::handleSeriesRemoved(QAbstractSeries *series)
418 418 {
419 419
420 420 QList<QGraphicsItem *> items = m_markers->childItems();
@@ -426,7 +426,7 void QLegendPrivate::handleSeriesRemoved(QSeries *series)
426 426 }
427 427 }
428 428
429 if(series->type()==QSeries::SeriesTypePie)
429 if(series->type() == QAbstractSeries::SeriesTypePie)
430 430 {
431 431 QPieSeries *pieSeries = static_cast<QPieSeries *>(series);
432 432 QObject::disconnect(pieSeries,SIGNAL(added(QList<QPieSlice*>)),this,SLOT(handleUpdateSeries()));
@@ -439,7 +439,7 void QLegendPrivate::handleSeriesRemoved(QSeries *series)
439 439 void QLegendPrivate::handleUpdateSeries()
440 440 {
441 441 //TODO: reimplement to be optimal
442 QSeries* series = qobject_cast<QSeries *> (sender());
442 QAbstractSeries* series = qobject_cast<QAbstractSeries *> (sender());
443 443 Q_ASSERT(series);
444 444 handleSeriesRemoved(series);
445 445 handleSeriesAdded(series,0);
@@ -37,8 +37,6 class QBarSeries;
37 37 class QPieSeries;
38 38 class QAreaSeries;
39 39 class LegendScrollButton;
40 class QSeries;
41
42 40 class QChart;
43 41 class QLegendPrivate;
44 42
@@ -35,6 +35,7
35 35 QTCOMMERCIALCHART_BEGIN_NAMESPACE
36 36
37 37 class ChartPresenter;
38 class QAbstractSeries;
38 39
39 40 class QLegendPrivate : public QObject
40 41 {
@@ -47,8 +48,8 public:
47 48 void updateLayout();
48 49
49 50 public Q_SLOTS:
50 void handleSeriesAdded(QSeries *series, Domain *domain);
51 void handleSeriesRemoved(QSeries *series);
51 void handleSeriesAdded(QAbstractSeries *series, Domain *domain);
52 void handleSeriesRemoved(QAbstractSeries *series);
52 53 void handleUpdateSeries(); //TODO remove this function
53 54
54 55 private:
@@ -51,7 +51,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
51 51 /*!
52 52 \fn virtual QSeriesType QLineSeries::type() const
53 53 \brief Returns type of series.
54 \sa QSeries, QSeriesType
54 \sa QAbstractSeries, QSeriesType
55 55 */
56 56
57 57 /*!
@@ -78,9 +78,9 QLineSeries::~QLineSeries()
78 78 {
79 79 }
80 80
81 QSeries::QSeriesType QLineSeries::type() const
81 QAbstractSeries::QSeriesType QLineSeries::type() const
82 82 {
83 return QSeries::SeriesTypeLine;
83 return QAbstractSeries::SeriesTypeLine;
84 84 }
85 85
86 86 /*
@@ -35,7 +35,7 public:
35 35 explicit QLineSeries(QObject *parent = 0);
36 36 ~QLineSeries();
37 37
38 QSeries::QSeriesType type() const;
38 QAbstractSeries::QSeriesType type() const;
39 39
40 40 protected:
41 41 QLineSeries(QLineSeriesPrivate &d,QObject *parent = 0);
@@ -112,7 +112,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
112 112 Constructs a series object which is a child of \a parent.
113 113 */
114 114 QPieSeries::QPieSeries(QObject *parent) :
115 QSeries(*new QPieSeriesPrivate(this),parent)
115 QAbstractSeries(*new QPieSeriesPrivate(this),parent)
116 116 {
117 117
118 118 }
@@ -128,9 +128,9 QPieSeries::~QPieSeries()
128 128 /*!
129 129 Returns QChartSeries::SeriesTypePie.
130 130 */
131 QSeries::QSeriesType QPieSeries::type() const
131 QAbstractSeries::QSeriesType QPieSeries::type() const
132 132 {
133 return QSeries::SeriesTypePie;
133 return QAbstractSeries::SeriesTypePie;
134 134 }
135 135
136 136 /*!
@@ -521,8 +521,8 void QPieSeries::setModelMapping(int modelValuesLine, int modelLabelsLine, Qt::O
521 521 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
522 522
523 523
524 QPieSeriesPrivate::QPieSeriesPrivate(QPieSeries *parent)
525 :QSeriesPrivate(parent),
524 QPieSeriesPrivate::QPieSeriesPrivate(QPieSeries *parent) :
525 QAbstractSeriesPrivate(parent),
526 526 m_pieRelativeHorPos(0.5),
527 527 m_pieRelativeVerPos(0.5),
528 528 m_pieRelativeSize(0.7),
@@ -21,13 +21,13
21 21 #ifndef PIESERIES_H
22 22 #define PIESERIES_H
23 23
24 #include <qseries.h>
24 #include <qabstractseries.h>
25 25
26 26 QTCOMMERCIALCHART_BEGIN_NAMESPACE
27 27 class QPieSeriesPrivate;
28 28 class QPieSlice;
29 29
30 class QTCOMMERCIALCHART_EXPORT QPieSeries : public QSeries
30 class QTCOMMERCIALCHART_EXPORT QPieSeries : public QAbstractSeries
31 31 {
32 32 Q_OBJECT
33 33 Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition)
@@ -22,13 +22,13
22 22 #define QPIESERIES_P_H
23 23
24 24 #include "qpieseries.h"
25 #include "qseries_p.h"
25 #include "qabstractseries_p.h"
26 26
27 27 class QModelIndex;
28 28
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 class QPieSeriesPrivate : public QSeriesPrivate
31 class QPieSeriesPrivate : public QAbstractSeriesPrivate
32 32 {
33 33 Q_OBJECT
34 34
@@ -18,13 +18,13
18 18 **
19 19 ****************************************************************************/
20 20
21 #include "qseries.h"
22 #include "qseries_p.h"
21 #include "qabstractseries.h"
22 #include "qabstractseries_p.h"
23 23
24 24 QTCOMMERCIALCHART_BEGIN_NAMESPACE
25 25
26 26 /*!
27 \class QSeries
27 \class QAbstractSeries
28 28 \brief Base class for all QtCommercial Chart series.
29 29 \mainclass
30 30
@@ -34,7 +34,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
34 34 */
35 35
36 36 /*!
37 \enum QSeries::QSeriesType
37 \enum QAbstractSeries::QSeriesType
38 38
39 39 The type of the series object.
40 40
@@ -49,12 +49,12 QTCOMMERCIALCHART_BEGIN_NAMESPACE
49 49 */
50 50
51 51 /*!
52 \fn QSeriesType QSeries::type() const
52 \fn QSeriesType QAbstractSeries::type() const
53 53 \brief The type of the series.
54 54 */
55 55
56 56 /*!
57 \fn bool QSeries::setModel(QAbstractItemModel *model)
57 \fn bool QAbstractSeries::setModel(QAbstractItemModel *model)
58 58 \brief Use the \a model to provide data for the series. The model overrides possible user data
59 59 set with QChartSeries type specific data setters. For example if you call both
60 60 QScatterSeries::addData() and QScatterSeries::setModel, only the data provided by the model is
@@ -62,12 +62,12 QTCOMMERCIALCHART_BEGIN_NAMESPACE
62 62 */
63 63
64 64 /*!
65 \property QSeries::name
65 \property QAbstractSeries::name
66 66 \brief name of the series property
67 67 */
68 68
69 69 /*!
70 \fn void QSeries::setName(const QString& name)
70 \fn void QAbstractSeries::setName(const QString& name)
71 71 \brief Sets a \a name for the series.
72 72
73 73 The name of a series is shown in the legend for QXYSeries.
@@ -80,7 +80,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
80 80 \internal
81 81 \brief Constructs ChartSeries object with \a parent.
82 82 */
83 QSeries::QSeries(QSeriesPrivate &d, QObject *parent) :
83 QAbstractSeries::QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent) :
84 84 QObject(parent),
85 85 d_ptr(&d)
86 86 {
@@ -89,19 +89,19 QSeries::QSeries(QSeriesPrivate &d, QObject *parent) :
89 89 /*!
90 90 \brief Virtual destructor for the chart series.
91 91 */
92 QSeries::~QSeries()
92 QAbstractSeries::~QAbstractSeries()
93 93 {
94 94 }
95 95
96 96 /*!
97 97 \brief Returns the pointer to the model that is used as the series data source
98 98 */
99 QAbstractItemModel* QSeries::model() const
99 QAbstractItemModel* QAbstractSeries::model() const
100 100 {
101 101 return d_ptr->m_model;
102 102 }
103 103
104 void QSeries::setName(const QString& name)
104 void QAbstractSeries::setName(const QString& name)
105 105 {
106 106 d_ptr->m_name = name;
107 107 }
@@ -110,23 +110,23 void QSeries::setName(const QString& name)
110 110 \brief Returns the name of the series.
111 111 \sa setName()
112 112 */
113 QString QSeries::name() const
113 QString QAbstractSeries::name() const
114 114 {
115 115 return d_ptr->m_name;
116 116 }
117 117
118 118 ///////////////////////////////////////////////////////////////////////////////////////////////////
119 119
120 QSeriesPrivate::QSeriesPrivate(QSeries* q): q_ptr(q),m_model(0)
120 QAbstractSeriesPrivate::QAbstractSeriesPrivate(QAbstractSeries* q): q_ptr(q),m_model(0)
121 121 {
122 122 }
123 123
124 QSeriesPrivate::~QSeriesPrivate()
124 QAbstractSeriesPrivate::~QAbstractSeriesPrivate()
125 125 {
126 126 }
127 127
128 #include "moc_qseries.cpp"
129 #include "moc_qseries_p.cpp"
128 #include "moc_qabstractseries.cpp"
129 #include "moc_qabstractseries_p.cpp"
130 130
131 131 QTCOMMERCIALCHART_END_NAMESPACE
132 132
@@ -18,8 +18,8
18 18 **
19 19 ****************************************************************************/
20 20
21 #ifndef QSERIES_H
22 #define QSERIES_H
21 #ifndef QABSTRACTSERIES_H
22 #define QABSTRACTSERIES_H
23 23
24 24 #include <qchartglobal.h>
25 25 #include <QObject>
@@ -29,9 +29,9 class QAbstractItemModel;
29 29
30 30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
31 31
32 class QSeriesPrivate;
32 class QAbstractSeriesPrivate;
33 33
34 class QTCOMMERCIALCHART_EXPORT QSeries : public QObject
34 class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject
35 35 {
36 36 Q_OBJECT
37 37 Q_PROPERTY(QString name READ name WRITE setName)
@@ -50,10 +50,10 public:
50 50 };
51 51
52 52 protected:
53 QSeries(QSeriesPrivate &d, QObject *parent = 0);
53 QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0);
54 54
55 55 public:
56 ~QSeries();
56 ~QAbstractSeries();
57 57 virtual QSeriesType type() const = 0;
58 58 virtual bool setModel(QAbstractItemModel* model) = 0;
59 59 QAbstractItemModel* model() const;
@@ -61,7 +61,7 public:
61 61 QString name() const;
62 62
63 63 protected:
64 QScopedPointer<QSeriesPrivate> d_ptr;
64 QScopedPointer<QAbstractSeriesPrivate> d_ptr;
65 65 friend class ChartDataSet;
66 66 friend class ChartPresenter;
67 67 friend class QLegendPrivate;
@@ -27,10 +27,10
27 27 //
28 28 // We mean it.
29 29
30 #ifndef QSERIES_P_H
31 #define QSERIES_P_H
30 #ifndef QABSTRACTSERIES_P_H
31 #define QABSTRACTSERIES_P_H
32 32
33 #include "qseries.h"
33 #include "qabstractseries.h"
34 34
35 35 class QAbstractItemModel;
36 36
@@ -42,23 +42,23 class Chart;
42 42 class LegendMarker;
43 43 class QLegend;
44 44
45 class QSeriesPrivate : public QObject
45 class QAbstractSeriesPrivate : public QObject
46 46 {
47 47 Q_OBJECT
48 48 public:
49 QSeriesPrivate(QSeries *q);
50 ~QSeriesPrivate();
49 QAbstractSeriesPrivate(QAbstractSeries *q);
50 ~QAbstractSeriesPrivate();
51 51
52 52 virtual void scaleDomain(Domain& domain) = 0;
53 53 virtual Chart* createGraphics(ChartPresenter* presenter) = 0;
54 54 virtual QList<LegendMarker*> createLegendMarker(QLegend* legend) = 0;
55 55
56 56 protected:
57 QSeries *q_ptr;
57 QAbstractSeries *q_ptr;
58 58 QAbstractItemModel *m_model;
59 59 QString m_name;
60 60
61 friend class QSeries;
61 friend class QAbstractSeries;
62 62 };
63 63
64 64 QTCOMMERCIALCHART_END_NAMESPACE
@@ -91,7 +91,7 QChart::~QChart()
91 91 If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and
92 92 the y axis).
93 93 */
94 void QChart::addSeries(QSeries* series, QChartAxis* axisY)
94 void QChart::addSeries(QAbstractSeries *series, QChartAxis *axisY)
95 95 {
96 96 Q_ASSERT(series);
97 97 d_ptr->m_dataset->addSeries(series, axisY);
@@ -103,7 +103,7 void QChart::addSeries(QSeries* series, QChartAxis* axisY)
103 103 It does not delete the pointed QChartSeries data object
104 104 \sa addSeries(), removeAllSeries()
105 105 */
106 void QChart::removeSeries(QSeries* series)
106 void QChart::removeSeries(QAbstractSeries *series)
107 107 {
108 108 Q_ASSERT(series);
109 109 d_ptr->m_dataset->removeSeries(series);
@@ -282,7 +282,7 QChartAxis* QChart::axisX() const
282 282 Returns the pointer to the y axis object of the \a series
283 283 If no \a series is provided then default Y axis of the chart is returned.
284 284 */
285 QChartAxis* QChart::axisY(QSeries* series) const
285 QChartAxis* QChart::axisY(QAbstractSeries *series) const
286 286 {
287 287 return d_ptr->m_dataset->axisY(series);
288 288 }
@@ -401,8 +401,8 QChartPrivate::~QChartPrivate()
401 401 void QChartPrivate::createConnections()
402 402 {
403 403
404 QObject::connect(m_dataset,SIGNAL(seriesAdded(QSeries*,Domain*)),m_presenter,SLOT(handleSeriesAdded(QSeries*,Domain*)));
405 QObject::connect(m_dataset,SIGNAL(seriesRemoved(QSeries*)),m_presenter,SLOT(handleSeriesRemoved(QSeries*)));
404 QObject::connect(m_dataset,SIGNAL(seriesAdded(QAbstractSeries *, Domain *)),m_presenter,SLOT(handleSeriesAdded(QAbstractSeries *, Domain *)));
405 QObject::connect(m_dataset,SIGNAL(seriesRemoved(QAbstractSeries *)),m_presenter,SLOT(handleSeriesRemoved(QAbstractSeries *)));
406 406 QObject::connect(m_dataset,SIGNAL(axisAdded(QChartAxis*,Domain*)),m_presenter,SLOT(handleAxisAdded(QChartAxis*,Domain*)));
407 407 QObject::connect(m_dataset,SIGNAL(axisRemoved(QChartAxis*)),m_presenter,SLOT(handleAxisRemoved(QChartAxis*)));
408 408 }
@@ -21,7 +21,7
21 21 #ifndef QCHART_H
22 22 #define QCHART_H
23 23
24 #include <QSeries>
24 #include <QAbstractSeries>
25 25 #include <QLegend>
26 26 #include <QGraphicsWidget>
27 27
@@ -29,7 +29,7 class QGraphicsSceneResizeEvent;
29 29
30 30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
31 31
32 class QSeries;
32 class QAbstractSeries;
33 33 class QChartAxis;
34 34 class QLegend;
35 35 struct QChartPrivate;
@@ -63,8 +63,8 public:
63 63 explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
64 64 ~QChart();
65 65
66 void addSeries(QSeries *series, QChartAxis *axisY = 0);
67 void removeSeries(QSeries *series);
66 void addSeries(QAbstractSeries *series, QChartAxis *axisY = 0);
67 void removeSeries(QAbstractSeries *series);
68 68 void removeAllSeries();
69 69
70 70 void setTheme(QChart::ChartTheme theme);
@@ -97,7 +97,7 public:
97 97 void scrollDown();
98 98
99 99 QChartAxis* axisX() const;
100 QChartAxis* axisY(QSeries* series = 0) const;
100 QChartAxis* axisY(QAbstractSeries* series = 0) const;
101 101
102 102 QLegend* legend() const;
103 103 QRectF margins() const;
@@ -22,7 +22,7
22 22 #define QCHARTVIEW_H
23 23
24 24 #include <QChartAxis>
25 #include <QSeries>
25 #include <QAbstractSeries>
26 26 #include <QChart>
27 27 #include <QGraphicsView>
28 28
@@ -58,7 +58,7
58 58 /*!
59 59 \fn QChartSeriesType QScatterSeries::type() const
60 60 \brief Returns QChartSeries::SeriesTypeScatter.
61 \sa QSeries, QSeriesType
61 \sa QAbstractSeries, QSeriesType
62 62 */
63 63
64 64 QTCOMMERCIALCHART_BEGIN_NAMESPACE
@@ -77,9 +77,9 QScatterSeries::~QScatterSeries()
77 77 {
78 78 }
79 79
80 QSeries::QSeriesType QScatterSeries::type() const
80 QAbstractSeries::QSeriesType QScatterSeries::type() const
81 81 {
82 return QSeries::SeriesTypeScatter;
82 return QAbstractSeries::SeriesTypeScatter;
83 83 }
84 84
85 85 /*!
@@ -41,7 +41,7 public:
41 41 explicit QScatterSeries(QObject *parent = 0);
42 42 ~QScatterSeries();
43 43
44 QSeries::QSeriesType type() const;
44 QAbstractSeries::QSeriesType type() const;
45 45
46 46 MarkerShape shape() const;
47 47 void setShape(MarkerShape shape);
@@ -55,9 +55,9 QSplineSeries::QSplineSeries(QObject *parent) :
55 55 {
56 56 }
57 57
58 QSeries::QSeriesType QSplineSeries::type() const
58 QAbstractSeries::QSeriesType QSplineSeries::type() const
59 59 {
60 return QSeries::SeriesTypeSpline;
60 return QAbstractSeries::SeriesTypeSpline;
61 61 }
62 62
63 63 QPointF QSplineSeries::controlPoint(int index) const
@@ -37,7 +37,7 class QTCOMMERCIALCHART_EXPORT QSplineSeries : public QLineSeries
37 37 public:
38 38
39 39 explicit QSplineSeries(QObject *parent = 0);
40 QSeries::QSeriesType type() const;
40 QAbstractSeries::QSeriesType type() const;
41 41
42 42 QPointF controlPoint(int index) const;
43 43 void setModelMappingRange(int first, int count);
@@ -14,7 +14,7 SOURCES += \
14 14 $$PWD/domain.cpp \
15 15 $$PWD/qchart.cpp \
16 16 $$PWD/qchartview.cpp \
17 $$PWD/qseries.cpp \
17 $$PWD/qabstractseries.cpp \
18 18 $$PWD/chartbackground.cpp \
19 19 $$PWD/chart.cpp \
20 20 $$PWD/scroller.cpp
@@ -30,11 +30,11 PRIVATE_HEADERS += \
30 30 $$PWD/qchart_p.h \
31 31 $$PWD/qchartview_p.h \
32 32 $$PWD/scroller_p.h \
33 $$PWD/qseries_p.h
33 $$PWD/qabstractseries_p.h
34 34 PUBLIC_HEADERS += \
35 35 $$PWD/qchart.h \
36 36 $$PWD/qchartglobal.h \
37 $$PWD/qseries.h \
37 $$PWD/qabstractseries.h \
38 38 $$PWD/qchartview.h
39 39
40 40 include(animations/animations.pri)
@@ -94,7 +94,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
94 94 Constructs empty series object which is a child of \a parent.
95 95 When series object is added to QChartView or QChart instance ownerships is transferred.
96 96 */
97 QXYSeries::QXYSeries(QXYSeriesPrivate &d,QObject *parent):QSeries(d,parent)
97 QXYSeries::QXYSeries(QXYSeriesPrivate &d,QObject *parent) : QAbstractSeries(d, parent)
98 98 {
99 99
100 100 }
@@ -622,7 +622,7 int QXYSeries::mapCount() const
622 622
623 623 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
624 624
625 QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q): QSeriesPrivate(q),
625 QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q) : QAbstractSeriesPrivate(q),
626 626 m_mapX(-1),
627 627 m_mapY(-1),
628 628 m_mapFirst(0),
@@ -631,7 +631,6 m_mapLimited(false),
631 631 m_mapOrientation( Qt::Vertical),
632 632 m_pointsVisible(false)
633 633 {
634
635 634 }
636 635
637 636 void QXYSeriesPrivate::scaleDomain(Domain& domain)
@@ -22,7 +22,7
22 22 #define QXYSERIES_H
23 23
24 24 #include <qchartglobal.h>
25 #include <qseries.h>
25 #include <qabstractseries.h>
26 26 #include <QPen>
27 27 #include <QBrush>
28 28
@@ -32,7 +32,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
32 32
33 33 class QXYSeriesPrivate;
34 34
35 class QTCOMMERCIALCHART_EXPORT QXYSeries : public QSeries
35 class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries
36 36 {
37 37 Q_OBJECT
38 38 protected:
@@ -30,13 +30,13
30 30 #ifndef QXYSERIES_P_H
31 31 #define QXYSERIES_P_H
32 32
33 #include "qseries_p.h"
33 #include "qabstractseries_p.h"
34 34
35 35 QTCOMMERCIALCHART_BEGIN_NAMESPACE
36 36
37 37 class QXYSeries;
38 38
39 class QXYSeriesPrivate: public QSeriesPrivate
39 class QXYSeriesPrivate: public QAbstractSeriesPrivate
40 40 {
41 41 Q_OBJECT
42 42
@@ -28,7 +28,7 QTCOMMERCIALCHART_USE_NAMESPACE
28 28
29 29 Q_DECLARE_METATYPE(Domain*)
30 30 Q_DECLARE_METATYPE(QChartAxis*)
31 Q_DECLARE_METATYPE(QSeries*)
31 Q_DECLARE_METATYPE(QAbstractSeries *)
32 32 Q_DECLARE_METATYPE(QLineSeries*)
33 33
34 34 class tst_ChartDataSet: public QObject {
@@ -138,8 +138,8 void tst_ChartDataSet::addSeries()
138 138
139 139 QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*)));
140 140 QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*)));
141 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*)));
142 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*)));
141 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *,Domain*)));
142 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *)));
143 143
144 144 dataSet.addSeries(series0,axis0);
145 145 dataSet.addSeries(series1,axis1);
@@ -182,8 +182,8 void tst_ChartDataSet::removeSeries()
182 182
183 183 QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*)));
184 184 QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*)));
185 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*)));
186 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*)));
185 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *)));
186 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *)));
187 187
188 188 dataSet.removeSeries(series0);
189 189 dataSet.removeSeries(series1);
@@ -219,8 +219,8 void tst_ChartDataSet::removeAllSeries()
219 219
220 220 QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*)));
221 221 QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*)));
222 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*)));
223 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*)));
222 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *)));
223 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *)));
224 224
225 225 dataSet.removeAllSeries();
226 226
@@ -295,8 +295,8 void tst_ChartDataSet::seriesCount()
295 295
296 296 QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*)));
297 297 QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*)));
298 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*)));
299 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*)));
298 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *)));
299 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *)));
300 300
301 301 QCOMPARE(dataSet.seriesCount(series0->type()),3);
302 302 QCOMPARE(spy0.count(), 0);
@@ -424,8 +424,8 void tst_ChartDataSet::domain()
424 424
425 425 QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*)));
426 426 QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*)));
427 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*)));
428 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*)));
427 QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *)));
428 QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *)));
429 429
430 430 QVERIFY(dataSet.domain(axis0)==dataSet.domain(series0));
431 431 QVERIFY(dataSet.domain(axis1)==dataSet.domain(series1));
@@ -12,7 +12,7
12 12 QTCOMMERCIALCHART_USE_NAMESPACE
13 13
14 14 Q_DECLARE_METATYPE(QChartAxis*)
15 Q_DECLARE_METATYPE(QSeries*)
15 Q_DECLARE_METATYPE(QAbstractSeries *)
16 16 Q_DECLARE_METATYPE(QChart::AnimationOption)
17 17 Q_DECLARE_METATYPE(QBrush)
18 18 Q_DECLARE_METATYPE(QPen)
@@ -156,17 +156,17 void tst_QChart::qchart()
156 156
157 157 void tst_QChart::addSeries_data()
158 158 {
159 QTest::addColumn<QSeries*>("series");
159 QTest::addColumn<QAbstractSeries *>("series");
160 160 QTest::addColumn<QChartAxis*>("axis");
161 161
162 QSeries* series0 = new QLineSeries(this);
163 QSeries* series1 = new QAreaSeries(static_cast<QLineSeries*>(series0));
164 QSeries* series2 = new QScatterSeries(this);
165 QSeries* series3 = new QSplineSeries(this);
166 QSeries* series4 = new QPieSeries(this);
167 QSeries* series5 = new QBarSeries(QBarCategories(),this);
168 QSeries* series6 = new QPercentBarSeries(QBarCategories(),this);
169 QSeries* series7 = new QStackedBarSeries(QBarCategories(),this);
162 QAbstractSeries* series0 = new QLineSeries(this);
163 QAbstractSeries* series1 = new QAreaSeries(static_cast<QLineSeries*>(series0));
164 QAbstractSeries* series2 = new QScatterSeries(this);
165 QAbstractSeries* series3 = new QSplineSeries(this);
166 QAbstractSeries* series4 = new QPieSeries(this);
167 QAbstractSeries* series5 = new QBarSeries(QBarCategories(),this);
168 QAbstractSeries* series6 = new QPercentBarSeries(QBarCategories(),this);
169 QAbstractSeries* series7 = new QStackedBarSeries(QBarCategories(),this);
170 170
171 171 QChartAxis* axis = new QChartAxis(this);
172 172
@@ -191,7 +191,7 void tst_QChart::addSeries_data()
191 191
192 192 void tst_QChart::addSeries()
193 193 {
194 QFETCH(QSeries*, series);
194 QFETCH(QAbstractSeries *, series);
195 195 QFETCH(QChartAxis*, axis);
196 196 m_view->show();
197 197 QTest::qWaitForWindowShown(m_view);
@@ -384,7 +384,7 void tst_QChart::removeSeries_data()
384 384
385 385 void tst_QChart::removeSeries()
386 386 {
387 QFETCH(QSeries*, series);
387 QFETCH(QAbstractSeries *, series);
388 388 QFETCH(QChartAxis*, axis);
389 389 m_view->show();
390 390 QTest::qWaitForWindowShown(m_view);
@@ -31,7 +31,6 class CustomTableModel;
31 31 class QTableView;
32 32 class QRadioButton;
33 33 class QSpinBox;
34 //class QSeries;
35 34
36 35 class TableWidget : public QWidget
37 36 {
General Comments 0
You need to be logged in to leave comments. Login now