diff options
Diffstat (limited to 'examples/declarative/webview/newwindows.qml')
-rw-r--r-- | examples/declarative/webview/newwindows.qml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/declarative/webview/newwindows.qml b/examples/declarative/webview/newwindows.qml new file mode 100644 index 0000000..5dd4cd5 --- /dev/null +++ b/examples/declarative/webview/newwindows.qml @@ -0,0 +1,30 @@ +// 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 + +Grid { + columns: 3 + id: pages + height: 300; width: 600 + + Component { + id: webViewPage + Rectangle { + width: webView.width + height: webView.height + border.color: "gray" + + WebView { + id: webView + newWindowComponent: webViewPage + newWindowParent: pages + url: "newwindows.html" + } + } + } + + Loader { sourceComponent: webViewPage } +} |