diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-07-22 11:27:57 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-07-22 11:27:57 (GMT) |
commit | cf1f76661613313615a77479687fa93a3c97efc9 (patch) | |
tree | 978b8d1117224773952d1d2782d7825920bfc6ed /doc/src/snippets/declarative/state.qml | |
parent | d8908922f339892fee4275a433e2bf6da87ae055 (diff) | |
parent | be227b0a01bb28f3ebebedc1aaa65cd8098edd81 (diff) | |
download | Qt-cf1f76661613313615a77479687fa93a3c97efc9.zip Qt-cf1f76661613313615a77479687fa93a3c97efc9.tar.gz Qt-cf1f76661613313615a77479687fa93a3c97efc9.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'doc/src/snippets/declarative/state.qml')
-rw-r--r-- | doc/src/snippets/declarative/state.qml | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml index a99c2e2..af6b103 100644 --- a/doc/src/snippets/declarative/state.qml +++ b/doc/src/snippets/declarative/state.qml @@ -44,26 +44,13 @@ import Qt 4.7 Rectangle { id: myRect width: 100; height: 100 - color: "black" + color: "red" - states: [ - State { - name: "clicked" - PropertyChanges { - target: myRect - color: "red" - } - } - ] + MouseArea { id: mouseArea; anchors.fill: parent } - MouseArea { - anchors.fill: parent - onClicked: { - if (myRect.state == "") // i.e. the default state - myRect.state = "clicked"; - else - myRect.state = ""; - } + states: State { + name: "hidden"; when: mouseArea.pressed + PropertyChanges { target: myRect; opacity: 0 } } } //![0] |