Matthias Kleine wrote:
> On Tue, 2009-01-13 at 09:53 +0100, Gunnar Sletta wrote: 
>>> First of all I'm wondering whether this is a known problem (with a known 
>>> solution)?
>> Many moving items in a scene is a common degenerate usecase for the 
>> default configuration of QGraphicsView. You can change the viewport 
>> update mode to do a full viewport update, in which case less time is 
>> spent in figuring out collisions etc...
> 
> Unfortunately, this does not help at all as in my case. Yes, I do have
> many moving items. Yet, these items are so small that only a tiny
> fraction of the graphics view has to be redrawn (imagine many 5x5 pixel
> cars on a full screen street map).
> Switching to full viewport update mode doesn't make things go any faster
> as then too much time is spent on actually redrawing graphics items
> (streets) which actually do not have to be redrawn. So I end up with
> about the same performance as with the normal update setup. Any
> suggestions?

If you replace your moving car items with QGraphicsPixmapItem's, does 
that solve the performance problem? That would cause the boundingRect() 
function to be called only on the C++ side, which in turn avoids the 
somewhat costly boundingRect java call. Its costly because it allocates 
a java object and two C++ objects while the C++ version does no allocations.

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

Reply via email to