diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-08-02 06:22:43 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-08-02 06:23:13 (GMT) |
commit | 3daee8e915f9845fb104e57c7f35fdb2f7251df5 (patch) | |
tree | 148f27269a3f3a921fb95a85b367487fae2155aa /doc/src/snippets/declarative/state.qml | |
parent | 969daadd245153e8bb6c9a89a51565b83832f484 (diff) | |
download | Qt-3daee8e915f9845fb104e57c7f35fdb2f7251df5.zip Qt-3daee8e915f9845fb104e57c7f35fdb2f7251df5.tar.gz Qt-3daee8e915f9845fb104e57c7f35fdb2f7251df5.tar.bz2 |
State doc fixes, improvements
Task-number: QTBUG-12570
Diffstat (limited to 'doc/src/snippets/declarative/state.qml')
-rw-r--r-- | doc/src/snippets/declarative/state.qml | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml index af6b103..ce2653b 100644 --- a/doc/src/snippets/declarative/state.qml +++ b/doc/src/snippets/declarative/state.qml @@ -44,13 +44,19 @@ import Qt 4.7 Rectangle { id: myRect width: 100; height: 100 - color: "red" + color: "black" - MouseArea { id: mouseArea; anchors.fill: parent } - - states: State { - name: "hidden"; when: mouseArea.pressed - PropertyChanges { target: myRect; opacity: 0 } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked'; } + + states: [ + State { + name: "clicked" + PropertyChanges { target: myRect; color: "red" } + } + ] } //![0] |