5

I have looked the Qt example about QWebChannel .

But its a C/S app. BTW it doesn't work on my computer(OS X 10.10.5, Qt5.5).

All my HTML contents come from local disk. I don't think it needs socket things.

new QWebChannel(navigator.qtWebChannelTransport, function(channel) {
    // all published objects are available in channel.objects under
    // the identifier set in their attached WebChannel.id property
    var foo = channel.objects.foo;
    // access a property
    alert(foo.hello);
    // connect to a signal
    foo.someSignal.connect(function(message) {
        alert("Got signal: " + message);
    });
    // invoke a method, and receive the return value asynchronously
    foo.someMethod("bar", function(ret) {
        alert("Got return value: " + ret);
    });
});

There is no

navigator.qtWebChannelTransport

such a thing, JS stopped there.

What should I fill with the first parameter ?


1 Answer 1

4

For QtWebEngine, you have to use qt.webChannelTransport.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.