@@ -50,7 +50,10 void ChartDataSet::addSeries(QSeries* series, QChartAxis *axisY) | |||||
50 |
|
50 | |||
51 | QObject::connect(axisY,SIGNAL(rangeChanged(qreal,qreal)),domain,SLOT(handleAxisRangeXChanged(qreal,qreal))); |
|
51 | QObject::connect(axisY,SIGNAL(rangeChanged(qreal,qreal)),domain,SLOT(handleAxisRangeXChanged(qreal,qreal))); | |
52 | QObject::connect(axisX(),SIGNAL(rangeChanged(qreal,qreal)),domain,SLOT(handleAxisRangeYChanged(qreal,qreal))); |
|
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 | m_axisDomainMap.insert(axisY,domain); |
|
57 | m_axisDomainMap.insert(axisY,domain); | |
55 | emit axisAdded(axisY,domain); |
|
58 | emit axisAdded(axisY,domain); | |
56 | } |
|
59 | } |
@@ -326,18 +326,24 void QChartAxis::setMax(qreal max) | |||||
326 | */ |
|
326 | */ | |
327 | void QChartAxis::setRange(qreal min, qreal max) |
|
327 | void QChartAxis::setRange(qreal min, qreal max) | |
328 | { |
|
328 | { | |
|
329 | ||||
|
330 | ||||
329 | bool changed = false; |
|
331 | bool changed = false; | |
330 | if(m_min!=min) { |
|
332 | if(m_min!=min) { | |
331 | m_min=min; |
|
333 | m_min=min; | |
|
334 | changed=true; | |||
332 | emit minChanged(min); |
|
335 | emit minChanged(min); | |
333 | } |
|
336 | } | |
334 |
|
337 | |||
335 | if(m_max!=max) { |
|
338 | if(m_max!=max) { | |
336 | m_max=max; |
|
339 | m_max=max; | |
|
340 | changed=true; | |||
337 | emit maxChanged(max); |
|
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 | void QChartAxis::handleAxisRangeChanged(qreal min, qreal max) |
|
349 | void QChartAxis::handleAxisRangeChanged(qreal min, qreal max) |
General Comments 0
You need to be logged in to leave comments.
Login now