summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-09-18 17:40:29 +0200
committerMichal Klocek <michal.klocek@qt.io>2019-09-26 12:28:32 +0200
commitb44ed0fb99cd3d7047fcd322010c27cfa7989a18 (patch)
tree07f94dda66d57c7a070d3d0b94f24a2bcfd39839 /src/webenginewidgets
parente77ec61b7ba1fb71b397ef358036b5057a0cb39b (diff)
Reuse action for back, forward, reload web actions
Until now back, forward, reload web action where created for context menu and bind to current webview. This change makes the binding to page instead. Change-Id: Id27db4a110e624f6ea916f31f529c21caa35668b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 7b66ac876..2b18d63b1 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -2539,16 +2539,13 @@ void QContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
switch (menuItem) {
case ContextMenuItem::Back:
- action = new QAction(QIcon::fromTheme(QStringLiteral("go-previous")), QWebEnginePage::tr("&Back"), m_menu);
- QObject::connect(action, &QAction::triggered, thisRef->d_ptr->view, &QWebEngineView::back);
+ action = thisRef->action(QWebEnginePage::Back);
break;
case ContextMenuItem::Forward:
- action = new QAction(QIcon::fromTheme(QStringLiteral("go-next")), QWebEnginePage::tr("&Forward"), m_menu);
- QObject::connect(action, &QAction::triggered, thisRef->d_ptr->view, &QWebEngineView::forward);
+ action = thisRef->action(QWebEnginePage::Forward);
break;
case ContextMenuItem::Reload:
- action = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), QWebEnginePage::tr("&Reload"), m_menu);
- QObject::connect(action, &QAction::triggered, thisRef->d_ptr->view, &QWebEngineView::reload);
+ action = thisRef->action(QWebEnginePage::Reload);
break;
case ContextMenuItem::Cut:
action = thisRef->action(QWebEnginePage::Cut);