diff options
| author | Eckhart Koppen <eckhart.koppen@nokia.com> | 2011-04-05 09:05:24 (GMT) |
|---|---|---|
| committer | Eckhart Koppen <eckhart.koppen@nokia.com> | 2011-04-05 09:05:24 (GMT) |
| commit | c20dbae2860d1ec681be50f161792c6aede08b1b (patch) | |
| tree | ad0082d3fb710ffd20d4c1745f312c1a702b5a16 /doc/src/snippets/declarative/mousearea/mousearea-snippet.qml | |
| parent | 9c365ff16abec339c3930444dc1722a419f07dad (diff) | |
| parent | c3e903409b96fede96cb4a7b95ba308663c88879 (diff) | |
| download | Qt-c20dbae2860d1ec681be50f161792c6aede08b1b.zip Qt-c20dbae2860d1ec681be50f161792c6aede08b1b.tar.gz Qt-c20dbae2860d1ec681be50f161792c6aede08b1b.tar.bz2 | |
Merge remote-tracking branch 'qt-master/master'
Conflicts:
src/s60installs/bwins/QtOpenVGu.def
Diffstat (limited to 'doc/src/snippets/declarative/mousearea/mousearea-snippet.qml')
| -rw-r--r-- | doc/src/snippets/declarative/mousearea/mousearea-snippet.qml | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml index 3c2e143..03473ba 100644 --- a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml +++ b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml @@ -41,13 +41,60 @@ //! [document] import QtQuick 1.0 -Rectangle { - width: 100; height: 100 +//! [parent begin] +Rectangle { +//! [parent begin] + width: 500; height: 500 color: "green" - MouseArea { +Column { +//! [anchor fill] +Rectangle { + id: button + width: 100; height: 100 + + MouseArea { anchors.fill: parent - onClicked: { parent.color = 'red' } + onClicked: console.log("button clicked") + } + MouseArea { + width:150; height: 75 + onClicked: console.log("irregular area clicked") + } +} +//! [anchor fill] + +Rectangle { + id: button + width: 100; height: 100 + +//! [enable handlers] + MouseArea { + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + onEntered: console.log("mouse entered the area") + onExited: console.log("mouse left the area") } +//! [enable handlers] +} + +Rectangle { + id: button + width: 100; height: 100 + +//! [mouse handlers] + MouseArea { + anchors.fill: parent + onClicked: console.log("area clicked") + onDoubleClicked: console.log("area double clicked") + onEntered: console.log("mouse entered the area") + onExited: console.log("mouse left the area") + } +//! [mouse handlers] +} + +} //end of column +//! [parent end] } +//! [parent end] //! [document] |
