Can't get QWebchannel demos to work
-
Using VS2013 (or QtCreator) , Win 7 64 bit. Using ChatServer and ChatClient-html. Start the server, then start chatclient.html in Chrome. I can type in a name in the client and press login, nothing shows up in the console window except "Keep Alive Check()". The client "Users" list doesn't change. If I put breakpoints in the server (when running on VS2013), I can see lots of activity. But after the server sendMessage() function, if I catch this in Chrome in qwebchannel.js in the "this.transport.onmessage = function (message)" method, it always goes to the default case and prints out "invalid message received". The message sent was something like "{"data":{"chatserver":{"methods":[["deleteLater",3], ["login", 11], ...". This looks reasonable to me.
Has anyone got the demos to work on Windows? Any tips? Or wait for 5.4.1?
-
Same here, with Ubuntu...
-
hi, You need download qwebchannel.js file from qt "5.4" branch, not "dev".
https://github.com/qtproject/qtwebchannel/tree/5.4/src/webchannel -
Also, when you installed the sources along with the rest of Qt 5.4.0, the file can be found here:
@<QtDir>/Src/qtwebchannel/src/webchannel/qwebchannel.js@ -
Yeah, pretty frustrating if examples don't work out of the box.
Filed it as an issue here
qwebchannel.js can be found in the following directory: http://code.qt.io/cgit/qt/qtwebchannel.git/tree/src/webchannel