Porting a Qt widget application to a web application
-
wrote on 5 Dec 2014, 09:46 last edited by
I have a fairly mature and quite complex GUI which is currently implemented using Qt widgets. The GUI is well-separated from its underlying 'engine' code that provides the functionality which is controlled from the GUI, but nevertheless the GUI code itself is still rather complex, with numerous interactions between widgets on different parts of the screen.
In the medium term we would like to be able to run the application remotely, with the GUI on one computer and the main application running on another. There are a couple of approaches we could potentially use for this...
- Keep the existing Qt widget-based GUI unchanged, run it under Windows and use RemoteApp to relay the GUI to the remote computer; if the latter is not running Windows then open-source RemoteApp clients such as FreeRDP can be used.
- Tear up the existing Qt Widget-based GUI and re-code the entire GUI using Java and HTML/JavaScript. We've already done this for a simplified form of the GUI, and it works quite well but we go pale at the prospect of doing it for the whole thing.
- Something else...?
I'm looking for some advice about whether Qt can provide a third alternative. For us, the most perfect solution would be if Qt itself could be made to render its widgets in a browser rather than on the desktop, but there seems little immediate prospect of that. Nevertheless I've read about QML, Qt WebEngine and Qt WebChannel, and I'm wondering whether these may be useful in this context. One the basis of what I've read, WebEngine (like WebKit) is primarily for displaying web pages within a Qt application, which is the opposite of what I'm trying to do, and WebChannel is for facilitating a Qt-based server application to provide text data to a remote client; nevertheless when I see things like "Qt WebChannel [is] a new module to bridge the gap between QML/C++ and HTML/JavaScript for Qt WebKit and other browser engines":http://qt-project.org/wiki/New-Features-in-Qt-5.4 I wonder if I'm missing something.
So, to state my question in simple terms: is there a way that by using the new Qt web classes I can ease the path to making my Qt widget application into a web application, with less work than rewriting the whole thing in Javascript? Or am I simply misunderstanding what is being described here?
-
Qt itself does not provide such functionality.
There are projects out there trying to do it, like "QtWui":http://qtwui.sourceforge.net/ or something like "Wt":http://www.webtoolkit.eu/wt/ that is inspired by Qt. I don't know the level of maturity of these though.
-
wrote on 11 Dec 2014, 14:24 last edited by
Thank you; I think it's clear that the first of my options (run the application on a Windows desktop and use RemoteApp) is the way forward for the time being.
-
wrote on 9 Jan 2015, 09:15 last edited by
Maybe it's useful the following link for you
-
wrote on 9 Jan 2015, 09:41 last edited by
That looks interesting, thank you.
-
wrote on 9 Jan 2015, 10:18 last edited by
I'm in the same your situation right now, i'm looking for a way to wrap my widget application in to a web application.
The Qt For Google Native Client it's not updated since 2012 and i I have not found some kind of tutorial about it...
The GTK+ Broadway solution if useful only with a gtk application.
If you have some news please share it with me :)
Thanks
-
wrote on 9 Jan 2015, 10:33 last edited by
I doubt it is ever going to be completely feasible, but...
Just daydreaming here... Qt 5 uses plugable backends. That means that you can develop your own backend to render your application to, and to deal with input and other platform dependent things. Perhaps it would be possible to develop a plugin that would work with a web server to provide an application through the web, perhaps rendering on a HTML 5 canvas. I did not look into that at any way, just daydreaming here... I'm sure there are many pitfalls and obstacles to actually doing that.
-
wrote on 9 Jan 2015, 20:08 last edited by
Maybe it's worth looking at "emscripten qt":http://vps2.etotheipiplusone.com:30176/redmine/projects/emscripten-qt/wiki
-
@ Andre, are you daydreaming of something like "this":https://github.com/jhihn/Vaudeville ?
-
wrote on 10 Jan 2015, 10:13 last edited by
Well, that does indeed look like roughly what I had in mind, though it seems to be in a very immature state. Still, I won't work on it myself, since I don't have much interest in web technology. Furthermore, I don't think this will ever yield satisfactory performance.