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