diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-05-05 07:44:27 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-05-05 07:44:27 (GMT) |
commit | 1383f287137c50c7e58e7f9395f7a9ffd9441852 (patch) | |
tree | 25f8a9960cb58132bbf42af688cc44b1569809b1 /examples/declarative/layouts/positioners/Button.qml | |
parent | 238ed995be8f32e815ffb6883144d0547355a8eb (diff) | |
parent | 89b4f1eb2bae2f09a9db8094db91a7dabdcdb0a3 (diff) | |
download | Qt-1383f287137c50c7e58e7f9395f7a9ffd9441852.zip Qt-1383f287137c50c7e58e7f9395f7a9ffd9441852.tar.gz Qt-1383f287137c50c7e58e7f9395f7a9ffd9441852.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'examples/declarative/layouts/positioners/Button.qml')
-rw-r--r-- | examples/declarative/layouts/positioners/Button.qml | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/examples/declarative/layouts/positioners/Button.qml b/examples/declarative/layouts/positioners/Button.qml index 0f08893..d03eeb5 100644 --- a/examples/declarative/layouts/positioners/Button.qml +++ b/examples/declarative/layouts/positioners/Button.qml @@ -1,22 +1,38 @@ import Qt 4.7 -Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page +Rectangle { + id: page + property string text property string icon signal clicked - Image { id: pix; x: 5; y:5; source: parent.icon} - Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;} - MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}} + border.color: "black"; color: "steelblue"; radius: 5 + width: pix.width + textelement.width + 13 + height: pix.height + 10 + + Image { id: pix; x: 5; y:5; source: parent.icon } + + Text { + id: textelement + text: page.text; color: "white" + x: pix.width + pix.x + 3 + anchors.verticalCenter: pix.verticalCenter + } + + MouseArea { + id: mr + anchors.fill: parent + onClicked: { parent.focus = true; page.clicked() } + } - states: - State{ name:"pressed"; when:mr.pressed - PropertyChanges {target:textelement; x: 5} - PropertyChanges {target:pix; x:textelement.x+textelement.width + 3} - } + states: State { + name: "pressed"; when: mr.pressed + PropertyChanges { target: textelement; x: 5 } + PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 } + } - transitions: - Transition{ - NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 } - } + transitions: Transition { + NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 } + } } |