I'm using the new WebEngine to play around and learn.
I've installed QT 5.4.0 on my computer. I noticed that qwebchannel.js is not found in the SDK installed on my computer. I found it on the Git source.
My desktop application when running navigates automatically to a http page that I have created. So I have access to the content connected to the QWebEngineView.
Please explain what steps to take so I can make this work?
bq. I’ve installed QT 5.4.0 on my computer. I noticed that qwebchannel.js is not found in the SDK installed on my computer.
On my system it is at path <QtDir>/5.4/Src/qtwebchannel/src/webchannel/. See if you have it there.
For the implementation of QWebchannel I would suggest you to follow "this":http://doc.qt.io/qt-5/qtwebchannel-standalone-example.html example. It is self-explanatory.
Check out the index.html in it for what you have to add in your http page.
I have had a look at that example. What I don't understand is if qwebchannel.js is something that has to be included in every project using QWebChannel?
The version of Qt 5.4 that I have installed on my Windows computer is.
There is no ./src/qwebchannel/src/webchannel folder.
I guess that the folder you refer to is something found in the Git repository source code.
bq. What I don’t understand is if qwebchannel.js is something that has to be included in every project using QWebChannel?
Not compulsory. You can load it in HTML page from a other location too, like network or any other physical path on your machine. But as far as I understand qwebchannel.js is necesssary.
bq. There is no ./src/qwebchannel/src/webchannel folder.
May be you have not installed the source components during installation of Qt. Anyway both files should be the same.
Maybe you can help me get the StandAlone example up and running.
I've downloaded the qwebchannel.js file and added it to the path so the StandAlone project can find it. It Build and starts up. I can see the dialog but communication with the HTML file using websocket doesn't seem to work.
Do I need some magical step to get the communication up and running ?
Did it invoke the browser ?
It invokes Google Chrome with this file in the navigation field.
I can see an input box field but it's empty with no text.
Ok. Now keeping the Qt Dialog window open, goto the browser and just append ?webChannelBaseUrl=ws://127.0.0.1:12345 to file:///C:/Qt/Qt5.4.0/Examples/Qt-5.4/webchannel/build-standalone-Desktop_Qt_5_4_0_MSVC2013_OpenGL_64bit-Debug/index.html and reload.
That worked like a charm. Thanks a lot. That was the missing piece. :-)
Glad that it worked :)
Please mark it as solved by editing the post title and prepend [solved].