Update copyright year in license headers.
[profile/ivi/qtdeclarative.git] / src / qtquick1 / graphicsitems / qdeclarativemousearea.cpp
index e6c22d2..30c6929 100644 (file)
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -226,9 +226,9 @@ QDeclarative1MouseAreaPrivate::~QDeclarative1MouseAreaPrivate()
     The following example uses a MouseArea in a \l Rectangle that changes
     the \l Rectangle color to red when clicked:
 
-    \snippet doc/src/snippets/declarative/mousearea/mousearea.qml import
+    \snippet doc/src/snippets/qtquick1/mousearea/mousearea.qml import
     \codeline
-    \snippet doc/src/snippets/declarative/mousearea/mousearea.qml intro
+    \snippet doc/src/snippets/qtquick1/mousearea/mousearea.qml intro
 
     \clearfloat
     Many MouseArea signals pass a \l{MouseEvent}{mouse} parameter that contains
@@ -238,7 +238,7 @@ QDeclarative1MouseAreaPrivate::~QDeclarative1MouseAreaPrivate()
     Here is an extension of the previous example that produces a different
     color when the area is right clicked:
 
-    \snippet doc/src/snippets/declarative/mousearea/mousearea.qml intro-extended
+    \snippet doc/src/snippets/qtquick1/mousearea/mousearea.qml intro-extended
 
     \sa MouseEvent, {declarative/touchinteraction/mousearea}{MouseArea example}
 */
@@ -258,12 +258,38 @@ QDeclarative1MouseAreaPrivate::~QDeclarative1MouseAreaPrivate()
 /*!
     \qmlsignal QtQuick1::MouseArea::onExited()
 
-    This handler is called when the mouse exists the mouse area.
+    This handler is called when the mouse exits the mouse area.
 
     By default the onExited handler is only called while a button is
     pressed. Setting hoverEnabled to true enables handling of
     onExited when no mouse button is pressed.
 
+    The example below shows a fairly typical relationship between
+    two MouseAreas, with \c mouseArea2 on top of \c mouseArea1. Moving the
+    mouse into \c mouseArea2 from \c mouseArea1 will cause \c onExited
+    to be called for \c mouseArea1.
+    \qml
+    Rectangle {
+        width: 400; height: 400
+        MouseArea {
+            id: mouseArea1
+            anchors.fill: parent
+            hoverEnabled: true
+        }
+        MouseArea {
+            id: mouseArea2
+            width: 100; height: 100
+            anchors.centerIn: parent
+            hoverEnabled: true
+        }
+    }
+    \endqml
+
+    If instead you give the two mouseAreas a parent-child relationship,
+    moving the mouse into \c mouseArea2 from \c mouseArea1 will \b not
+    cause \c onExited to be called for \c mouseArea1. Instead, they will
+    both be considered to be simultaneously hovered.
+
     \sa hoverEnabled
 */
 
@@ -466,7 +492,7 @@ void QDeclarative1MouseArea::setPreventStealing(bool prevent)
 
     The code below displays "right" when the right mouse buttons is pressed:
 
-    \snippet doc/src/snippets/declarative/mousearea/mousearea.qml mousebuttons
+    \snippet doc/src/snippets/qtquick1/mousearea/mousearea.qml mousebuttons
 
     \sa acceptedButtons
 */
@@ -973,7 +999,7 @@ QDeclarative1Drag *QDeclarative1MouseArea::drag()
     The following example displays a \l Rectangle that can be dragged along the X-axis. The opacity
     of the rectangle is reduced when it is dragged to the right.
 
-    \snippet doc/src/snippets/declarative/mousearea/mousearea.qml drag
+    \snippet doc/src/snippets/qtquick1/mousearea/mousearea.qml drag
 
     \note Items cannot be dragged if they are anchored for the requested 
     \c drag.axis. For example, if \c anchors.left or \c anchors.right was set
@@ -984,7 +1010,7 @@ QDeclarative1Drag *QDeclarative1MouseArea::drag()
     If \c drag.filterChildren is set to true, a drag can override descendant MouseAreas.  This
     enables a parent MouseArea to handle drags, for example, while descendants handle clicks:
 
-    \snippet doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml dragfilter
+    \snippet doc/src/snippets/qtquick1/mousearea/mouseareadragfilter.qml dragfilter
 
 */