summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview/newwindows.qml
blob: c62aba65ffca5cbe098bde84d7ec031996e5aa19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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
import org.webkit 1.0

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 }
}