diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-07-29 14:40:59 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-29 07:52:01 +0200 |
commit | cebf68dd65d484e5da25ec6244f865b737778011 (patch) | |
tree | e439966c77fcc1e684db94640ef1659778566c63 /src | |
parent | c50d099bdbec05553fe3c2c5190c4c2fd8213f78 (diff) |
Document how to have two MouseAreas simultaneously hovered.
Task-number: QTBUG-17228
Change-Id: Icfb3774429f0f19084f126a0b87699f1d03220f6
Reviewed-on: http://codereview.qt.nokia.com/2369
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qtquick1/graphicsitems/qdeclarativemousearea.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/qtquick1/graphicsitems/qdeclarativemousearea.cpp b/src/qtquick1/graphicsitems/qdeclarativemousearea.cpp index e6c22d2fbb..7f43eb1070 100644 --- a/src/qtquick1/graphicsitems/qdeclarativemousearea.cpp +++ b/src/qtquick1/graphicsitems/qdeclarativemousearea.cpp @@ -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 */ |