diff options
Diffstat (limited to 'examples/quick/mousearea')
-rw-r--r-- | examples/quick/mousearea/doc/src/mousearea.qdoc | 4 | ||||
-rw-r--r-- | examples/quick/mousearea/mousearea.qml | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/quick/mousearea/doc/src/mousearea.qdoc b/examples/quick/mousearea/doc/src/mousearea.qdoc index 827e5497ee..b1dd549a8e 100644 --- a/examples/quick/mousearea/doc/src/mousearea.qdoc +++ b/examples/quick/mousearea/doc/src/mousearea.qdoc @@ -40,7 +40,9 @@ \section1 MouseArea Behavior When you click inside the red square, the \l Text type will list several - properties of that click which are available to QML. + properties of that click which are available to QML. The opacity of the + red square will be reduced while the mouse is pressed and remains inside + the MouseArea. Signals are emitted by the MouseArea when clicks or other discrete operations occur within it. diff --git a/examples/quick/mousearea/mousearea.qml b/examples/quick/mousearea/mousearea.qml index dac891d729..8958391715 100644 --- a/examples/quick/mousearea/mousearea.qml +++ b/examples/quick/mousearea/mousearea.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.4 Rectangle { id: box @@ -49,10 +49,12 @@ Rectangle { width: 120; height: 120 anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10 color: "red" + opacity: redSquareMouseArea.containsPress ? 0.6 : 1.0 Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent } MouseArea { + id: redSquareMouseArea anchors.fill: parent hoverEnabled: true property string buttonID |