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>
Fri, 13 May 2011 07:01:28 +0000 (17:01 +1000)
commit80db0a1e59658f9e445219fc48d9236a79edca72
treef5ba50d3e31d038665d2cb15162a5baafa736688
parent576d577438f1193bbc934e904b809d5b23b8d54e
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>
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