summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-08-16 18:41:02 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-08-20 18:16:03 +0200
commit6ffb1797617c65bef34d7ce19b07ab07db89aa0b (patch)
tree922f65a65a8ce07c3b41e8e56ae05a70c928d055 /examples
parentc1c7c3cfa9d8c3e6f05095d0880a84a13a0d9e01 (diff)
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 <andras.becsi@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/browser/tabwidget.cpp6
-rw-r--r--examples/widgets/browser/webview.cpp2
2 files changed, 0 insertions, 8 deletions
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)