From 98d7781e9e7fb98430edac089a479d846121f8bc Mon Sep 17 00:00:00 2001 From: Adriano Rezende Date: Tue, 3 Jul 2012 19:21:19 +0200 Subject: Add key navigation manual test Change-Id: I5419e66091a2a6a400e0a9389aaffb4637cb6f1f Reviewed-by: Leonardo Sobral Cunha --- tests/manual/keynavigation.qml | 99 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 tests/manual/keynavigation.qml diff --git a/tests/manual/keynavigation.qml b/tests/manual/keynavigation.qml new file mode 100644 index 00000000..f7718b16 --- /dev/null +++ b/tests/manual/keynavigation.qml @@ -0,0 +1,99 @@ +import QtQuick 2.0 +import QtDesktop 0.1 + +ApplicationWindow { + width: 400 + height: 400 + + Rectangle { + id: back + anchors.fill: parent + color: enabled ? "red" : "blue" + } + + Column { + spacing: 8 + anchors.centerIn: parent + + Row { + Button { + id: button1 + focus: true + text: "Button 1" + activeFocusOnPress: true + KeyNavigation.tab: button2 + onClicked: back.enabled = !back.enabled + } + Button { + id: button2 + text: "Button 2" + activeFocusOnPress: true + KeyNavigation.tab: button3 + KeyNavigation.backtab: button1 + onClicked: back.enabled = !back.enabled + } + Button { + id: button3 + text: "Button 3" + activeFocusOnPress: true + KeyNavigation.tab: checkbox1 + KeyNavigation.backtab: button2 + onClicked: back.enabled = !back.enabled + } + } + + Row { + CheckBox { + id: checkbox1 + text: "Checkbox 1" + activeFocusOnPress: true + KeyNavigation.tab: checkbox2 + KeyNavigation.backtab: button3 + onClicked: back.enabled = !back.enabled + } + CheckBox { + id: checkbox2 + text: "Checkbox 2" + activeFocusOnPress: true + KeyNavigation.tab: checkbox3 + KeyNavigation.backtab: checkbox1 + onClicked: back.enabled = !back.enabled + } + CheckBox { + id: checkbox3 + text: "Checkbox 3" + activeFocusOnPress: true + KeyNavigation.tab: radioButton1 + KeyNavigation.backtab: checkbox2 + onClicked: back.enabled = !back.enabled + } + } + + ButtonRow { + exclusive: true + RadioButton { + id: radioButton1 + text: "RadioButton 1" + activeFocusOnPress: true + KeyNavigation.tab: radioButton2 + KeyNavigation.backtab: checkbox3 + onClicked: back.enabled = !back.enabled + } + RadioButton { + id: radioButton2 + text: "RadioButton 2" + activeFocusOnPress: true + KeyNavigation.tab: radioButton3 + KeyNavigation.backtab: radioButton1 + onClicked: back.enabled = !back.enabled + } + RadioButton { + id: radioButton3 + text: "RadioButton 3" + activeFocusOnPress: true + KeyNavigation.backtab: radioButton2 + onClicked: back.enabled = !back.enabled + } + } + } +} -- cgit v1.2.1