summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-02 03:15:19 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-02 03:15:19 (GMT)
commitb148b182b5b48d60c2b57d8b74ad0f30272bb578 (patch)
tree43de2ac7798d4baf18f638d56cee403e70000e6b /examples
parent6d06a9d19b4e0fc3ec2b7e32a014103c58e93ae0 (diff)
parentd1b4ce6a10267a7a7ca0fde24c2030815c96522d (diff)
downloadQt-b148b182b5b48d60c2b57d8b74ad0f30272bb578.zip
Qt-b148b182b5b48d60c2b57d8b74ad0f30272bb578.tar.gz
Qt-b148b182b5b48d60c2b57d8b74ad0f30272bb578.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/border-image/MyBorderImage.qml13
-rw-r--r--examples/declarative/border-image/animated.qml12
-rw-r--r--examples/declarative/border-image/example.qml8
-rw-r--r--examples/declarative/focusscope/test4.qml75
-rw-r--r--examples/declarative/layouts/layouts.qml3
5 files changed, 94 insertions, 17 deletions
diff --git a/examples/declarative/border-image/MyBorderImage.qml b/examples/declarative/border-image/MyBorderImage.qml
index f9531df..395b648 100644
--- a/examples/declarative/border-image/MyBorderImage.qml
+++ b/examples/declarative/border-image/MyBorderImage.qml
@@ -1,9 +1,9 @@
import Qt 4.6
Item {
- property var horizontalMode : "Stretch"
- property var verticalMode : "Stretch"
- property string source
+ property var horizontalMode : BorderImage.Stretch
+ property var verticalMode : BorderImage.Stretch
+ property alias source: MyImage.source
property int minWidth
property int minHeight
property int maxWidth
@@ -13,19 +13,20 @@ Item {
id: Container
width: 240; height: 240
BorderImage {
- x: Container.width / 2 - width / 2
- y: Container.height / 2 - height / 2
+ id: MyImage; x: Container.width / 2 - width / 2; y: Container.height / 2 - height / 2
+
width: SequentialAnimation {
running: true; repeat: true
NumberAnimation { from: Container.minWidth; to: Container.maxWidth; duration: 2000; easing: "easeInOutQuad"}
NumberAnimation { from: Container.maxWidth; to: Container.minWidth; duration: 2000; easing: "easeInOutQuad" }
}
+
height: SequentialAnimation {
running: true; repeat: true
NumberAnimation { from: Container.minHeight; to: Container.maxHeight; duration: 2000; easing: "easeInOutQuad"}
NumberAnimation { from: Container.maxHeight; to: Container.minHeight; duration: 2000; easing: "easeInOutQuad" }
}
- source: Container.source
+
horizontalTileMode: Container.horizontalMode
verticalTileMode: Container.verticalMode
border.top: Container.margin
diff --git a/examples/declarative/border-image/animated.qml b/examples/declarative/border-image/animated.qml
index 2fe2ea9..b34753f 100644
--- a/examples/declarative/border-image/animated.qml
+++ b/examples/declarative/border-image/animated.qml
@@ -14,19 +14,19 @@ Rectangle {
x: 270; y: 20; minWidth: 120; maxWidth: 240
minHeight: 120; maxHeight: 240
source: "colors.png"; margin: 30
- horizontalMode: "Repeat"; verticalMode: "Repeat"
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
}
MyBorderImage {
x: 520; y: 20; minWidth: 120; maxWidth: 240
minHeight: 120; maxHeight: 240
source: "colors.png"; margin: 30
- horizontalMode: "Stretch"; verticalMode: "Repeat"
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
}
MyBorderImage {
x: 770; y: 20; minWidth: 120; maxWidth: 240
minHeight: 120; maxHeight: 240
source: "colors.png"; margin: 30
- horizontalMode: "Round"; verticalMode: "Round"
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
}
MyBorderImage {
x: 20; y: 280; minWidth: 60; maxWidth: 200
@@ -37,18 +37,18 @@ Rectangle {
x: 270; y: 280; minWidth: 60; maxWidth: 200
minHeight: 40; maxHeight: 200
source: "bw.png"; margin: 10
- horizontalMode: "Repeat"; verticalMode: "Repeat"
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
}
MyBorderImage {
x: 520; y: 280; minWidth: 60; maxWidth: 200
minHeight: 40; maxHeight: 200
source: "bw.png"; margin: 10
- horizontalMode: "Stretch"; verticalMode: "Repeat"
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
}
MyBorderImage {
x: 770; y: 280; minWidth: 60; maxWidth: 200
minHeight: 40; maxHeight: 200
source: "bw.png"; margin: 10
- horizontalMode: "Round"; verticalMode: "Round"
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
}
}
diff --git a/examples/declarative/border-image/example.qml b/examples/declarative/border-image/example.qml
index 87d3f37..a0b02b7 100644
--- a/examples/declarative/border-image/example.qml
+++ b/examples/declarative/border-image/example.qml
@@ -13,8 +13,8 @@ Rectangle {
width: 180; height: 180
border.left: 30; border.top: 30
border.right: 30; border.bottom: 30
- horizontalTileMode: "Stretch"
- verticalTileMode: "Stretch"
+ horizontalTileMode: BorderImage.Stretch
+ verticalTileMode: BorderImage.Stretch
source: "colors.png"
}
@@ -22,8 +22,8 @@ Rectangle {
width: 180; height: 180
border.left: 30; border.top: 30
border.right: 30; border.bottom: 30
- horizontalTileMode: "Round"
- verticalTileMode: "Round"
+ horizontalTileMode: BorderImage.Round
+ verticalTileMode: BorderImage.Round
source: "colors.png"
}
//! [0]
diff --git a/examples/declarative/focusscope/test4.qml b/examples/declarative/focusscope/test4.qml
new file mode 100644
index 0000000..f366543
--- /dev/null
+++ b/examples/declarative/focusscope/test4.qml
@@ -0,0 +1,75 @@
+import Qt 4.6
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ Keys.onDigit9Pressed: print("Error - Root")
+
+ FocusScope {
+ id: MyScope
+
+ Keys.onDigit9Pressed: print("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: print("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: print("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: print("Error - Bottom Left");
+ KeyNavigation.up: MyScope
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.focus?"red":"transparent"
+ }
+ }
+
+}
diff --git a/examples/declarative/layouts/layouts.qml b/examples/declarative/layouts/layouts.qml
index 6e22d8b..b54a7f3 100644
--- a/examples/declarative/layouts/layouts.qml
+++ b/examples/declarative/layouts/layouts.qml
@@ -5,7 +5,8 @@ Item { id: resizable
GraphicsObjectContainer{
anchors.fill:parent
QGraphicsWidget{
- geometry:{ "0,0," + parent.width.toString() + "x" + parent.height.toString(); }
+ size.width:parent.width
+ size.height:parent.height
layout: QGraphicsLinearLayout{
LayoutItem{
minimumSize: "100x100"