summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-25 00:23:27 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-08-25 00:23:27 (GMT)
commitffdb37081cac1fcaa6f62f38f18b8d271e95eb9c (patch)
tree03f69803e47d86af348471786ad44603a2b7f165 /examples/declarative/webview
parentf7a3ece15715bea8c8588aa0682e6f798a533cab (diff)
downloadQt-ffdb37081cac1fcaa6f62f38f18b8d271e95eb9c.zip
Qt-ffdb37081cac1fcaa6f62f38f18b8d271e95eb9c.tar.gz
Qt-ffdb37081cac1fcaa6f62f38f18b8d271e95eb9c.tar.bz2
Missed files.
Diffstat (limited to 'examples/declarative/webview')
-rw-r--r--examples/declarative/webview/evalandattach.html31
-rw-r--r--examples/declarative/webview/evalandattach.qml55
2 files changed, 86 insertions, 0 deletions
diff --git a/examples/declarative/webview/evalandattach.html b/examples/declarative/webview/evalandattach.html
new file mode 100644
index 0000000..c0992bb
--- /dev/null
+++ b/examples/declarative/webview/evalandattach.html
@@ -0,0 +1,31 @@
+<body bgcolor=gray onload="ftext.confirmed.connect (ftext_confirmed); ">
+ <script>
+ do_it = function () {var oPressed = document.getElementById('pressed');
+ oPressed.innerHTML = 'MouseRegion in QML clicked!';};
+ ftext_confirmed = function () { statusText1.text = ftext.text; var oT = document.getElementById('htmlTextInput'); oT.value = ftext.text }
+ </script>
+ <table border=1>
+ <tr>
+ <td>&nbsp</td>
+ <td id='pressed'></td>
+ </tr>
+ <tr>
+ <td><label for='htmlTextInput'>Type something:</label></td>
+ <td><input type='text' name='htmlTextInput' size='25' id='htmlTextInput'
+ onfocus="statusText2.text = 'Focus in html text input.'"></td>
+ </tr>
+ <tr>
+ <td><label for='htmlButton'>&nbsp;</label></td>
+ <td>
+ <input type='button' id='htmlButton' value='Push'
+ onclick="var oText = document.getElementById('htmlTextInput'); statusText1.text = oText.value; ftext.text = oText.value" />
+ </tr>
+ </table>
+ <p>
+ Below a qml(QFxItem) object inside webkit:
+ </p>
+ <object data=content/FieldText.qml TYPE=application/x-qt-plugin id="ftext_id" text="" label="Cool:" width="200"
+ objectname="ftext">
+ </object>
+</body>
+
diff --git a/examples/declarative/webview/evalandattach.qml b/examples/declarative/webview/evalandattach.qml
new file mode 100644
index 0000000..bf7f25e
--- /dev/null
+++ b/examples/declarative/webview/evalandattach.qml
@@ -0,0 +1,55 @@
+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
+ interactive: true
+ settings.pluginsEnabled: true
+ javaScriptWindowObjects: [
+ Object {
+ id: txt
+ WebView.windowObjectName: "statusText1"
+ property string text: "Click me!"
+ },
+ Object {
+ id: txt2
+ WebView.windowObjectName: "statusText2"
+ property string text: ""
+ }
+ ]
+ url: "evalandattach.html"
+ }
+
+}