aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-10 23:39:40 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-10 21:56:46 +0000
commit0b2dc1a4d4824981a6f26fc82dd491dbc1bbbb12 (patch)
treef3cae510fb6ec5fde4551b6ecbfd0028979190c6 /tests/auto/controls
parent353f77e6c11c65b04ebe8b02aa087a403069979d (diff)
ProgressBar: add from, to & position properties
Change-Id: I1bf29fab227f1f2642994f9167c9a6957abcbb65 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r--tests/auto/controls/data/tst_progressbar.qml66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_progressbar.qml b/tests/auto/controls/data/tst_progressbar.qml
index a542fd46..7958c96c 100644
--- a/tests/auto/controls/data/tst_progressbar.qml
+++ b/tests/auto/controls/data/tst_progressbar.qml
@@ -75,6 +75,72 @@ TestCase {
control.destroy()
}
+ function test_range() {
+ var control = progressBar.createObject(testCase, {from: 0, to: 100, value: 50})
+ compare(control.from, 0)
+ compare(control.to, 100)
+ compare(control.value, 50)
+ compare(control.position, 0.5)
+
+ control.value = 1000
+ compare(control.value, 100)
+ compare(control.position, 1)
+
+ control.value = -1
+ compare(control.value, 0)
+ compare(control.position, 0)
+
+ control.from = 25
+ compare(control.from, 25)
+ compare(control.value, 25)
+ compare(control.position, 0)
+
+ control.to = 75
+ compare(control.to, 75)
+ compare(control.value, 25)
+ compare(control.position, 0)
+
+ control.value = 50
+ compare(control.value, 50)
+ compare(control.position, 0.5)
+
+ control.destroy()
+ }
+
+ function test_inverted() {
+ var control = progressBar.createObject(testCase, {from: 1.0, to: -1.0})
+ compare(control.from, 1.0)
+ compare(control.to, -1.0)
+ compare(control.value, 0.0)
+ compare(control.position, 0.5)
+
+ control.value = 2.0
+ compare(control.value, 1.0)
+ compare(control.position, 0.0)
+
+ control.value = -2.0
+ compare(control.value, -1.0)
+ compare(control.position, 1.0)
+
+ control.value = 0.0
+ compare(control.value, 0.0)
+ compare(control.position, 0.5)
+
+ control.destroy()
+ }
+
+ function test_position() {
+ var control = progressBar.createObject(testCase, {value: 0.25})
+ compare(control.value, 0.25)
+ compare(control.position, 0.25)
+
+ control.value = 0.75
+ compare(control.value, 0.75)
+ compare(control.position, 0.75)
+
+ control.destroy()
+ }
+
function test_visualPosition() {
var control = progressBar.createObject(testCase, {value: 0.25})
compare(control.value, 0.25)