##// END OF EJS Templates
Fixed spline's broken signals
Marek Rosa -
r1275:5883c94a00fe
parent child
Show More
@@ -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 // m_chart->setAnimationOptions(QChart::NoAnimation);
265 m_chart->setAnimationOptions(QChart::NoAnimation);
266
266
267 // // series 1
267 // series 1
268 // m_series = new QSplineSeries;
268 m_series = new QSplineSeries;
269 // m_series->setModel(m_model);
269 // m_series->setModel(m_model);
270
270
271 // QXYModelMapper *mapper = new QXYModelMapper;
271 QVXYModelMapper *mapper = new QVXYModelMapper;
272 // mapper->setMapX(0);
272 mapper->setSeries(m_series);
273 // mapper->setMapY(1);
273 mapper->setModel(m_model);
274 // mapper->setFirst(0);
274 mapper->setXColumn(0);
275 // mapper->setCount(-1);
275 mapper->setYColumn(1);
276 mapper->setFirst(0);
277 mapper->setCount(-1);
276
278
277 // m_series->setModelMapper(mapper);
279 // m_series->setModelMapper(mapper);
278
280
279 // m_chart->addSeries(m_series);
281 m_chart->addSeries(m_series);
280 // seriesColorHex = "#" + QString::number(m_series->pen().color().rgb(), 16).right(6).toUpper();
282 seriesColorHex = "#" + QString::number(m_series->pen().color().rgb(), 16).right(6).toUpper();
281 // m_model->addMapping(seriesColorHex, QRect(0, 0, 2, 1000));
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