summaryrefslogtreecommitdiffstats
path: root/examples/declarative/layouts/Button.qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-09 01:36:11 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-09 01:36:11 (GMT)
commit91c85c76d83260d794701100b36a0cc04f848932 (patch)
tree86fd1204ad8358a0a41d8a61307e1d3e1ce16177 /examples/declarative/layouts/Button.qml
parentccb3f7c3bda46ace7b42bff5a27a11bd07602b68 (diff)
parentdda314e206162215e60dd306b6347a04f19ca5df (diff)
downloadQt-91c85c76d83260d794701100b36a0cc04f848932.zip
Qt-91c85c76d83260d794701100b36a0cc04f848932.tar.gz
Qt-91c85c76d83260d794701100b36a0cc04f848932.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: examples/declarative/layouts/Button.qml
Diffstat (limited to 'examples/declarative/layouts/Button.qml')
-rw-r--r--examples/declarative/layouts/Button.qml25
1 files changed, 6 insertions, 19 deletions
diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml
index 186512b..44d0c7b 100644
--- a/examples/declarative/layouts/Button.qml
+++ b/examples/declarative/layouts/Button.qml
@@ -1,31 +1,18 @@
import Qt 4.6
-Rectangle {
- id: page
- border.color: "black"
- color: "steelblue"
- radius: 5
- width: pix.width + text.width + 13
- height: pix.height + 10
+Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page
property string text
property string icon
signal clicked
Image { id: pix; x: 5; y:5; source: parent.icon}
-
- Text { id: text; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;}
-
- MouseRegion {
- id: mr
- anchors.fill: parent
- onClicked: { parent.focus = true; page.clicked() }
- }
+ Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;}
+ MouseRegion{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}}
states:
- State {
- name: "pressed"; when: mr.pressed
- PropertyChanges { target:text; x: 5 }
- PropertyChanges { target:pix; x:text.x+text.width + 3 }
+ State{ name:"pressed"; when:mr.pressed
+ PropertyChanges {target:textelement; x: 5}
+ PropertyChanges {target:pix; x:textelement.x+textelement.width + 3}
}
transitions: