##// END OF EJS Templates
Fixes tst_qchartview
Michal Klocek -
r1652:ea4070861878
parent child
Show More
@@ -371,10 +371,7 ChartAxis* QBarCategoriesAxisPrivate::createGraphics(ChartPresenter* presenter)
371
371
372 void QBarCategoriesAxisPrivate::emitRange()
372 void QBarCategoriesAxisPrivate::emitRange()
373 {
373 {
374 Q_Q( QBarCategoriesAxis);
374 emit changed(m_min -0.5, m_max +0.5, qCeil(m_max + 0.5) -qCeil(m_min - 0.5) +1, false);
375 if(!q->signalsBlocked()) {
376 emit changed(m_min -0.5, m_max +0.5, qCeil(m_max + 0.5) -qCeil(m_min - 0.5) +1, false);
377 }
378 }
375 }
379
376
380
377
@@ -162,6 +162,7 qreal QValuesAxis::max() const
162 void QValuesAxis::setRange(qreal min, qreal max)
162 void QValuesAxis::setRange(qreal min, qreal max)
163 {
163 {
164 Q_D(QValuesAxis);
164 Q_D(QValuesAxis);
165
165 bool changed = false;
166 bool changed = false;
166 if (!qFuzzyIsNull(d->m_min - min)) {
167 if (!qFuzzyIsNull(d->m_min - min)) {
167 d->m_min = min;
168 d->m_min = min;
@@ -258,6 +259,7 void QValuesAxisPrivate::setMin(const QVariant &min)
258
259
259 void QValuesAxisPrivate::setMax(const QVariant &max)
260 void QValuesAxisPrivate::setMax(const QVariant &max)
260 {
261 {
262
261 Q_Q(QValuesAxis);
263 Q_Q(QValuesAxis);
262 bool ok;
264 bool ok;
263 qreal value = max.toReal(&ok);
265 qreal value = max.toReal(&ok);
@@ -292,10 +294,7 ChartAxis* QValuesAxisPrivate::createGraphics(ChartPresenter* presenter)
292
294
293 void QValuesAxisPrivate::emitRange()
295 void QValuesAxisPrivate::emitRange()
294 {
296 {
295 Q_Q(QValuesAxis);
297 emit changed(m_min, m_max, m_ticksCount, m_niceNumbers);
296 if(!q->signalsBlocked()) {
297 emit changed(m_min, m_max, m_ticksCount, m_niceNumbers);
298 }
299 }
298 }
300
299
301 #include "moc_qvaluesaxis.cpp"
300 #include "moc_qvaluesaxis.cpp"
@@ -261,6 +261,7 void ChartDataSet::zoomInDomain(const QRectF& rect, const QSizeF& size)
261 {
261 {
262 //for performance reasons block, signals and scale "full" domain one by one. Gives twice less screen updates
262 //for performance reasons block, signals and scale "full" domain one by one. Gives twice less screen updates
263
263
264
264 blockAxisSignals(true);
265 blockAxisSignals(true);
265
266
266 QMapIterator<QAbstractSeries*, Domain*> i(m_seriesDomainMap);
267 QMapIterator<QAbstractSeries*, Domain*> i(m_seriesDomainMap);
@@ -293,13 +294,13 void ChartDataSet::zoomOutDomain(const QRectF& rect, const QSizeF& size)
293 void ChartDataSet::blockAxisSignals(bool enabled)
294 void ChartDataSet::blockAxisSignals(bool enabled)
294 {
295 {
295 QMapIterator<QAbstractSeries*, Domain*> i(m_seriesDomainMap);
296 QMapIterator<QAbstractSeries*, Domain*> i(m_seriesDomainMap);
296
297 Q_UNUSED(enabled);
297 while (i.hasNext()) {
298 while (i.hasNext()) {
298 i.next();
299 i.next();
299 QAbstractAxis* axisX = m_seriesAxisXMap.value(i.key());
300 QAbstractAxis* axisX = m_seriesAxisXMap.value(i.key());
300 QAbstractAxis* axisY = m_seriesAxisYMap.value(i.key());
301 QAbstractAxis* axisY = m_seriesAxisYMap.value(i.key());
301 if(axisX) axisX->blockSignals(enabled);
302 if(axisX) axisX->d_ptr->blockSignals(true);
302 if(axisY) axisY->blockSignals(enabled);
303 if(axisY) axisY->d_ptr->blockSignals(true);
303 }
304 }
304 }
305 }
305
306
@@ -23,6 +23,7
23 #include <qlineseries.h>
23 #include <qlineseries.h>
24 #include <cmath>
24 #include <cmath>
25 #include <tst_definitions.h>
25 #include <tst_definitions.h>
26 #include <qvaluesaxis.h>
26
27
27 QTCOMMERCIALCHART_USE_NAMESPACE
28 QTCOMMERCIALCHART_USE_NAMESPACE
28
29
@@ -143,6 +144,7 void tst_QChartView::rubberBand()
143 *line << QPointF(0, 0) << QPointF(200, 200);
144 *line << QPointF(0, 0) << QPointF(200, 200);
144
145
145 m_view->chart()->addSeries(line);
146 m_view->chart()->addSeries(line);
147 m_view->chart()->createDefaultAxes();
146 m_view->resize(200 + padding.left() + padding.right(), 200 + padding.top()+ padding.bottom());
148 m_view->resize(200 + padding.left() + padding.right(), 200 + padding.top()+ padding.bottom());
147 m_view->show();
149 m_view->show();
148
150
@@ -166,11 +168,14 void tst_QChartView::rubberBand()
166 //this is hack since view does not get events otherwise
168 //this is hack since view does not get events otherwise
167 m_view->setMouseTracking(false);
169 m_view->setMouseTracking(false);
168
170
169 //TODO: QVERIFY(axisX->min() - minX < 1);
171 QValuesAxis* vaxisX = qobject_cast<QValuesAxis*>(axisX);
170 //TODO: QVERIFY(axisX->max() - maxX < 1);
172 QValuesAxis* vaxisY = qobject_cast<QValuesAxis*>(axisY);
171 //TODO: QVERIFY(axisY->min() - minY < 1);
173
172 //TODO: QVERIFY(axisY->max() - maxY < 1);
174 QVERIFY(vaxisX->min() - minX < 1);
173 qFatal("implement TODO");
175 QVERIFY(vaxisX->max() - maxX < 1);
176 QVERIFY(vaxisY->min() - minY < 1);
177 QVERIFY(vaxisY->max() - maxY < 1);
178
174 }
179 }
175
180
176 QTEST_MAIN(tst_QChartView)
181 QTEST_MAIN(tst_QChartView)
General Comments 0
You need to be logged in to leave comments. Login now