QDeclarativeMouseArea: block context menu events
authorCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Fri, 13 May 2011 07:01:28 +0000 (17:01 +1000)
committerMartin Jones <martin.jones@nokia.com>
Mon, 30 May 2011 05:51:04 +0000 (15:51 +1000)
commitce77f3adb8c144504f4cd2422b1fe387bce08b70
tree41228b2a79ede0f80d04e4117d3c64e504a26b1d
parent44dfcc68efd5d60ea8991b3455c3eec0f2e33773
QDeclarativeMouseArea: block context menu events

If the MouseArea accepts the same button used to trigger a context
menu event, it should not let the event to be delivered to item
behind.

This is important for items that do implement contextMenuEvent(), like
QDeclarativeWebView. When there's a mouse area on top of this item and
that accepts the right click (in Linux), the event was still being
delivered and the WebView menu was incorrectly appearing.

QtWebKit bug https://bugs.webkit.org/show_bug.cgi?id=56526 documents this
problem.

Change-Id: I386fac6c96f47b8616e2eeb7e5f97043ba418980
Merge-request: 1185
Reviewed-by: Martin Jones <martin.jones@nokia.com>
(cherry picked from commit 80db0a1e59658f9e445219fc48d9236a79edca72)
src/declarative/graphicsitems/qdeclarativemousearea.cpp
src/declarative/graphicsitems/qdeclarativemousearea_p.h
tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp