Hi there,

I'm currently working on an application which makes use of QtJambi and I
experience major performance problems. The situation is the following:
I've got a QGraphicsView which is used to display a street map and cars
moving on it. Streets and cars both are custom graphics items. The
graphics view displays only a small fraction of the map. Every 50ms the
position of all cars is updated.

QtJambi takes too much time redrawing the graphics view. Profiling the
C++ Qt libraries, I found out that in my case more than 40% of the time 
is spent in QGraphicsScene::items(const QPolygonF &polygon, ...) (called 
by QGraphicsView::paintEvent to determine the visible items) which makes 
use of several methods  which in turn call QGraphicsItem::boundingRect.
As the graphics items are custom graphics items implemented in Java, a 
call to boundingRect (C++ -> Java) is very expensive.

First of all I'm wondering whether this is a known problem (with a known 
solution)?

If not, a solution to it would be to install a bounding rect cache 
somewhere on the C++ layer, either directly in QGraphicsItem or in 
QGraphicsScene. I'm not that familiar with the Qt code so I'm asking you 
whether this is a good idea at all or whether you see any other way to 
fix this problem.

Regards,
Matthias Kleine
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to