aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-04-24 22:24:14 +0200
committerLiang Qi <liang.qi@qt.io>2018-04-25 05:42:37 +0000
commit110b7187cef4a920423e860ef0e10f819c283fa2 (patch)
treee18f2fc57930315703f8a953281a3d255b0ecdb6 /tests
parentdef92f7b657ee9247beffffcb0cadd1eca8be3c6 (diff)
Revert "ComboBox: don't block the escape/back key"
This change got integrated by sick COIN. This reverts commit def92f7b657ee9247beffffcb0cadd1eca8be3c6. Task-number: QTBUG-67930 Change-Id: I541579d7112ba386b227b7892d4e0aa8e2bd4edf Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_combobox.qml71
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 7f8bc4e8..801712be 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -1600,75 +1600,4 @@ TestCase {
tryCompare(control.popup, "visible", true)
compare(control.popup.height, control.popup.topPadding + control.popup.bottomPadding)
}
-
- Component {
- id: keysMonitor
- Item {
- property int pressedKeys: 0
- property int releasedKeys: 0
- property int lastPressedKey: 0
- property int lastReleasedKey: 0
- property alias comboBox: comboBox
-
- width: 200
- height: 200
-
- Keys.onPressed: { ++pressedKeys; lastPressedKey = event.key }
- Keys.onReleased: { ++releasedKeys; lastReleasedKey = event.key }
-
- ComboBox {
- id: comboBox
- }
- }
- }
-
- function test_keyClose_data() {
- return [
- { tag: "Escape", key: Qt.Key_Escape },
- { tag: "Back", key: Qt.Key_Back }
- ]
- }
-
- function test_keyClose(data) {
- var container = createTemporaryObject(keysMonitor, testCase)
- verify(container)
-
- var control = comboBox.createObject(container)
- verify(control)
-
- control.forceActiveFocus()
- verify(control.activeFocus)
-
- // popup not visible -> propagates
- keyPress(data.key)
- compare(container.pressedKeys, 1)
- compare(container.lastPressedKey, data.key)
-
- keyRelease(data.key)
- compare(container.releasedKeys, 1)
- compare(container.lastReleasedKey, data.key)
-
- verify(control.activeFocus)
-
- // popup visible -> handled -> does not propagate
- control.popup.open()
- tryCompare(control.popup, "opened", true)
-
- keyPress(data.key)
- compare(container.pressedKeys, 1)
-
- keyRelease(data.key)
- compare(container.releasedKeys, 2) // ### TODO: should Popup block the key release?
-
- verify(control.activeFocus)
-
- // popup not visible -> propagates
- keyPress(data.key)
- compare(container.pressedKeys, 2)
- compare(container.lastPressedKey, data.key)
-
- keyRelease(data.key)
- compare(container.releasedKeys, 3)
- compare(container.lastReleasedKey, data.key)
- }
}