summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview/evalandattach.qml
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-02-14 23:37:12 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-02-14 23:37:12 (GMT)
commit0010cbdd14ce167857ae9eb8f539ad7b1205542a (patch)
tree92d8b31cece70ad76abc867e3a34567a1e2c116c /examples/declarative/webview/evalandattach.qml
parent9bca64fc5eee598f97eba1052f1db250c5c7e43b (diff)
parent42dda19d82ceea48f19d356cfaf2b26acb763df8 (diff)
downloadQt-0010cbdd14ce167857ae9eb8f539ad7b1205542a.zip
Qt-0010cbdd14ce167857ae9eb8f539ad7b1205542a.tar.gz
Qt-0010cbdd14ce167857ae9eb8f539ad7b1205542a.tar.bz2
Merge branch 'master' of ../../qt/master
Diffstat (limited to 'examples/declarative/webview/evalandattach.qml')
-rw-r--r--examples/declarative/webview/evalandattach.qml54
1 files changed, 54 insertions, 0 deletions
diff --git a/examples/declarative/webview/evalandattach.qml b/examples/declarative/webview/evalandattach.qml
new file mode 100644
index 0000000..1b211c9
--- /dev/null
+++ b/examples/declarative/webview/evalandattach.qml
@@ -0,0 +1,54 @@
+import Qt 4.6
+
+Item {
+ height: 640
+ width: 360
+ Text {
+ id: teksti
+ text: webView.statusText1
+ anchors.top: parent.top
+ height: 30
+ anchors.left: parent.left
+ width: parent.width/2
+ }
+
+ Text {
+ id: teksti2
+ text: webView.statusText2
+ anchors.top: parent.top
+ height: 30
+ anchors.left: teksti.right
+ anchors.right: parent.right
+ }
+
+ MouseRegion {
+ anchors.fill: teksti
+ onClicked: { webView.evaluateJavaScript ("do_it()") }
+ }
+
+ WebView {
+ id: webView
+ property alias statusText1: txt.text
+ property alias statusText2: txt2.text
+ anchors.top: teksti.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ focus: true
+ settings.pluginsEnabled: true
+ javaScriptWindowObjects: [
+ QtObject {
+ id: txt
+ WebView.windowObjectName: "statusText1"
+ property string text: "Click me!"
+ },
+ QtObject {
+ id: txt2
+ WebView.windowObjectName: "statusText2"
+ property string text: ""
+ }
+ ]
+ url: "evalandattach.html"
+ }
+
+}