Qt and WebGL...

So I downloaded the Qt5 release candidate over the weekend to checkout the WebGL and JavaScript support I’ve heard about in the past. While I had no idea what I was doing (seriously Qt is an entirely foreign ecosystem these days), I was able to determine two things.

  1. What I was most interested in was QtQuick, which lets you implement widgets in JavaScript (actually QML which includes Javascript) and allows them to be callable from C++ (or any language Qt has bindings for). While I can’t find conclusive evidence; from what I can tell WebGL is not supported in QtQuick yet (though it looks like it’s planned). All canvas 2D operations are supported, so I’m guessing it’s just a matter of time until creating a custom Cesium widget for use in native apps is a possibility.

  2. On a much better note; the Qt version of WebKit works perfectly. Building the browser example and navigating to cesium.agi.com presented no issues. So at the very least, you can embed WebGL content in an application via their browser module. What’s even better is that you can reference local urls via their resource system. This means you can create “no server required” apps that reference local data. You can also call javascript functions on the page from C++. This may be a viable solution (today) for using Cesium in a native, thick client application. One idea would be to use czml-writer to generate CZML and then send it to Cesium running in the WebKit widget. This is similar to the Java applet shunter wrote way back when, but doesn’t require a browser or webserver. We might even be able to wrap it in a custom Cesium widget to have behavior similar to 1 above (albeit at a course interface level rather than wrapping the entire Cesium API).

That’s as far as I got, and while I probably won’t invest any time in it right now, I wanted to share what I learned in case someone else in interested in experimenting with it. While a native desktop rendering engine is always going to be the optimal choice, being able to write native apps that use Cesium may prove incredibly useful for a variety of use cases.


Want to update the related question in the FAQ - http://cesium.agi.com/FAQ.html#standalone

If you explore this farther, it could be a good blog post or tutorial.


I just wanted to also mention for Java fans that JavaFX supports a UI component called WebView that you can communicate through Java code to. It actually uses an implementation of webkit, but sadly doesn’t support webgl yet. It is pretty slick to integrate existing Java Desktop apps with html and javascript apps to create a single application.


and I see there has been some interest in webgl support


As i am working with python and using pyQt i wanted to know how can i use cesium in standalone application? Because as I am using Pyqt4 to develop standalone application of browser. It shows me there is no webGl support in your browser. I am searching for solution and got this group. If possible please guys can you help me with any solution.


pyQt4 does not support WebGL (because Qt4 doesn’t), and depending on how much data you are looking to load into Cesium, upgrading to pyQt5 may still result in slow Cesium performance. See this recent thread on Cesium in Qt’s built-in browser.

Hey Matthew,

Thanks for reply. I upgraded to pyqt5 and for small data it’s working perfect even kml version for cesium works perfect but now I am getting new data at every 5 sec and it’s around 80000 point location. And it’s taking time around 5 mins if I want to show interpolation. Is there any way I can make any parser and use it to make my data loading process faster ?



I’m not sure if 80,000 new location points every 5 seconds is going to be realistic for any javascript engine without some custom optimization that can pre-processes the data before rendering. Is it possible to implement a quad-tree approach to optimize your data feeds?