aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_rangeslider.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-25 20:00:56 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-25 20:00:56 +0100
commitee6c83db18e65e4eec7b7280213b780576b24c03 (patch)
treecaf049a79f3187962059c7f73181b22b71dc1632 /tests/auto/controls/data/tst_rangeslider.qml
parent718f6def0b2c4d84bdc8ebdc9633697885747feb (diff)
parentdb5780507733ef803e963dcef0b5260c4b94acfa (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/templates/qquickrangeslider_p.h Change-Id: Ibe8ec18a7e22080f69f316d0394af1d03517ce93
Diffstat (limited to 'tests/auto/controls/data/tst_rangeslider.qml')
-rw-r--r--tests/auto/controls/data/tst_rangeslider.qml34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_rangeslider.qml b/tests/auto/controls/data/tst_rangeslider.qml
index 97104856..cc12b851 100644
--- a/tests/auto/controls/data/tst_rangeslider.qml
+++ b/tests/auto/controls/data/tst_rangeslider.qml
@@ -655,4 +655,38 @@ TestCase {
control.destroy()
}
+
+ function test_focus() {
+ var control = sliderComponent.createObject(testCase)
+ verify(control)
+
+ waitForRendering(control)
+ compare(control.activeFocus, false)
+
+ // focus is forwarded to the first handle
+ control.forceActiveFocus()
+ compare(control.activeFocus, true)
+ compare(control.first.handle.activeFocus, true)
+ compare(control.second.handle.activeFocus, false)
+
+ // move focus to the second handle
+ control.second.handle.forceActiveFocus()
+ compare(control.activeFocus, true)
+ compare(control.first.handle.activeFocus, false)
+ compare(control.second.handle.activeFocus, true)
+
+ // clear focus
+ control.focus = false
+ compare(control.activeFocus, false)
+ compare(control.first.handle.activeFocus, false)
+ compare(control.second.handle.activeFocus, false)
+
+ // focus is forwarded to the second handle (where it previously was in the focus scope)
+ control.forceActiveFocus()
+ compare(control.activeFocus, true)
+ compare(control.first.handle.activeFocus, false)
+ compare(control.second.handle.activeFocus, true)
+
+ control.destroy()
+ }
}