Network communications in QML only
-
I'm using a commercial device that allows to write QML application only, in Qt 4.8.5.
I need to find a way to communicate with the outside world but I cannot write the C++ backend, I'm stuck on ly with QML.There's no problem to set up a simple TCP Server (even written in Qt) to provide a REST service where my QML files can retrieve the data they need.
Looking at the documentation of Qt4 I'm not sure if there is a QML Tcp Client class. And QtWebSocket seems to belong to Qt5 only.
Any idea? -
It works! Thanks for the hint.
Last question: I have to update the values at least 5 times per second (best is 10). Of course the server is in the same LAN of the client. Do you think this is still the right approach?I mean, GET requests open and close the socket every time. If I had the availability of a C++ application I could open a TCP socket to be kept open. Do you see any problem to make 5-10 GET request per second continuously?
-
@Mark81 I'm not sure I can help you now regarding performance of repeated requests, but now that you know you can run some javascript on the device, could it be possible you try socket.io for instance by importing a javascript module in QML?