diff --git a/demos/dynamicspline/chart.cpp b/demos/dynamicspline/chart.cpp index 659c190..ec34224 100644 --- a/demos/dynamicspline/chart.cpp +++ b/demos/dynamicspline/chart.cpp @@ -47,7 +47,7 @@ Chart::Chart(QGraphicsItem *parent, Qt::WindowFlags wFlags): addSeries(m_series); createDefaultAxes(); setAxisX(m_axis,m_series); - m_axis->setTicksCount(5); + m_axis->setTickCount(5); axisX()->setRange(0, 10); axisY()->setRange(-5, 10); @@ -61,8 +61,8 @@ Chart::~Chart() void Chart::handleTimeout() { - qreal x = plotArea().width()/m_axis->ticksCount(); - qreal y =(m_axis->max() - m_axis->min())/m_axis->ticksCount(); + qreal x = plotArea().width()/m_axis->tickCount(); + qreal y =(m_axis->max() - m_axis->min())/m_axis->tickCount(); m_x += y; m_y = qrand() % 5 - 2.5; m_series->append(m_x, m_y); diff --git a/src/axis/valueaxis/chartvalueaxisx.cpp b/src/axis/valueaxis/chartvalueaxisx.cpp index 693270a..877af74 100644 --- a/src/axis/valueaxis/chartvalueaxisx.cpp +++ b/src/axis/valueaxis/chartvalueaxisx.cpp @@ -113,7 +113,7 @@ void ChartValueAxisX::handleAxisUpdated() { //TODO:: fix this QValueAxis* axis = qobject_cast(m_chartAxis); - m_tickCount = axis->ticksCount(); + m_tickCount = axis->tickCount(); ChartAxis::handleAxisUpdated(); } diff --git a/src/axis/valueaxis/chartvalueaxisy.cpp b/src/axis/valueaxis/chartvalueaxisy.cpp index 260ab52..30629dd 100644 --- a/src/axis/valueaxis/chartvalueaxisy.cpp +++ b/src/axis/valueaxis/chartvalueaxisy.cpp @@ -118,7 +118,7 @@ void ChartValueAxisY::handleAxisUpdated() { //TODO:: fix this QValueAxis* axis = qobject_cast(m_chartAxis); - m_tickCount = axis->ticksCount(); + m_tickCount = axis->tickCount(); ChartAxis::handleAxisUpdated(); } diff --git a/src/axis/valueaxis/qvalueaxis.cpp b/src/axis/valueaxis/qvalueaxis.cpp index 5ef5684..d62e721 100644 --- a/src/axis/valueaxis/qvalueaxis.cpp +++ b/src/axis/valueaxis/qvalueaxis.cpp @@ -188,7 +188,7 @@ void QValueAxis::setRange(qreal min, qreal max) if(d->m_niceNumbers) { int ticks = d->m_tickCount; d->looseNiceNumbers(min, max, ticks); - if(ticks!=d->m_tickCount) setTicksCount(ticks); + if(ticks!=d->m_tickCount) setTickCount(ticks); } if (!qFuzzyIsNull(d->m_min - min)) { @@ -212,7 +212,7 @@ void QValueAxis::setRange(qreal min, qreal max) /*! Sets \a count for ticks on the axis. */ -void QValueAxis::setTicksCount(int count) +void QValueAxis::setTickCount(int count) { Q_D(QValueAxis); if (d->m_tickCount != count && count >=2) { @@ -225,7 +225,7 @@ void QValueAxis::setTicksCount(int count) \fn int QValueAxis::ticksCount() const Return number of ticks on the axis */ -int QValueAxis::ticksCount() const +int QValueAxis::tickCount() const { Q_D(const QValueAxis); return d->m_tickCount; diff --git a/src/axis/valueaxis/qvalueaxis.h b/src/axis/valueaxis/qvalueaxis.h index 105beb2..854b241 100644 --- a/src/axis/valueaxis/qvalueaxis.h +++ b/src/axis/valueaxis/qvalueaxis.h @@ -30,7 +30,7 @@ class QValueAxisPrivate; class QTCOMMERCIALCHART_EXPORT QValueAxis : public QAbstractAxis { Q_OBJECT - Q_PROPERTY(int ticksCount READ ticksCount WRITE setTicksCount) + Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount) Q_PROPERTY(bool niceNumbersEnabled READ niceNumbersEnabled WRITE setNiceNumbersEnabled) Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged) Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged) @@ -53,8 +53,8 @@ public: void setRange(qreal min, qreal max); //ticks handling - void setTicksCount(int count); - int ticksCount() const; + void setTickCount(int count); + int tickCount() const; void setNiceNumbersEnabled(bool enable = true); bool niceNumbersEnabled() const; diff --git a/tests/auto/qvalueaxis/tst_qvalueaxis.cpp b/tests/auto/qvalueaxis/tst_qvalueaxis.cpp index 9d79993..497c73f 100644 --- a/tests/auto/qvalueaxis/tst_qvalueaxis.cpp +++ b/tests/auto/qvalueaxis/tst_qvalueaxis.cpp @@ -105,7 +105,7 @@ void tst_QValueAxis::qvalueaxis() QVERIFY(qFuzzyIsNull(m_valuesaxis->max())); QVERIFY(qFuzzyIsNull(m_valuesaxis->min())); QCOMPARE(m_valuesaxis->niceNumbersEnabled(), false); - QCOMPARE(m_valuesaxis->ticksCount(), 5); + QCOMPARE(m_valuesaxis->tickCount(), 5); QCOMPARE(m_valuesaxis->type(), QAbstractAxis::AxisTypeValues); m_chart->setAxisX(m_valuesaxis, m_series); @@ -115,7 +115,7 @@ void tst_QValueAxis::qvalueaxis() QVERIFY(!qFuzzyIsNull(m_valuesaxis->max())); QVERIFY(!qFuzzyIsNull(m_valuesaxis->min())); QCOMPARE(m_valuesaxis->niceNumbersEnabled(), false); - QCOMPARE(m_valuesaxis->ticksCount(), 5); + QCOMPARE(m_valuesaxis->tickCount(), 5); } void tst_QValueAxis::max_raw_data() @@ -243,7 +243,7 @@ void tst_QValueAxis::niceNumbersEnabled() QFETCH(int, expectedTicks); m_valuesaxis->setRange(min, max); - m_valuesaxis->setTicksCount(ticks); + m_valuesaxis->setTickCount(ticks); QVERIFY2(qFuzzyIsNull(m_valuesaxis->min() - min), "Min not equal"); QVERIFY2(qFuzzyIsNull(m_valuesaxis->max() - max), "Max not equal"); @@ -264,7 +264,7 @@ void tst_QValueAxis::niceNumbersEnabled() QVERIFY2(qFuzzyIsNull(m_valuesaxis->min() - expectedMin), "Min not equal"); QVERIFY2(qFuzzyIsNull(m_valuesaxis->max() - expectedMax), "Max not equal"); - QCOMPARE(m_valuesaxis->ticksCount(), expectedTicks); + QCOMPARE(m_valuesaxis->tickCount(), expectedTicks); } @@ -338,8 +338,8 @@ void tst_QValueAxis::ticksCount() QSignalSpy spy1(m_valuesaxis, SIGNAL(minChanged(qreal))); QSignalSpy spy2(m_valuesaxis, SIGNAL(rangeChanged(qreal, qreal))); - m_valuesaxis->setTicksCount(ticksCount); - QCOMPARE(m_valuesaxis->ticksCount(), ticksCount); + m_valuesaxis->setTickCount(ticksCount); + QCOMPARE(m_valuesaxis->tickCount(), ticksCount); QCOMPARE(spy0.count(), 0); QCOMPARE(spy1.count(), 0); @@ -349,7 +349,7 @@ void tst_QValueAxis::ticksCount() m_view->show(); QTest::qWaitForWindowShown(m_view); - QCOMPARE(m_valuesaxis->ticksCount(), ticksCount); + QCOMPARE(m_valuesaxis->tickCount(), ticksCount); } void tst_QValueAxis::noautoscale_data()