Qt World Summit: Register Today!

Porting a Qt widget application to a web application

  • 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?

  • Moderators

    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.

  • 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.

  • That looks interesting, thank you.

  • 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 :)


  • 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.

  • Lifetime Qt Champion

    @ Andre, are you daydreaming of something like "this":https://github.com/jhihn/Vaudeville ?

  • 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.

Log in to reply