Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a Qt app over the web

I am writing an application using Qt and want to try and deploy it as a web-application. I want user's to be able to use my application by accessing it through a web browser. I'm guessing that's what a web-application is? What kind of options do I have? I've never looked into doing anything like this but I'd like to learn something new.

EDIT: What if I deployed my application on a Linux server and had users access/run it through a terminal? I think writing web application is going to be more complicated than I had originally thought.

like image 368
bkapVT Avatar asked Jul 01 '14 19:07

bkapVT


4 Answers

Interestingly, it is possible to compile Qt applications to javascript using emscripten-qt. These run fairly fast with Firefox's asm.js interpreter:

http://vps2.etotheipiplusone.com:30176/redmine/projects/emscripten-qt/wiki

like image 171
xioxox Avatar answered Oct 02 '22 18:10

xioxox


If all you have is a Qt application, then the best you can do is use Qt 5 and run it using a remote visualization package:

  1. Use WebGL streaming, introduced in Qt 5.10. Qt exposes a browser-connectible interface directly, without need for third-party code.

  2. For Qt 5.0-5.9, you can use the vnc platform plugin. Then connect using a web-browser based vnc client.

For many uses it might be sufficient, and certainly it's much less effort than coding up a web app.

like image 5
Kuba hasn't forgotten Monica Avatar answered Oct 21 '22 21:10

Kuba hasn't forgotten Monica


You're looking for Wt which provides a different set of drawing routines for many Qt GUI elements, turning them from lines on screen to HTML controls.

http://www.webtoolkit.eu/wt

It also handles websocket calls to provide interactivity. It seems a great idea, let us know how it works in practice.

like image 5
gbjbaanb Avatar answered Oct 21 '22 21:10

gbjbaanb


For the case of QML there is QmlWeb which is a JavaScript library that is able to parse QML-code and create a website out of it using normal HTML/DOM elements and absolute positions within CSS, translating the QML properties into CSS properties.

QmlWeb is a small project by Lauri Paimen that he’s already developing for a few years now. QmlWeb of course doesn’t yet support everything Qt’s implementation of QML does, but it already supports a quite usable subset of it. It supports nearly all of the most basic QML syntax. Moreover it has support for HTML input elements (Button, TextInput, TextArea are currently supported, more to come).

Well, QmlWeb is not finished. I hope Digia help with this project to make it ready with mature features.

like image 4
Nejat Avatar answered Oct 21 '22 20:10

Nejat