From 6ffb1797617c65bef34d7ce19b07ab07db89aa0b Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 16 Aug 2013 18:41:02 +0200 Subject: Implement QWebEnginePage::action for basic navigation. This imports code from qwebpage.cpp and QWebPageAdapter.cpp of WebKit into qwebenginepage.cpp and thus also restrict the license accordingly. Change-Id: Ic5da8f2b469109cb10132cbe6585f2d941b14403 Reviewed-by: Andras Becsi --- examples/widgets/browser/tabwidget.cpp | 6 ------ examples/widgets/browser/webview.cpp | 2 -- 2 files changed, 8 deletions(-) (limited to 'examples') diff --git a/examples/widgets/browser/tabwidget.cpp b/examples/widgets/browser/tabwidget.cpp index 47bcc2261..3c71b2d53 100644 --- a/examples/widgets/browser/tabwidget.cpp +++ b/examples/widgets/browser/tabwidget.cpp @@ -473,12 +473,10 @@ WebView *TabWidget::newTab(bool makeCurrent) setCurrentWidget(webView); // webview actions -#if defined(QWEBENGINEPAGE_ACTION) for (int i = 0; i < m_actions.count(); ++i) { WebActionMapper *mapper = m_actions[i]; mapper->addChild(webView->page()->action(mapper->webAction())); } -#endif if (count() == 1) currentChanged(currentIndex()); @@ -801,12 +799,10 @@ QWebEnginePage::WebAction WebActionMapper::webAction() const void WebActionMapper::rootTriggered() { -#if defined(QWEBENGINEPAGE_ACTION) if (m_currentParent) { QAction *gotoAction = m_currentParent->action(m_webAction); gotoAction->trigger(); } -#endif } void WebActionMapper::childChanged() @@ -835,11 +831,9 @@ void WebActionMapper::updateCurrent(QWebEnginePage *currentParent) m_root->setChecked(false); return; } -#if defined(QWEBENGINEPAGE_ACTION) QAction *source = m_currentParent->action(m_webAction); m_root->setChecked(source->isChecked()); m_root->setEnabled(source->isEnabled()); -#endif connect(m_currentParent, SIGNAL(destroyed(QObject*)), this, SLOT(currentDestroyed())); } diff --git a/examples/widgets/browser/webview.cpp b/examples/widgets/browser/webview.cpp index c7069f89c..18beaf65e 100644 --- a/examples/widgets/browser/webview.cpp +++ b/examples/widgets/browser/webview.cpp @@ -258,10 +258,8 @@ void WebView::wheelEvent(QWheelEvent *event) void WebView::openLinkInNewTab() { -#if defined(QWEBENGINEPAGE_ACTION) m_page->m_openInNewTab = true; pageAction(QWebEnginePage::OpenLinkInNewWindow)->trigger(); -#endif } void WebView::setProgress(int progress) -- cgit v1.2.3