summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_scrollview.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_scrollview.qml')
-rw-r--r--tests/auto/controls/data/tst_scrollview.qml84
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml
index 842fd6dc..42398115 100644
--- a/tests/auto/controls/data/tst_scrollview.qml
+++ b/tests/auto/controls/data/tst_scrollview.qml
@@ -139,6 +139,45 @@ TestCase {
}
}
+ Component {
+ id: tabNavigationComponent
+ ApplicationWindow {
+ property alias scrollView: view
+ property alias control1: text1
+ property alias control2: text2
+ property alias control3: button
+
+ width: 400
+ height: 300
+ visible: true
+ modality: Qt.WindowModal
+
+ ScrollView {
+ id: view
+ anchors { top: parent.top; left: parent.left; right: parent.right; bottom: button.top }
+ Column {
+ width: view.width
+ TextField {
+ id: text1
+ anchors { left: parent.left; right: parent.right }
+ height: 30
+ }
+ TextField {
+ id: text2
+ anchors { left: parent.left; right: parent.right }
+ height: 30
+ }
+ }
+ }
+
+ Button {
+ id: button
+ anchors.bottom: parent.bottom
+ text: "hi"
+ }
+ }
+ }
+
function test_dragFetchAppend() { // QTBUG-50795
var scrollView = dragFetchAppendComponent.createObject(container)
verify(scrollView !== null, "view created is null")
@@ -319,5 +358,50 @@ TestCase {
verify(!control.control3.activeFocus)
control.destroy()
}
+
+ function test_navigation_QTBUG_64596() {
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
+ skip("This function doesn't support NOT iterating all.")
+
+ var control = tabNavigationComponent.createObject(container)
+ verify(control)
+ waitForRendering(control.contentItem)
+
+ control.requestActivate()
+ control.control1.forceActiveFocus()
+ verify(control.control1.activeFocus)
+ verify(!control.control2.activeFocus)
+ verify(!control.control3.activeFocus)
+ keyPress(Qt.Key_Tab)
+ verify(!control.control1.activeFocus)
+ verify(control.control2.activeFocus)
+ verify(!control.control3.activeFocus)
+ keyPress(Qt.Key_Tab)
+ verify(!control.control1.activeFocus)
+ verify(!control.control2.activeFocus)
+ verify(control.control3.activeFocus)
+ keyPress(Qt.Key_Tab)
+ verify(control.control1.activeFocus)
+ verify(!control.control2.activeFocus)
+ verify(!control.control3.activeFocus)
+ // and backwards
+ keyPress(Qt.Key_Tab, Qt.ShiftModifier)
+ verify(!control.control1.activeFocus)
+ verify(!control.control2.activeFocus)
+ verify(control.control3.activeFocus)
+ keyPress(Qt.Key_Tab, Qt.ShiftModifier)
+ verify(!control.control1.activeFocus)
+ verify(control.control2.activeFocus)
+ verify(!control.control3.activeFocus)
+ keyPress(Qt.Key_Tab, Qt.ShiftModifier)
+ verify(control.control1.activeFocus)
+ verify(!control.control2.activeFocus)
+ verify(!control.control3.activeFocus)
+ keyPress(Qt.Key_Tab, Qt.ShiftModifier)
+ verify(!control.control1.activeFocus)
+ verify(!control.control2.activeFocus)
+ verify(control.control3.activeFocus)
+ control.destroy()
+ }
}
}