summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNo'am Rosenthal <noam.rosenthal@nokia.com>2011-07-01 17:12:10 -0700
committerNo'am Rosenthal <noam.rosenthal@nokia.com>2011-07-01 17:14:30 -0700
commit84838548eaa579559e9da5ad0f52a604a15832da (patch)
tree3d437c1d367c1799e79c2bee349edeadc390604d /examples
parent22dce6d37782bcf4430ec52bbf905285c03faf29 (diff)
downloadqtwebchannel-84838548eaa579559e9da5ad0f52a604a15832da.tar.gz
Improved on the example
Removed qmlproject
Diffstat (limited to 'examples')
-rw-r--r--examples/qmlapp/index.html2
-rw-r--r--examples/qmlapp/qmlapp.qml6
-rw-r--r--examples/qmlapp/qmlapp.qmlproject20
3 files changed, 4 insertions, 24 deletions
diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html
index 981b208..7c904ab 100644
--- a/examples/qmlapp/index.html
+++ b/examples/qmlapp/index.html
@@ -4,7 +4,7 @@
<script>
function load() {
navigator.webChannel.init();
- navigator.webChannel.exec({a:1}, function(response) {
+ navigator.webChannel.exec({a:"This is a request from HTML"}, function(response) {
document.body.innerHTML = response.b;
});
}
diff --git a/examples/qmlapp/qmlapp.qml b/examples/qmlapp/qmlapp.qml
index 1c7f4e2..63ce985 100644
--- a/examples/qmlapp/qmlapp.qml
+++ b/examples/qmlapp/qmlapp.qml
@@ -6,11 +6,11 @@ Rectangle {
width: 1000
height: 360
WebChannel {
- id: webus
+ id: webChannel
useSecret: false
onRequest: {
var data = JSON.parse(request);
- response.send(JSON.stringify({b:'goodbye ' + data.a}));
+ response.send(JSON.stringify({b:'This is a response from QML'}));
}
}
@@ -19,7 +19,7 @@ Rectangle {
anchors.top: parent.top
settings.localContentCanAccessRemoteUrls: true
settings.developerExtrasEnabled: true
- url: "index.html?baseUrl=" + webus.baseUrl
+ url: "index.html?baseUrl=" + webChannel.baseUrl
}
Text {
diff --git a/examples/qmlapp/qmlapp.qmlproject b/examples/qmlapp/qmlapp.qmlproject
deleted file mode 100644
index 4a6891a..0000000
--- a/examples/qmlapp/qmlapp.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by QtCreator */
-
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-
- importPaths: ["/home/noam/depot/webus"]
- /* List of plugin directories passed to QML runtime */
- // importPaths: [ "../exampleplugin" ]
-}