summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-28 04:54:46 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-08-28 04:54:46 (GMT)
commit1a742b1a1c646d7941f3f714b21c2ef927a0390b (patch)
tree27415deffc45d6c6cfc9d4ac6fdd9ea276b7b79a /examples/declarative/webview
parent9f5ab512b6293c28367052c46b12413f2f70b181 (diff)
downloadQt-1a742b1a1c646d7941f3f714b21c2ef927a0390b.zip
Qt-1a742b1a1c646d7941f3f714b21c2ef927a0390b.tar.gz
Qt-1a742b1a1c646d7941f3f714b21c2ef927a0390b.tar.bz2
New window creation in WebView.
Diffstat (limited to 'examples/declarative/webview')
-rw-r--r--examples/declarative/webview/newwindows.html3
-rw-r--r--examples/declarative/webview/newwindows.qml28
2 files changed, 31 insertions, 0 deletions
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..7fd9d63
--- /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 with WebView.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 }
+}