diff options
author | David Boddie <david.boddie@nokia.com> | 2011-01-25 13:26:14 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-01-25 13:26:14 (GMT) |
commit | 195fbdfb7f9a8ade3347a651090722a7d3ecccfb (patch) | |
tree | afd29e9eda1c4f898b1e6e78f23140e87454cdb5 /doc/src/snippets/declarative/mousearea | |
parent | 9657c4fa2040758b8aa3a5f7f7c81442cbaba621 (diff) | |
parent | 67fbf125f3f96ea0ff0da66b1dd8b7dd348ca69f (diff) | |
download | Qt-195fbdfb7f9a8ade3347a651090722a7d3ecccfb.zip Qt-195fbdfb7f9a8ade3347a651090722a7d3ecccfb.tar.gz Qt-195fbdfb7f9a8ade3347a651090722a7d3ecccfb.tar.bz2 |
Merge branch '4.7' into jpasions-qt-doc-team-qtquick-4.7
Conflicts:
doc/src/declarative/extending.qdoc
doc/src/external-resources.qdoc
src/declarative/util/qdeclarativeanimation.cpp
src/declarative/util/qdeclarativetransition.cpp
Diffstat (limited to 'doc/src/snippets/declarative/mousearea')
-rw-r--r-- | doc/src/snippets/declarative/mousearea/mousearea.qml | 116 |
1 files changed, 57 insertions, 59 deletions
diff --git a/doc/src/snippets/declarative/mousearea/mousearea.qml b/doc/src/snippets/declarative/mousearea/mousearea.qml index e3cbebb..18ea971 100644 --- a/doc/src/snippets/declarative/mousearea/mousearea.qml +++ b/doc/src/snippets/declarative/mousearea/mousearea.qml @@ -46,74 +46,72 @@ Rectangle { width: childrenRect.width height: childrenRect.height -Row { + Row { + //! [intro] + Rectangle { + width: 100; height: 100 + color: "green" -//! [intro] -Rectangle { - width: 100; height: 100 - color: "green" - - MouseArea { - anchors.fill: parent - onClicked: { parent.color = 'red' } - } -} -//! [intro] + MouseArea { + anchors.fill: parent + onClicked: { parent.color = 'red' } + } + } + //! [intro] -//! [intro-extended] -Rectangle { - width: 100; height: 100 - color: "green" + //! [intro-extended] + Rectangle { + width: 100; height: 100 + color: "green" - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - if (mouse.button == Qt.RightButton) - parent.color = 'blue'; - else - parent.color = 'red'; + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: { + if (mouse.button == Qt.RightButton) + parent.color = 'blue'; + else + parent.color = 'red'; + } + } } - } -} -//! [intro-extended] + //! [intro-extended] -//! [drag] -Rectangle { - id: container - width: 600; height: 200 + //! [drag] + Rectangle { + id: container + width: 600; height: 200 - Rectangle { - id: rect - width: 50; height: 50 - color: "red" - opacity: (600.0 - rect.x) / 600 + Rectangle { + id: rect + width: 50; height: 50 + color: "red" + opacity: (600.0 - rect.x) / 600 - MouseArea { - anchors.fill: parent - drag.target: rect - drag.axis: Drag.XAxis - drag.minimumX: 0 - drag.maximumX: container.width - rect.width + MouseArea { + anchors.fill: parent + drag.target: rect + drag.axis: Drag.XAxis + drag.minimumX: 0 + drag.maximumX: container.width - rect.width + } + } } - } -} -//! [drag] + //! [drag] -//! [mousebuttons] -Text { - text: mouseArea.pressedButtons & Qt.RightButton ? "right" : "" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - MouseArea { - id: mouseArea - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - } -} -//! [mousebuttons] + //! [mousebuttons] + Text { + text: mouseArea.pressedButtons & Qt.RightButton ? "right" : "" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter -} + MouseArea { + id: mouseArea + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + } + } + //! [mousebuttons] + } } |