summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-08-27 04:43:46 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-08-27 04:43:46 (GMT)
commit219e2fa7ace74d87fda4ed8c3a2a75005fab10b9 (patch)
treee309b5968a0d45634c674dc9bd5ff10f4c9adce6 /examples
parentb888ba48306174fc365499885f395b1dd70efd09 (diff)
downloadQt-219e2fa7ace74d87fda4ed8c3a2a75005fab10b9.zip
Qt-219e2fa7ace74d87fda4ed8c3a2a75005fab10b9.tar.gz
Qt-219e2fa7ace74d87fda4ed8c3a2a75005fab10b9.tar.bz2
Fixup 928e81b68e0b695662c7ee3dd0bfa409a7ca1ffd
I messed up when I reapplied this patch to the branch head. This also adds an extra test for the case fixed.
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/focusscope/test3.qml50
1 files changed, 50 insertions, 0 deletions
diff --git a/examples/declarative/focusscope/test3.qml b/examples/declarative/focusscope/test3.qml
new file mode 100644
index 0000000..51fa35a
--- /dev/null
+++ b/examples/declarative/focusscope/test3.qml
@@ -0,0 +1,50 @@
+import Qt 4.6
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ ListModel {
+ id: Model
+ ListElement { name: "1" }
+ ListElement { name: "2" }
+ ListElement { name: "3" }
+ ListElement { name: "4" }
+ ListElement { name: "5" }
+ ListElement { name: "6" }
+ ListElement { name: "6" }
+ ListElement { name: "8" }
+ ListElement { name: "9" }
+ }
+
+ Component {
+ id: VerticalDelegate
+ FocusScope {
+ id: Root
+ width: 50; height: 50;
+ Keys.onDigit9Pressed: print("Error - " + name)
+ Rectangle {
+ focus: true
+ Keys.onDigit9Pressed: print(name)
+ width: 50; height: 50;
+ color: Root.ListView.isCurrentItem?"red":"green"
+ Text { text: name; anchors.centerIn: parent }
+ }
+ }
+ }
+
+ ListView {
+ width: 800; height: 50; orientation: "Horizontal"
+ focus: true
+ model: Model
+ delegate: VerticalDelegate
+ currentItemPositioning: "SnapAuto"
+ }
+
+
+ Text {
+ y: 100; x: 50
+ text: "Currently selected element should be red\nPressing \"9\" should print the number of the currently selected item\nBe sure to scroll all the way to the right, pause, and then all the way to the left."
+ }
+}