From 1c16d39da263ba97e8bafcc55e9dd78592d7b9bd Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 30 Sep 2016 12:29:12 +0200 Subject: Doc: Do not advise to overwrite QWidget::contextMenuEvent() There's also QWidget::setContextMenuPolicy and QWidget::customContextMenuRequested, which is arguably a better approach. Anyhow, this isn't specific to QWebEngineView, so let's leave it at that. Finally, there's no need to call triggerPageAction if you add an action to a menu. Change-Id: I0c84038746a78316ed6b90a98b68fa5eb95fbad5 Reviewed-by: Leena Miettinen Reviewed-by: Michal Klocek --- src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/webenginewidgets') diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc index 5a4c1b52b..5b96459af 100644 --- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc @@ -65,16 +65,13 @@ The zoomFactor() property enables zooming the contents of the web page by a scale factor. - If you require a custom context menu, you can implement it by reimplementing - \l{QWidget::}{contextMenuEvent()} and populating your QMenu with the actions - obtained from pageAction(). Additional functionality, such as reloading the view, - copying selected text to the clipboard, or pasting into the view, is - encapsulated within the QAction objects returned by pageAction(). These - actions can be programmatically triggered using triggerPageAction(). - Alternatively, the actions can be added to a toolbar or a menu directly. - The web view maintains the state of the returned actions but allows - modification of action properties such as \l{QAction::}{text} or - \l{QAction::}{icon}. + The widget features a context menu that is tailored to the element at + hand, and includes actions useful in a browser. For a custom context menu, + or for embedding actions in a menu or toolbar, the individual actions are available + via \l pageAction(). The web view maintains the state of the returned actions, + but allows modification of action properties such as \l{QAction::}{text} or + \l{QAction::}{icon}. The action semantics can also be triggered directly through + triggerPageAction(). If you want to provide support for web sites that allow the user to open new windows, such as pop-up windows, you can subclass QWebEngineView and -- cgit v1.2.3