##// END OF EJS Templates
Bugfix in barchartmodel max -> return 0if no count
Michal Klocek -
r915:5580e2c7f492
parent child
Show More
@@ -103,8 +103,7 qreal BarChartModel::min() const
103
103
104 qreal BarChartModel::max() const
104 qreal BarChartModel::max() const
105 {
105 {
106 Q_ASSERT(m_dataModel.count() > 0);
106 if (m_dataModel.count() == 0) return 0;
107
108 // TODO: make min and max members and update them when data changes.
107 // TODO: make min and max members and update them when data changes.
109 // This is slower since they are checked every time, even if data is same since previous call.
108 // This is slower since they are checked every time, even if data is same since previous call.
110 qreal max = INT_MIN;
109 qreal max = INT_MIN;
@@ -203,7 +203,7 void tst_QChart::addSeries()
203 m_view->show();
203 m_view->show();
204 QTest::qWaitForWindowShown(m_view);
204 QTest::qWaitForWindowShown(m_view);
205 if(!axis) axis = m_chart->axisY();
205 if(!axis) axis = m_chart->axisY();
206 //m_chart->addSeries(series,axis);
206 m_chart->addSeries(series,axis);
207 QCOMPARE(m_chart->axisY(series),axis);
207 QCOMPARE(m_chart->axisY(series),axis);
208 }
208 }
209
209
@@ -222,7 +222,6 void tst_QChart::animationOptions()
222 QFETCH(QChart::AnimationOption, animationOptions);
222 QFETCH(QChart::AnimationOption, animationOptions);
223 m_chart->setAnimationOptions(animationOptions);
223 m_chart->setAnimationOptions(animationOptions);
224 QCOMPARE(m_chart->animationOptions(), animationOptions);
224 QCOMPARE(m_chart->animationOptions(), animationOptions);
225
226 }
225 }
227
226
228 void tst_QChart::axisX_data()
227 void tst_QChart::axisX_data()
General Comments 0
You need to be logged in to leave comments. Login now