@@ -0,0 +1,6 | |||||
|
1 | #include "qsplineseries.h" | |||
|
2 | ||||
|
3 | QSplineSeries::QSplineSeries(QObject *parent) : | |||
|
4 | QObject(parent) | |||
|
5 | { | |||
|
6 | } |
@@ -0,0 +1,24 | |||||
|
1 | #ifndef QSPLINESERIES_H | |||
|
2 | #define QSPLINESERIES_H | |||
|
3 | ||||
|
4 | #include "qchartseries.h" | |||
|
5 | ||||
|
6 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
7 | ||||
|
8 | class QSplineSeries : public QChartSeries | |||
|
9 | { | |||
|
10 | Q_OBJECT | |||
|
11 | public: | |||
|
12 | explicit QSplineSeries(QObject *parent = 0); | |||
|
13 | ||||
|
14 | public: // from QChartSeries | |||
|
15 | QChartSeriesType type() const { return QChartSeries::SeriesTypeSpline; } | |||
|
16 | signals: | |||
|
17 | ||||
|
18 | public slots: | |||
|
19 | ||||
|
20 | }; | |||
|
21 | ||||
|
22 | QTCOMMERCIALCHART_END_NAMESPACE | |||
|
23 | ||||
|
24 | #endif // QSPLINESERIES_H |
@@ -0,0 +1,15 | |||||
|
1 | INCLUDEPATH += $$PWD | |||
|
2 | DEPENDPATH += $$PWD | |||
|
3 | ||||
|
4 | SOURCES += \ | |||
|
5 | $$PWD/qsplineseries.cpp \ | |||
|
6 | splinechart/splinepresenter.cpp | |||
|
7 | ||||
|
8 | PRIVATE_HEADERS += | |||
|
9 | ||||
|
10 | PUBLIC_HEADERS += \ | |||
|
11 | $$PWD/qsplineseries.h | |||
|
12 | ||||
|
13 | HEADERS += \ | |||
|
14 | splinechart/qsplineseries.h \ | |||
|
15 | splinechart/splinepresenter_p.h |
@@ -0,0 +1,16 | |||||
|
1 | #include "splinepresenter_p.h" | |||
|
2 | ||||
|
3 | SplinePresenter::SplinePresenter(QObject *parent) : | |||
|
4 | QObject(parent) | |||
|
5 | { | |||
|
6 | } | |||
|
7 | ||||
|
8 | void SplinePresenter::handleGeometryChanged(const QRectF&) | |||
|
9 | { | |||
|
10 | // | |||
|
11 | } | |||
|
12 | ||||
|
13 | void SplinePresenter::handleDomainChanged(const Domain& domain) | |||
|
14 | { | |||
|
15 | // | |||
|
16 | } |
@@ -0,0 +1,26 | |||||
|
1 | #ifndef SPLINEPRESENTER_P_H | |||
|
2 | #define SPLINEPRESENTER_P_H | |||
|
3 | ||||
|
4 | #include "chartitem_p.h" | |||
|
5 | #include <QObject> | |||
|
6 | ||||
|
7 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
8 | ||||
|
9 | class SplinePresenter : public QObject, public ChartItem | |||
|
10 | { | |||
|
11 | Q_OBJECT | |||
|
12 | public: | |||
|
13 | SplinePresenter(QObject *parent = 0); | |||
|
14 | ||||
|
15 | void handleGeometryChanged(const QRectF&); | |||
|
16 | void handleDomainChanged(const Domain& domain); | |||
|
17 | ||||
|
18 | signals: | |||
|
19 | ||||
|
20 | public slots: | |||
|
21 | ||||
|
22 | }; | |||
|
23 | ||||
|
24 | QTCOMMERCIALCHART_END_NAMESPACE | |||
|
25 | ||||
|
26 | #endif // SPLINEPRESENTER_P_H |
@@ -10,6 +10,7 | |||||
10 | #include "qlinechartseries.h" |
|
10 | #include "qlinechartseries.h" | |
11 | #include "qpieseries.h" |
|
11 | #include "qpieseries.h" | |
12 | #include "qscatterseries.h" |
|
12 | #include "qscatterseries.h" | |
|
13 | #include "qsplineseries.h" | |||
13 | //items |
|
14 | //items | |
14 | #include "axisitem_p.h" |
|
15 | #include "axisitem_p.h" | |
15 | #include "barpresenter.h" |
|
16 | #include "barpresenter.h" | |
@@ -19,6 +20,7 | |||||
19 | #include "linechartanimationitem_p.h" |
|
20 | #include "linechartanimationitem_p.h" | |
20 | #include "piepresenter.h" |
|
21 | #include "piepresenter.h" | |
21 | #include "scatterpresenter_p.h" |
|
22 | #include "scatterpresenter_p.h" | |
|
23 | #include "splinepresenter_p.h" | |||
22 |
|
24 | |||
23 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
25 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
24 |
|
26 | |||
@@ -162,6 +164,11 void ChartPresenter::handleSeriesAdded(QChartSeries* series) | |||||
162 | m_chartItems.insert(series, pie); |
|
164 | m_chartItems.insert(series, pie); | |
163 | break; |
|
165 | break; | |
164 | } |
|
166 | } | |
|
167 | case QChartSeries::SeriesTypeSpline: { | |||
|
168 | QSplineSeries* splineSeries = qobject_cast<QSplineSeries*>(series); | |||
|
169 | SplinePresenter* splinePresenter = new SplinePresenter | |||
|
170 | break; | |||
|
171 | } | |||
165 | default: { |
|
172 | default: { | |
166 | qDebug()<< "Series type" << series->type() << "not implemented."; |
|
173 | qDebug()<< "Series type" << series->type() << "not implemented."; | |
167 | break; |
|
174 | break; |
@@ -19,8 +19,8 public: | |||||
19 | SeriesTypeStackedBar, |
|
19 | SeriesTypeStackedBar, | |
20 | SeriesTypePercentBar, |
|
20 | SeriesTypePercentBar, | |
21 | SeriesTypePie, |
|
21 | SeriesTypePie, | |
22 | SeriesTypeScatter |
|
22 | SeriesTypeScatter, | |
23 |
|
|
23 | SeriesTypeSpline | |
24 | }; |
|
24 | }; | |
25 |
|
25 | |||
26 | protected: |
|
26 | protected: |
@@ -34,6 +34,7 include(linechart/linechart.pri) | |||||
34 | include(barchart/barchart.pri) |
|
34 | include(barchart/barchart.pri) | |
35 | include(piechart/piechart.pri) |
|
35 | include(piechart/piechart.pri) | |
36 | include(scatterseries/scatter.pri) |
|
36 | include(scatterseries/scatter.pri) | |
|
37 | include(splinechart/splinechart.pri) | |||
37 |
|
38 | |||
38 | THEMES += themes/chartthemeicy_p.h \ |
|
39 | THEMES += themes/chartthemeicy_p.h \ | |
39 | themes/chartthemegrayscale_p.h \ |
|
40 | themes/chartthemegrayscale_p.h \ |
General Comments 0
You need to be logged in to leave comments.
Login now