QT 5.2 Cesium embedding

912 views
Skip to first unread message

matteo.de...@gmail.com

unread,
May 21, 2014, 5:28:25 AM5/21/14
to cesiu...@googlegroups.com
Hi, I'm trying to embedd Cesium in a QT 5.2 application in order to have a stand-alone version.

I started coding but I'm facing fluency issues since that when I load the CesiumViewer in a QGraphicsWebView the framePerSecond rate dramatically slows down, I suppose that i'm dealing wrong with QT settings.
I have post my code here:
http://stackoverflow.com/questions/23765010/qt-5-2-cesium-integration

Any ideas or suggestings to reach my goal?
Thanks

Patrick Cozzi

unread,
May 21, 2014, 8:47:37 PM5/21/14
to cesiu...@googlegroups.com, matteo.de...@gmail.com
I don't have any experience here, but this thread may be useful:


Patrick

Matthew Amato

unread,
May 21, 2014, 9:03:40 PM5/21/14
to cesiu...@googlegroups.com
While I'm no Qt expert, I have done some experiments in the past with embedding Cesium in a simple Qt app.  I don't recall any performance issues.  What platform are working on?  Did you build Qt yourself or are you using pre-built binaries?  I assume Cesium runs fast in a web browser on the same machine?


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

matteo.de...@gmail.com

unread,
May 23, 2014, 4:48:40 AM5/23/14
to cesiu...@googlegroups.com
Hi Matthew, right now i'm using qt creator 3.1.0 based on qt 5.2.1. I'm new to qt so I simply download the qt online installer for windows from the website.
Can you explain me better what you mean with this: "Did you build Qt yourself or are you using pre-built binaries?"

As i said here:
http://stackoverflow.com/questions/23765010/qt-5-2-cesium-integration
using a qwebView I'm not able to reach the same fps rate reached with the browser when loading just a cesium.Viewer from an html file embedded with the cesium library in the qrc resources.
If I try to load a more complex scene directly from internet like this one: http://cesiumjs.org/LotsOfSatellites/
my qt app try to load it and then freezes.
I don't now if that issue depends on the javascript engine used by qt,
or if there is the possibility to built qt for a specific machine in order to get better results, or even more i'm dealing wrong with the settings of my application. I'm just supposing.

Please can you look at my code on stackOverFlow at the above link, just to tell me if there are any errors in my creation process, and in my approach to the development.

Thank you in advance!

k1mra...@gmail.com

unread,
May 27, 2015, 8:55:19 AM5/27/15
to cesiu...@googlegroups.com
Did you actually upload any usable data into Cesium once it was embedded into your Qt app?  I have found that adding a simple entity/primitive does not have any affect on performance, but once you've loaded lots of data (via CzmlDataSource/KmlDataSource), performance deteriorates, you get very choppy movements, and double clicking any of the loaded items causes it to crash.

Matthew Amato

unread,
Jun 1, 2015, 10:56:40 PM6/1/15
to cesiu...@googlegroups.com
The last time I tried was probably over 2 years ago, so you got me curious and at first glance it looks like you are correct.  Using the browser example that ships with Qt, anything non-trivial is slow.  This appears to be a problem with how Qt implements their WebKit based engine and not a problem with WebKit itself.  Some googling revealed lots of people complaining about Qt browser performance. Unless I'm missing something, I'm afraid that Qt's browser implementation simply isn't good enough to run Cesium and there's little to nothing we can do on Cesium's end to change that.

One possibility would be to use something like CEF (https://bitbucket.org/chromiumembedded/cef) instead, I believe several people on the mailing list have had success with it, but I haven't personally used it.  If you are on Windows only, then Microsofts browser control may also be a good fit.

Sorry I don't have better news.  If you find any tips and tricks for tuning Qt to run Cesium better, We would love to hear it and it will be useful for others trying to do the same thing.

Matteo Di Paolantonio

unread,
Jun 2, 2015, 6:13:32 AM6/2/15
to cesiu...@googlegroups.com
Hi, and sorry for the delay, I can't add any good advice to what Mark said.

I tried using both QWebView and QGraphicsWebView classes to display a
Cesium scene with the same results, finally I had to accept the slow
frame rate and work with no more than 3 polygons at time (primitives,
not CZML/KML).

For your information I used: QT 4.8 and Cesium 1.0.

Good Luck!
> You received this message because you are subscribed to a topic in the
> Google Groups "cesium-dev" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cesium-dev/LVyZDQjbm5M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Mike LP

unread,
Jun 3, 2015, 5:11:02 PM6/3/15
to cesiu...@googlegroups.com, matteo.de...@gmail.com, matteo.de...@gmail.com
Something is just not right.  Can you post any sample code so we can see what is going on?
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "cesium-dev" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cesium-dev/LVyZDQjbm5M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Kihana Mixon

unread,
Jun 11, 2015, 9:54:51 AM6/11/15
to cesiu...@googlegroups.com
Here's a sample project demoing the sluggishness, I can not provide the czml file used as it is project related and can not be shared.

> You received this message because you are subscribed to a topic in the
> Google Groups "cesium-dev" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cesium-dev/LVyZDQjbm5M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/LVyZDQjbm5M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
CesiumAndQtTest.zip

Mike LP

unread,
Jun 12, 2015, 11:01:53 AM6/12/15
to cesiu...@googlegroups.com, k1mra...@gmail.com
I can't reproduce any sluggishness.  You can use the Sandcastle on your local machine/build, replacing your CZML into this sample. 

var viewer = new Cesium.Viewer('cesiumContainer', {
    selectionIndicator
: false,
    infoBox
: false
});

function loadKmlData() {
    viewer
.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/kml/facilities/facilities.kml'));
}

function loadCzmlData() {
    viewer
.dataSources.add(Cesium.CzmlDataSource.load('../../SampleData/Vehicle.czml'));
}

function clearData() {
    viewer
.dataSources.removeAll();
}

Sandcastle.addDefaultToolbarButton('Load KML Data', loadKmlData);

Sandcastle.addDefaultToolbarButton('Load CZML Data', loadCzmlData);

Sandcastle.addDefaultToolbarButton('Clear Data', clearData);

How big of a czml file are you dealing with?
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "cesium-dev" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cesium-dev/LVyZDQjbm5M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/LVyZDQjbm5M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.

k1mra...@gmail.com

unread,
Jun 12, 2015, 5:12:18 PM6/12/15
to cesiu...@googlegroups.com, k1mra...@gmail.com
I think we got off track, there is no sluggishness running in sandcastle, only when embedding in a Qt application.  Simply loading the facilities.kml file (provided in Sample Data of Cesium 1.9 download) will slow down response time in a Qt application (debug or release).  My czml file is 5 MB.  Matthew Amato already confirmed the sluggishness upthread.

Matthew Amato

unread,
Jun 15, 2015, 8:31:31 PM6/15/15
to cesiu...@googlegroups.com
Mike, were you running from inside a Qt application?  As I stated in my reply, I think the problem here is Qt's WebKit integration/perfornance itself.  I can easily reproduce the sluggishness that k1mray2000 is seeing.  Can you confirm how you tested for me.  If it is on Qt, I wouldn't mind taking a look at your machine to see what the difference may be.

k1mra...@gmail.com

unread,
Sep 28, 2015, 1:58:13 PM9/28/15
to cesium-dev
Just an FYI, disabling network adapters (used by virtual machines) in Device Manager solved the sluggishness for me.
Reply all
Reply to author
Forward
0 new messages