path: root/src/webenginewidgets
diff options
authorPierre Rossi <>2014-04-09 18:03:23 +0200
committerThe Qt Project <>2014-04-10 09:36:51 +0200
commit777c0934d6ff9dbaccb4f408becda3af6638ac2f (patch)
tree777ca73b8cee88f667c3490f8799fe6093106208 /src/webenginewidgets
parentb6bf63c3fa9d959a5ab3e3c04ef848687f15a718 (diff)
Fix an false positive assertion with context menu
Due to the asynchronous nature of context menu events in chromium, we need to filter out the Qt generated events, and rely of what comes back from the chromium side. We keep a flag to ensure we're always in a consistent state, but the part re-setting it in QWEView went missing. This simply re-adds it together with initializing it to false upon view construction. Change-Id: I5d187faf93742898c96a1951b7dc477ce1b3f5bd Reviewed-by: Peter Varga <>
Diffstat (limited to 'src/webenginewidgets')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index c8fe9c383..3e6efafbd 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -89,6 +89,7 @@ void QWebEngineViewPrivate::bind(QWebEngineView *view, QWebEnginePage *page)
: QWidgetPrivate(QObjectPrivateVersion)
, page(0)
+ , m_pendingContextMenuEvent(false)
@@ -221,10 +222,12 @@ void QWebEngineView::setZoomFactor(qreal factor)
bool QWebEngineView::event(QEvent *ev)
+ Q_D(QWebEngineView);
// We swallow spontaneous contextMenu events and synthethize those back later on when we get the
// HandleContextMenu callback from chromium
if (ev->type() == QEvent::ContextMenu) {
+ d->m_pendingContextMenuEvent = true;
return true;
return QWidget::event(ev);