diff options
author | Tero Ahola <tero.ahola@digia.com> | 2012-11-28 11:48:30 +0200 |
---|---|---|
committer | Tero Ahola <tero.ahola@digia.com> | 2012-11-28 11:48:30 +0200 |
commit | fa79ecd1e521f5be06eda8d3664807adfcf140fb (patch) | |
tree | 06bc20db0279e26543b2db474eccca4b60011dce /tests/auto | |
parent | 496027721d42ed62ef275a8cfc70efd43061aa21 (diff) |
QValueAxis::applyNiceNumbers is now a slot
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml-qtquicktest/tst_chartviewfunctions.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml-qtquicktest/tst_valueaxis.qml | 25 |
2 files changed, 23 insertions, 4 deletions
diff --git a/tests/auto/qml-qtquicktest/tst_chartviewfunctions.qml b/tests/auto/qml-qtquicktest/tst_chartviewfunctions.qml index a575073d..4e791252 100644 --- a/tests/auto/qml-qtquicktest/tst_chartviewfunctions.qml +++ b/tests/auto/qml-qtquicktest/tst_chartviewfunctions.qml @@ -132,6 +132,7 @@ Rectangle { yMax = chartView.axisY().max; yMin = chartView.axisY().min; + // Scroll left chartView.scrollLeft(10); verify(chartView.axisX().max < xMax); verify(chartView.axisX().min < xMin); @@ -142,6 +143,7 @@ Rectangle { yMax = chartView.axisY().max; yMin = chartView.axisY().min; + // Scroll right chartView.scrollRight(10); verify(chartView.axisX().max > xMax); verify(chartView.axisX().min > xMin); diff --git a/tests/auto/qml-qtquicktest/tst_valueaxis.qml b/tests/auto/qml-qtquicktest/tst_valueaxis.qml index 01d8283a..5468157d 100644 --- a/tests/auto/qml-qtquicktest/tst_valueaxis.qml +++ b/tests/auto/qml-qtquicktest/tst_valueaxis.qml @@ -31,7 +31,8 @@ Rectangle { name: "tst_qml-qtquicktest ValueAxis" when: windowShown - function test_defaultPropertyValues() { + function test_properties() { + // Default properties verify(axisX.min < 0, "AxisX min"); verify(axisX.max > 0, "AxisX max"); verify(axisY.min < 0, "AxisY min"); @@ -40,16 +41,32 @@ Rectangle { verify(axisY.tickCount > 0, "AxisX tick count"); compare(axisX.niceNumbersEnabled, false, "nice numbers"); compare(axisX.labelFormat, "", "label format"); - } - function test_modifyProperties() { + // Modify properties axisX.tickCount = 3; compare(axisX.tickCount, 3, "set tick count"); - axisX.niceNumbersEnabled = true; compare(axisX.niceNumbersEnabled, true, "nice numbers"); } + function test_functions() { + // Set the axis ranges to not "nice" ones... + var min = 0.032456456; + var max = 10.67845634; + axisX.max = min; + axisX.max = max; + axisY.max = min; + axisY.max = max; + + // ...And then apply nice numbers and verify the range was changed + axisX.applyNiceNumbers(); + axisY.applyNiceNumbers(); + verify(axisX.min != min); + verify(axisX.max != max); + verify(axisY.min != min); + verify(axisY.max != max); + } + function test_signals() { minChangedSpy.clear(); maxChangedSpy.clear(); |