diff options
author | Thomas Zander <t.zander@nokia.com> | 2010-03-31 08:12:41 (GMT) |
---|---|---|
committer | Thomas Zander <t.zander@nokia.com> | 2010-03-31 08:12:41 (GMT) |
commit | a833d593da01d7ecf48eda4e62514ed56fb2be97 (patch) | |
tree | 963df96ca269f56b3c0b4912d5b73de3bfe4c07d /tests/auto/declarative/qdeclarativefocusscope/data/test.qml | |
parent | 456fdf4e5fe05e94955df0fc7d76c384a0bcfbc5 (diff) | |
parent | edd41ee5488716cf8336a7d8ea0cb3d48d0e7b14 (diff) | |
download | Qt-a833d593da01d7ecf48eda4e62514ed56fb2be97.zip Qt-a833d593da01d7ecf48eda4e62514ed56fb2be97.tar.gz Qt-a833d593da01d7ecf48eda4e62514ed56fb2be97.tar.bz2 |
Merge commit 'origin/4.7' into symbian47
Conflicts:
src/3rdparty/webkit/WebCore/WebCore.pro
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'tests/auto/declarative/qdeclarativefocusscope/data/test.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativefocusscope/data/test.qml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml new file mode 100644 index 0000000..647e5bf --- /dev/null +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml @@ -0,0 +1,77 @@ +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 { + objectName: "item0" + height: 120 + width: 420 + + color: "transparent" + border.width: 5 + //border.color: myScope.wantsFocus?"blue":"black" + + Rectangle { + id: item1; objectName: "item1" + x: 10; y: 10 + width: 100; height: 100; color: "green" + border.width: 5 + border.color: wantsFocus?"blue":"black" + Keys.onDigit9Pressed: console.debug("Top Left"); + KeyNavigation.right: item2 + focus: true + + Rectangle { + width: 50; height: 50; anchors.centerIn: parent + color: parent.focus?"red":"transparent" + } + } + + Rectangle { + id: item2; objectName: "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; objectName: "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" + } + } + +} |