Your page seems interesting. I didn't studied all.
What I did, it was to follow the steps from: http://www.kdab.com/qt-webchannel-br...-gap-cqml-web/
import QtWebChannel 1.0
import QtWebKit 3.0
import QtWebKit.experimental 1.0
//Now, let’s create an object that we want to publish to the HTML/JavaScript clients:
QtObject {
id: myObject
// the identifier under which this object
// will be known on the JavaScript side
WebChannel.id: "foo"
// signals, methods and properties are
// accessible to JavaScript code
signal someSignal(string message);
function someMethod(message) {
console.log(message);
someSignal(message);
return "foobar";
}
property string hello: "world"
}
//Publishing the object to the HTML clients in your WebView is as simple as
WebView {
experimental.webChannel.registeredObjects: [myObject]
}
import QtWebChannel 1.0
import QtWebKit 3.0
import QtWebKit.experimental 1.0
//Now, let’s create an object that we want to publish to the HTML/JavaScript clients:
QtObject {
id: myObject
// the identifier under which this object
// will be known on the JavaScript side
WebChannel.id: "foo"
// signals, methods and properties are
// accessible to JavaScript code
signal someSignal(string message);
function someMethod(message) {
console.log(message);
someSignal(message);
return "foobar";
}
property string hello: "world"
}
//Publishing the object to the HTML clients in your WebView is as simple as
WebView {
experimental.webChannel.registeredObjects: [myObject]
}
To copy to clipboard, switch view to plain text mode
But I don't have the module "WebKit" build for my phone version so the example above doesn't work. I do have the "WebChannel" module though, and the "WebView" module has fewer features than the original: for example I can't set a "html: " attribute. I wanted to set the "html: " from QML to the HTML file contains, then put the content from my JS file inside QML and then I could access the variables.
I will study your page and hope I get things done. Thank you again.
Bookmarks