summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview/content/Mapping/Map.qml
blob: 6c3b0218b3d56a2215655dd18757b2f6d3eef79a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Qt 4.6
import org.webkit 1.0

Item {
    id: page
    property real latitude: -34.397
    property real longitude: 150.644
    property string address: ""
    WebView {
        id: map
        anchors.fill: parent
        url: "map.html"
        javaScriptWindowObjects: QtObject {
            WebView.windowObjectName: "qml"
            property real lat: page.latitude
            property real lng: page.longitude
            property string address: page.address
            onAddressChanged: {map.evaluateJavaScript("goToAddress()")}
        }
    }
}