@@ -59,6 +59,10 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
59 | QSplineSeries::QSplineSeries(QObject *parent) : |
|
59 | QSplineSeries::QSplineSeries(QObject *parent) : | |
60 | QLineSeries(*new QSplineSeriesPrivate(this),parent) |
|
60 | QLineSeries(*new QSplineSeriesPrivate(this),parent) | |
61 | { |
|
61 | { | |
|
62 | Q_D(QSplineSeries); | |||
|
63 | QObject::connect(this,SIGNAL(pointAdded(int)), d, SLOT(updateControlPoints())); | |||
|
64 | QObject::connect(this,SIGNAL(pointRemoved(int)), d, SLOT(updateControlPoints())); | |||
|
65 | QObject::connect(this,SIGNAL(pointReplaced(int)), d, SLOT(updateControlPoints())); | |||
62 | } |
|
66 | } | |
63 |
|
67 | |||
64 | QSplineSeries::~QSplineSeries() |
|
68 | QSplineSeries::~QSplineSeries() | |
@@ -78,9 +82,9 QAbstractSeries::SeriesType QSplineSeries::type() const | |||||
78 |
|
82 | |||
79 | QSplineSeriesPrivate::QSplineSeriesPrivate(QSplineSeries* q):QLineSeriesPrivate(q) |
|
83 | QSplineSeriesPrivate::QSplineSeriesPrivate(QSplineSeries* q):QLineSeriesPrivate(q) | |
80 | { |
|
84 | { | |
81 | QObject::connect(this,SIGNAL(pointAdded(int)), this, SLOT(updateControlPoints())); |
|
85 | // QObject::connect(this,SIGNAL(pointAdded(int)), this, SLOT(updateControlPoints())); | |
82 | QObject::connect(this,SIGNAL(pointRemoved(int)), this, SLOT(updateControlPoints())); |
|
86 | // QObject::connect(this,SIGNAL(pointRemoved(int)), this, SLOT(updateControlPoints())); | |
83 | QObject::connect(this,SIGNAL(pointReplaced(int)), this, SLOT(updateControlPoints())); |
|
87 | // QObject::connect(this,SIGNAL(pointReplaced(int)), this, SLOT(updateControlPoints())); | |
84 | }; |
|
88 | }; | |
85 |
|
89 | |||
86 | /*! |
|
90 | /*! |
@@ -262,23 +262,25 void TableWidget::updateChartType(bool toggle) | |||||
262 | } |
|
262 | } | |
263 | else if (m_splineRadioButton->isChecked()) |
|
263 | else if (m_splineRadioButton->isChecked()) | |
264 | { |
|
264 | { | |
265 |
|
|
265 | m_chart->setAnimationOptions(QChart::NoAnimation); | |
266 |
|
266 | |||
267 |
|
|
267 | // series 1 | |
268 |
|
|
268 | m_series = new QSplineSeries; | |
269 |
|
|
269 | // m_series->setModel(m_model); | |
270 |
|
270 | |||
271 |
|
|
271 | QVXYModelMapper *mapper = new QVXYModelMapper; | |
272 |
|
|
272 | mapper->setSeries(m_series); | |
273 |
|
|
273 | mapper->setModel(m_model); | |
274 |
|
|
274 | mapper->setXColumn(0); | |
275 |
|
|
275 | mapper->setYColumn(1); | |
|
276 | mapper->setFirst(0); | |||
|
277 | mapper->setCount(-1); | |||
276 |
|
278 | |||
277 |
|
|
279 | // m_series->setModelMapper(mapper); | |
278 |
|
280 | |||
279 |
|
|
281 | m_chart->addSeries(m_series); | |
280 |
|
|
282 | seriesColorHex = "#" + QString::number(m_series->pen().color().rgb(), 16).right(6).toUpper(); | |
281 |
|
|
283 | m_model->addMapping(seriesColorHex, QRect(0, 0, 2, 1000)); | |
282 |
|
284 | |||
283 | // // series 2 |
|
285 | // // series 2 | |
284 | // m_series = new QSplineSeries; |
|
286 | // m_series = new QSplineSeries; |
General Comments 0
You need to be logged in to leave comments.
Login now