@@ -1,6 +1,13 | |||||
1 | #include "qsplineseries.h" |
|
1 | #include "qsplineseries.h" | |
2 |
|
2 | |||
3 | QSplineSeries::QSplineSeries(QObject *parent) : |
|
3 | QSplineSeries::QSplineSeries(QObject *parent) : | |
4 | QObject(parent) |
|
4 | QObject(parent) | |
5 | { |
|
5 | { | |
6 | } |
|
6 | } | |
|
7 | ||||
|
8 | QSplineSeries& QSplineSeries::operator << (const QPointF &value) | |||
|
9 | { | |||
|
10 | d->m_data.append(value); | |||
|
11 | emit changed(); | |||
|
12 | return *this; | |||
|
13 | } |
@@ -1,24 +1,29 | |||||
1 | #ifndef QSPLINESERIES_H |
|
1 | #ifndef QSPLINESERIES_H | |
2 | #define QSPLINESERIES_H |
|
2 | #define QSPLINESERIES_H | |
3 |
|
3 | |||
4 | #include "qchartseries.h" |
|
4 | #include "qchartseries.h" | |
5 |
|
5 | |||
6 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
6 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
7 |
|
7 | |||
8 | class QSplineSeries : public QChartSeries |
|
8 | class QSplineSeries : public QChartSeries | |
9 | { |
|
9 | { | |
10 | Q_OBJECT |
|
10 | Q_OBJECT | |
11 | public: |
|
11 | public: | |
12 | explicit QSplineSeries(QObject *parent = 0); |
|
12 | ||
13 |
|
13 | QSplineSeries(QObject *parent = 0); | ||
14 | public: // from QChartSeries |
|
|||
15 | QChartSeriesType type() const { return QChartSeries::SeriesTypeSpline; } |
|
14 | QChartSeriesType type() const { return QChartSeries::SeriesTypeSpline; } | |
|
15 | void addData(QPointF value); | |||
|
16 | QSplineSeries& operator << (const QPointF &value); | |||
|
17 | ||||
16 | signals: |
|
18 | signals: | |
17 |
|
19 | |||
18 | public slots: |
|
20 | public slots: | |
|
21 | ||||
|
22 | private: | |||
|
23 | QList<QPointF> m_data; | |||
19 |
|
24 | |||
20 | }; |
|
25 | }; | |
21 |
|
26 | |||
22 | QTCOMMERCIALCHART_END_NAMESPACE |
|
27 | QTCOMMERCIALCHART_END_NAMESPACE | |
23 |
|
28 | |||
24 | #endif // QSPLINESERIES_H |
|
29 | #endif // QSPLINESERIES_H |
General Comments 0
You need to be logged in to leave comments.
Login now