##// END OF EJS Templates
Bugfix missing min max intialization when axis added to domain
Michal Klocek -
r442:6c610328d6c5
parent child
Show More
@@ -50,7 +50,10 void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY)
50 50
51 51 QObject::connect(axisY,SIGNAL(rangeChanged(qreal,qreal)),domain,SLOT(handleAxisRangeXChanged(qreal,qreal)));
52 52 QObject::connect(axisX(),SIGNAL(rangeChanged(qreal,qreal)),domain,SLOT(handleAxisRangeYChanged(qreal,qreal)));
53
53 //initialize
54 qDebug()<<axisX()->min()<<axisX()->max();
55 domain->handleAxisRangeYChanged(axisY->min(),axisY->max());
56 domain->handleAxisRangeXChanged(axisX()->min(),axisX()->max());
54 57 m_axisDomainMap.insert(axisY,domain);
55 58 emit axisAdded(axisY,domain);
56 59 }
@@ -326,18 +326,24 void QChartAxis::setMax(qreal max)
326 326 */
327 327 void QChartAxis::setRange(qreal min, qreal max)
328 328 {
329
330
329 331 bool changed = false;
330 332 if(m_min!=min) {
331 333 m_min=min;
334 changed=true;
332 335 emit minChanged(min);
333 336 }
334 337
335 338 if(m_max!=max) {
336 339 m_max=max;
340 changed=true;
337 341 emit maxChanged(max);
338 342 }
339 343
340 if(changed) emit rangeChanged(m_min,m_max);
344 if(changed) {
345 emit rangeChanged(m_min,m_max);
346 }
341 347 }
342 348
343 349 void QChartAxis::handleAxisRangeChanged(qreal min, qreal max)
General Comments 0
You need to be logged in to leave comments. Login now