summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-11-27 15:32:53 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-04 14:16:21 +0100
commit4ef1b438ba70b629655fe8e0eec0554968503f34 (patch)
treedb50224657df877c8eb4c2b100a474c3074672e3
parent27f087d120c9a254ea81d89104d6d12c744987e2 (diff)
downloadqtwebkit-4ef1b438ba70b629655fe8e0eec0554968503f34.tar.gz
Doc: Update WebView code sample on Qt WebKit landing page
Replace obsolete 'Page' QML type used in the sample code with 'ScrollView' from Qt Quick Controls. Task-number: QTBUG-35154 Change-Id: I0a16a6158be028bf8a7975240411841c4e8200ef Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp14
-rw-r--r--Source/qtwebkit.qdocconf2
2 files changed, 10 insertions, 6 deletions
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index 31a8d1a54..c89ee79fe 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -1591,19 +1591,23 @@ QQuickWebPage* QQuickWebViewExperimental::page()
links to different pages load within the same WebView, but applications
may intercept requests to delegate links to other functions.
- This sample QML application loads a web page, responds to session
- history context, and intercepts requests for external links:
+ The following sample QML application loads a web page, responds to session
+ history context, and intercepts requests for external links. It also makes
+ use of \l ScrollView from \l {Qt Quick Controls} to add scroll bars for
+ the content area.
\code
import QtQuick 2.0
+ import QtQuick.Controls 1.0
import QtWebKit 3.0
- Page {
+ ScrollView {
+ width: 1280
+ height: 720
WebView {
id: webview
url: "http://qt-project.org"
- width: parent.width
- height: parent.height
+ anchors.fill: parent
onNavigationRequested: {
// detect URL scheme prefix, most likely an external link
var schemaRE = /^\w+:/;
diff --git a/Source/qtwebkit.qdocconf b/Source/qtwebkit.qdocconf
index d4da057e0..8b678c465 100644
--- a/Source/qtwebkit.qdocconf
+++ b/Source/qtwebkit.qdocconf
@@ -35,4 +35,4 @@ sourcedirs = WebKit/qt/Api WebKit/qt/WidgetApi WebKit/qt/docs Source/JavaScriptC
exampledirs = WebKit/qt/docs
imagedirs = WebKit/qt/docs
-depends += qtcore qtwidgets qtgui qtscript qtdoc qtprintsupport qtxml qtwebkitexamples
+depends += qtcore qtwidgets qtgui qtscript qtdoc qtprintsupport qtxml qtwebkitexamples qtquickcontrols