Replacing Silverlight based Kiosk with QtWebKit



  • I am looking for some thoughts on how I might replace a Silverlight based kiosk system with QtWebKit. The current application runs the Silverlight application within a custom WTL program that contains WebControl (Microsoft's equivalent of QtWebKit). The goal is to move away from the old, dieing world of ATL and Silverlight to a QtWebKit/HTML5. In the past I have played a bit with QML, so I am open to the idea of a QtWebKit/QML solution...

    Here are the key features to the current application:

    • The core of the kiosk is Silverlight application that is hosted on an Apache server at the client site. This is vital as to allow quick updates of most of the system from the server. There are customers that will have upwards of 50~100 kiosks and the goal is that they only need to update the kiosks occasionally.
    • Silverlight is talking to the backend via Web Services
    • The Silverlight does communicate the wrapper WTL application via JavaScript, this is a feature Microsoft build into Silverlight that is being leveraged.

    Questions:

    • Is it possible to host a QML application on a server and have QtWebKit download it, as to follow the same basic model of the current system?
    • From all I know, if I am using QML, it will be able to talk to the QtWebKit's container, correct? If so, how?
    • The web services are all defined in a WSDL, is there any easy way to call these web services?
    • Looking into the pure HTML5 solution, I did find a WSDL2JavaScript tool, could that be used within a QML application that is hosted by QtWebKit?

    Sam



  • bq. Is it possible to host a QML application on a server and have QtWebKit download it, as to follow the same basic model of the current system?

    I'm not sure I have understood you correctly. QML is a Meta Language. You use it to create applications. QtWebKit is Qt's WebKit framework which you can use in your QML application. QtWebKit can't do anything alone.... But if you mean download qml files from server and apply them in your Application, this can be done. But it has nothing to do with QtWebKit itself... Or you want to apply qml file on link click in webpage currently loaded in WebKit? You then need to register URL handler in WebKit or simply parse requests in acceptNavigationRequest function.

    bq. From all I know, if I am using QML, it will be able to talk to the QtWebKit’s container, correct? If so, how?

    QML WebKit has some functions and signal/slots which you can use directly in QML. If you need more deep functionality you may use QtWebKitWidgets and export them into QML space.

    bq. The web services are all defined in a WSDL, is there any easy way to call these web services?

    WSDL is only describes functions and elements of SOAP-WebServices. You can use QtSOAP or any over 3rd libraries to call SOAP Services. You can even call it directly without any 3rd libs, simply constructing correct XML and sending it with QNAM

    bq. Looking into the pure HTML5 solution, I did find a WSDL2JavaScript tool, could that be used within a QML application that is hosted by QtWebKit?

    QML hosted by QtWebKit? What does it mean?

    Take a look on Qt WebKit demos and examples, Read about QML + C++ communications.



  • Thank you for the reply! It was very helpful. The big thing I am gathering is that I made a bad assumption... But first a bit of my experience with Qt and QML.

    The whole solution is a combination of both native clients (both .Net and Qt Widget) and web based (The Silverlight kiosk). When I started the QtWidget program, I first experimented with QML. Just an EXE that was QML based rather than widget based.

    My though had been this: Replace the Silverlight code with a HTML5/JavaScript based single-page application (SPA) and have it hosted in a Qt Widget based application using the QtWebKit.

    I am wondering if there might be another solution using QML and QtWebKit, but that was based on the assumption that QML is able to run within QtWebKit. From your reply, I gather it cannot.

    Are there any examples out there of how a QML application can get the QML code from a web server rather than being embedded into the executable?



  • You can create QML application with QtWebKit window/rectangle in this QML application and run HTML5/JavaScript in QtWebKit window, no problem with that.

    bq. but that was based on the assumption that QML is able to run within QtWebKit.

    You can create QtWebKit plugin which will run QML inside QtWebKit which is in QML application itself. Here is some demos: https://sites.google.com/site/qtqmlbrowserplugin/
    It will then work exactly like other browser plugins work... for example Flash.

    bq. Are there any examples out there of how a QML application can get the QML code from a web server rather than being embedded into the executable?

    In your QML application you mostly have something like this:

    @
    QDeclarativeView view = new QDeclarativeView;
    view->setSource(QUrl("qrc:/qml/Calculator.qml"));
    view->show();
    @

    Like you can see qml file loaded with help of QUrl from resources. But it can be also local file or http/https link...

    I think demos with qml browser plugin is a good example how QML loading from remote URLs are done.



  • @
    I am wondering if there might be another solution using QML and QtWebKit, but that was based on the assumption that QML is able to run within QtWebKit. From your reply, I gather it cannot.
    @

    More specifically, its the other way around. Technically they are completely different technologies, you can use one without the other. They are shipped as independent dlls.
    The integrate such that you can use html5 and use that as a qml-component.

    I would suggest you focus mostly on QML, as that will likely give you 90% of what you want. For the rest you might need the html capabilities of the webkit component.
    So after Qt is deployed on the kiosk, all you need is to provide a set of qml files on a server and you have the easiest even deployment.

    As qml demos go, I suggest starting with things like the flickr and the rss demo, they show well how to use web-apis to show content in your qml app.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.