aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/webviewtabbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/webviewtabbar.cpp')
-rw-r--r--src/widgets/webviewtabbar.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/webviewtabbar.cpp b/src/widgets/webviewtabbar.cpp
index 71d3c92..9684e11 100644
--- a/src/widgets/webviewtabbar.cpp
+++ b/src/widgets/webviewtabbar.cpp
@@ -56,6 +56,9 @@ WebViewTabBar::WebViewTabBar(QWidget *parent) :
});
addAction(tabRightAction);
}
+
+ m_signalMapper = new QSignalMapper(this);
+ connect(m_signalMapper, SIGNAL(mapped(int)), this, SLOT(webAction(int)));
}
WebViewTabBar::~WebViewTabBar()
@@ -65,6 +68,11 @@ WebViewTabBar::~WebViewTabBar()
m_views.clear();
}
+QSignalMapper *WebViewTabBar::signalMapper()
+{
+ return m_signalMapper;
+}
+
int WebViewTabBar::addTab(QWebEngineProfile *profile, const QUrl &url)
{
WebView *view = new WebView(0);
@@ -132,3 +140,8 @@ void WebViewTabBar::updateVectorArrangement(int from, int to)
{
m_views.move(from, to);
}
+
+void WebViewTabBar::webAction(int action)
+{
+ currentView()->pageAction(static_cast<QWebEnginePage::WebAction>(action))->trigger();
+}