summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-30 07:34:10 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-30 07:36:48 (GMT)
commit5107b4c5e670b7357b9eb0f8f81f9810eaa9647b (patch)
tree1b335dc2aee73d9e8d48b42a6a765d95434ece8d /examples/declarative
parentb9b305f6c7bc960101bfd883ca6e3df889483481 (diff)
downloadQt-5107b4c5e670b7357b9eb0f8f81f9810eaa9647b.zip
Qt-5107b4c5e670b7357b9eb0f8f81f9810eaa9647b.tar.gz
Qt-5107b4c5e670b7357b9eb0f8f81f9810eaa9647b.tar.bz2
Move basic focusscope examples into auto tests.
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/declarative.pro1
-rw-r--r--examples/declarative/focusscope/test.qml76
-rw-r--r--examples/declarative/focusscope/test2.qml40
-rw-r--r--examples/declarative/focusscope/test3.qml52
-rw-r--r--examples/declarative/focusscope/test4.qml75
-rw-r--r--examples/declarative/focusscope/test5.qml83
6 files changed, 0 insertions, 327 deletions
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
index bddfbee..0f58738 100644
--- a/examples/declarative/declarative.pro
+++ b/examples/declarative/declarative.pro
@@ -21,7 +21,6 @@ sources.files = \
effects \
fillmode \
focus \
- focusscope \
fonts \
gridview \
layouts \
diff --git a/examples/declarative/focusscope/test.qml b/examples/declarative/focusscope/test.qml
deleted file mode 100644
index e4332e7..0000000
--- a/examples/declarative/focusscope/test.qml
+++ /dev/null
@@ -1,76 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- color: "white"
- width: 800
- height: 600
-
- Keys.onDigit9Pressed: console.log("Error - Root")
-
- FocusScope {
- id: myScope
- focus: true
-
- Keys.onDigit9Pressed: console.log("Error - FocusScope")
-
- Rectangle {
- height: 120
- width: 420
-
- color: "transparent"
- border.width: 5
- border.color: myScope.wantsFocus?"blue":"black"
-
- Rectangle {
- id: item1
- x: 10; y: 10
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: console.log("Top Left");
- KeyNavigation.right: item2
- focus: true
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
-
- Rectangle {
- id: item2
- x: 310; y: 10
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
- KeyNavigation.left: item1
- Keys.onDigit9Pressed: console.log("Top Right");
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
- }
- KeyNavigation.down: item3
- }
-
- Text { x:100; y:170; text: "Blue border indicates scoped focus\nBlack border indicates NOT scoped focus\nRed box indicates active focus\nUse arrow keys to navigate\nPress \"9\" to print currently focused item" }
-
- Rectangle {
- id: item3
- x: 10; y: 300
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
-
- Keys.onDigit9Pressed: console.log("Bottom Left");
- KeyNavigation.up: myScope
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
-
-}
diff --git a/examples/declarative/focusscope/test2.qml b/examples/declarative/focusscope/test2.qml
deleted file mode 100644
index 5b6971a..0000000
--- a/examples/declarative/focusscope/test2.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- color: "white"
- width: 800
- height: 600
-
- Text { text: "All five rectangles should be red" }
-
- FocusScope {
- y: 100
- focus: true
- Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
-
- FocusScope {
- y: 100
- focus: true
- Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
-
- FocusScope {
- y: 100
- focus: true
- Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
-
- FocusScope {
- y: 100
- focus: true
- Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
-
- FocusScope {
- y: 100
- focus: true
- Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
- }
- }
- }
- }
- }
-
-}
diff --git a/examples/declarative/focusscope/test3.qml b/examples/declarative/focusscope/test3.qml
deleted file mode 100644
index 9344d07..0000000
--- a/examples/declarative/focusscope/test3.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-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: console.log("Error - " + name)
- Rectangle {
- focus: true
- Keys.onDigit9Pressed: console.log(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
- preferredHighlightBegin: 100
- preferredHighlightEnd: 100
- highlightRangeMode: "StrictlyEnforceRange"
- }
-
-
- 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."
- }
-}
diff --git a/examples/declarative/focusscope/test4.qml b/examples/declarative/focusscope/test4.qml
deleted file mode 100644
index cc96df9..0000000
--- a/examples/declarative/focusscope/test4.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- color: "white"
- width: 800
- height: 600
-
- Keys.onDigit9Pressed: console.log("Error - Root")
-
- FocusScope {
- id: myScope
-
- Keys.onDigit9Pressed: console.log("Error - FocusScope")
-
- Rectangle {
- height: 120
- width: 420
-
- color: "transparent"
- border.width: 5
- border.color: myScope.wantsFocus?"blue":"black"
-
- Rectangle {
- id: item1
- x: 10; y: 10
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: console.log("Error - Top Left");
- KeyNavigation.right: item2
- focus: true
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
-
- Rectangle {
- id: item2
- x: 310; y: 10
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
- KeyNavigation.left: item1
- Keys.onDigit9Pressed: console.log("Error - Top Right");
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
- }
- KeyNavigation.down: item3
- }
-
- Text { x:100; y:170; text: "There should be no blue borders, or red squares.\nPressing \"9\" should do nothing.\nArrow keys should have no effect." }
-
- Rectangle {
- id: item3
- x: 10; y: 300
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
-
- Keys.onDigit9Pressed: console.log("Error - Bottom Left");
- KeyNavigation.up: myScope
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
-
-}
diff --git a/examples/declarative/focusscope/test5.qml b/examples/declarative/focusscope/test5.qml
deleted file mode 100644
index da98350..0000000
--- a/examples/declarative/focusscope/test5.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- color: "white"
- width: 800
- height: 600
-
- Keys.onReturnPressed: console.log("Error - Root")
-
- FocusScope {
- id: myScope
- focus: true
-
- Keys.onReturnPressed: console.log("Error - FocusScope")
-
- Rectangle {
- height: 120
- width: 420
-
- color: "transparent"
- border.width: 5
- border.color: myScope.wantsFocus?"blue":"black"
-
- Rectangle {
- x: 10; y: 10
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: item1.wantsFocus?"blue":"black"
- }
-
- TextEdit {
- id: item1
- x: 20; y: 20
- width: 90; height: 90
- color: "white"
- font.pixelSize: 20
- Keys.onReturnPressed: console.log("Top Left");
- KeyNavigation.right: item2
- focus: true
- wrap: true
- text: "Box 1"
- }
-
- Rectangle {
- id: item2
- x: 310; y: 10
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: wantsFocus?"blue":"black"
- KeyNavigation.left: item1
- Keys.onReturnPressed: console.log("Top Right");
-
- Rectangle {
- width: 50; height: 50; anchors.centerIn: parent
- color: parent.focus?"red":"transparent"
- }
- }
- }
- KeyNavigation.down: item3
- }
-
- Text { x:100; y:170; text: "Blue border indicates scoped focus\nBlack border indicates NOT scoped focus\nRed box or flashing cursor indicates active focus\nUse arrow keys to navigate\nPress Ctrl-Return to print currently focused item" }
-
- Rectangle {
- x: 10; y: 300
- width: 100; height: 100; color: "green"
- border.width: 5
- border.color: item3.wantsFocus?"blue":"black"
- }
-
- TextEdit {
- id: item3
- x: 20; y: 310
- width: 90; height: 90
- color: "white"
- font.pixelSize: 20
- text: "Box 3"
-
- Keys.onReturnPressed: console.log("Bottom Left");
- KeyNavigation.up: myScope
- wrap: true
- }
-}