PDA

View Full Version : Qt backend (C++) Webpage Frontend (HTLM, php)



pirata
30th September 2015, 01:02
I have a QT application written in C++ and running on a raspberry pi. All working fine.
The application controls the hardware on the 'pi' (GPIO and USB).

To access the Qt application on the raspberry pi, I ssh (X11 tunnel enabled) and run the application remotely. This allows me to control the 'pi' hardware from a remote location.

I wish to change this configuration and create a webpage as the Frontend and C++ Qt as the backend.
This way any computer with a web browser can access the 'pi'.

Is this possible using QT?
How would the two be linked?
Would the webpage have Qt widgets?

Any 'pointers' appreciated.

jefftee
30th September 2015, 07:42
The simplest approach IMHO would be to have your C++ code listen for http requests and provide a RESTful interface. Use XML or JSON for request/response data. The RESTful interface can be as complex or simple as you require.

anda_skoa
30th September 2015, 09:55
This could be helpful: http://stefanfrings.de/qtwebapp/tutorial/index.html

Cheers,
_

pirata
1st October 2015, 05:02
The simplest approach IMHO would be to have your C++ code listen for http requests and provide a RESTful interface. Use XML or JSON for request/response data. The RESTful interface can be as complex or simple as you require.

Agree, used this as foundation to trap http requests.
http://www.bogotobogo.com/Qt/Qt5_QTcpServer_Client_Server.php