summaryrefslogtreecommitdiffstats
path: root/examples/declarative/behaviors
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-04-13 04:48:47 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-04-13 04:49:32 (GMT)
commit8149e7aa743c178f13452e7292ea41dccc8aec46 (patch)
tree83ed6171fc9541b328c0d223fbb55793a19fbad6 /examples/declarative/behaviors
parent35d0792025d515e81b2bf208aa1fd7dce28096e6 (diff)
downloadQt-8149e7aa743c178f13452e7292ea41dccc8aec46.zip
Qt-8149e7aa743c178f13452e7292ea41dccc8aec46.tar.gz
Qt-8149e7aa743c178f13452e7292ea41dccc8aec46.tar.bz2
Fix code style in examples
Diffstat (limited to 'examples/declarative/behaviors')
-rw-r--r--examples/declarative/behaviors/SideRect.qml12
-rw-r--r--examples/declarative/behaviors/behavior-example.qml28
2 files changed, 23 insertions, 17 deletions
diff --git a/examples/declarative/behaviors/SideRect.qml b/examples/declarative/behaviors/SideRect.qml
index d06f73c..d32bd7b 100644
--- a/examples/declarative/behaviors/SideRect.qml
+++ b/examples/declarative/behaviors/SideRect.qml
@@ -5,12 +5,18 @@ Rectangle {
property string text
- width: 75; height: 50; radius: 6
- color: "#646464"; border.width: 4; border.color: "white"
+ width: 75; height: 50
+ radius: 6
+ color: "#646464"
+ border.width: 4; border.color: "white"
MouseArea {
anchors.fill: parent
hoverEnabled: true
- onEntered: { focusRect.x = myRect.x; focusRect.y = myRect.y; focusRect.text = myRect.text }
+ onEntered: {
+ focusRect.x = myRect.x;
+ focusRect.y = myRect.y;
+ focusRect.text = myRect.text;
+ }
}
}
diff --git a/examples/declarative/behaviors/behavior-example.qml b/examples/declarative/behaviors/behavior-example.qml
index b21f4f0..b7bae6c 100644
--- a/examples/declarative/behaviors/behavior-example.qml
+++ b/examples/declarative/behaviors/behavior-example.qml
@@ -1,40 +1,38 @@
import Qt 4.7
Rectangle {
- color: "#343434"
width: 600; height: 400
+ color: "#343434"
Rectangle {
anchors.centerIn: parent
- width: 200; height: 200; radius: 30
- color: "transparent"; border.width: 4; border.color: "white"
+ width: 200; height: 200
+ radius: 30
+ color: "transparent"
+ border.width: 4; border.color: "white"
SideRect {
id: leftRect
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.left
+ anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.left }
text: "Left"
}
SideRect {
id: rightRect
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.right
+ anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.right }
text: "Right"
}
SideRect {
id: topRect
- anchors.verticalCenter: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
+ anchors { verticalCenter: parent.top; horizontalCenter: parent.horizontalCenter }
text: "Top"
}
SideRect {
id: bottomRect
- anchors.verticalCenter: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
+ anchors { verticalCenter: parent.bottom; horizontalCenter: parent.horizontalCenter }
text: "Bottom"
}
@@ -44,9 +42,10 @@ Rectangle {
property string text
- color: "firebrick"
x: 62.5; y: 75; width: 75; height: 50
- radius: 6; border.width: 4; border.color: "white"
+ radius: 6
+ border.width: 4; border.color: "white"
+ color: "firebrick"
// Setting an 'elastic' behavior on the focusRect's x property.
Behavior on x {
@@ -62,7 +61,8 @@ Rectangle {
id: focusText
text: focusRect.text
anchors.centerIn: parent
- color: "white"; font.pixelSize: 16; font.bold: true
+ color: "white"
+ font.pixelSize: 16; font.bold: true
// Setting a behavior on the focusText's x property:
// Set the opacity to 0, set the new text value, then set the opacity back to 1.