diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-15 12:49:37 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-15 12:54:49 +0000 |
commit | f066fce2bb2aba6b94b44008877ac8e03b5b1f82 (patch) | |
tree | 07956ecc8b0206c47f63c27f65338154b700c67d /tests | |
parent | ec21d974f16a03d3ba0056dac0db7f458704611c (diff) |
SpinBox: fix JS callback access
Avoid calling an uninitialized JS callback. This is a regression caused
by lazy creation of the JS callbacks in 1f146d9.
Change-Id: I1816b491ada0509c5664cffbcaa32ca987095b31
Task-number: QTBUG-51114
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_spinbox.qml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml index a2ab5a4a..cdea8b66 100644 --- a/tests/auto/controls/data/tst_spinbox.qml +++ b/tests/auto/controls/data/tst_spinbox.qml @@ -305,4 +305,25 @@ TestCase { compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset) control.destroy() } + + function test_focus() { + var control = spinBox.createObject(testCase, {from: 10, to: 1000, value: 100, focus: true}) + verify(control) + + control.forceActiveFocus() + compare(control.activeFocus, true) + + compare(control.from, 10) + compare(control.to, 1000) + compare(control.value, 100) + + control.focus = false + compare(control.activeFocus, false) + + compare(control.from, 10) + compare(control.to, 1000) + compare(control.value, 100) + + control.destroy() + } } |