diff options
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/webview/autosize.qml | 10 | ||||
-rw-r--r-- | examples/declarative/webview/evalandattach.qml | 1 | ||||
-rw-r--r-- | examples/declarative/webview/newwindows.html | 3 | ||||
-rw-r--r-- | examples/declarative/webview/newwindows.qml | 28 |
4 files changed, 36 insertions, 6 deletions
diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/webview/autosize.qml index 13004a8..dbd94e1 100644 --- a/examples/declarative/webview/autosize.qml +++ b/examples/declarative/webview/autosize.qml @@ -1,7 +1,7 @@ import Qt 4.6 // The WebView size is determined by the width, height, -// idealWidth, and idealHeight properties. +// preferredWidth, and preferredHeight properties. Rectangle { id: Rect color: "white" @@ -34,16 +34,16 @@ Rectangle { } } WebView { - idealWidth: Rect.width/2 - html: "The idealWidth is half." + preferredWidth: Rect.width/2 + html: "The preferredWidth is half." Rectangle { color: "#10000000" anchors.fill: parent } } WebView { - idealWidth: Rect.width/2 - html: "The_idealWidth_is_half." + preferredWidth: Rect.width/2 + html: "The_preferredWidth_is_half." Rectangle { color: "#10000000" anchors.fill: parent diff --git a/examples/declarative/webview/evalandattach.qml b/examples/declarative/webview/evalandattach.qml index bf7f25e..e755819 100644 --- a/examples/declarative/webview/evalandattach.qml +++ b/examples/declarative/webview/evalandattach.qml @@ -35,7 +35,6 @@ Item { anchors.left: parent.left anchors.right: parent.right focus: true - interactive: true settings.pluginsEnabled: true javaScriptWindowObjects: [ Object { diff --git a/examples/declarative/webview/newwindows.html b/examples/declarative/webview/newwindows.html new file mode 100644 index 0000000..f169599 --- /dev/null +++ b/examples/declarative/webview/newwindows.html @@ -0,0 +1,3 @@ +<h1>Multiple windows...</h1> + +<a target="_blank" href="newwindows.html">Popup!</a> diff --git a/examples/declarative/webview/newwindows.qml b/examples/declarative/webview/newwindows.qml new file mode 100644 index 0000000..9ff902e2 --- /dev/null +++ b/examples/declarative/webview/newwindows.qml @@ -0,0 +1,28 @@ +// Demonstrates opening new WebViews from HTML +// +// Note that to open windows from JavaScript, you will need to +// allow it on WebView with settings.javascriptCanOpenWindows: true + +import Qt 4.6 + +Row { + id: Pages + height: 200 + resources: [ + Component { + id: WebViewPage + Rectangle { + width: WV.width + height: WV.height + WebView { + id: WV + newWindowComponent: WebViewPage + newWindowParent: Pages + url: "newwindows.html" + } + } + } + ] + width: 500 + ComponentInstance { component: WebViewPage } +} |