The fact that you update some part of the view doesn't mean all items present there get repainted.That's where the bounding rect comes in. The view tracks regions that have been changed and repaints only those items that intersect the region. If you disable automatic updates, you have to do all the updating stuff yourself (including calling the painting routine of each item you want painted).
If you move items often, it might be good for you to disable indexing, maybe that is what is degrading your performance.
No. But anyway it's good to cache the bounding rect instead of calculating it during every call to this method.> It also defines a local coordinate system for each item,
> so unless you want to strip away everything the graphics view gives you (I mean all
> benefits), it will be hard to get rid of boundingRect() and collision detection.
So each QGraphicsItem.paint() call requires a boundingRect() call.
The local coordinate system has nothing to do with the area you repaint.I can dig that because I can tell the QGraphicsView framework which areas to repaint. Going back to my .update() use above, I'm still not clear why the .update(QRect) function can not just redefine the local coordinate system starting at the .x() .y() of the QRect I pass to .update().
Yes, you can call the paint routine of each item occupying that area yourself. Before doing that you'll have to provide necessary transformations for the painter to reflect the proper coordinate system.Can I just repaint that QRect another way?
What great stuff are we talking about? Most "great stuff" in graphics view concerns determining what to repaint> On the other
> hand if you want to get rid of them, maybe you shouldn't use graphics view at all?
I disagree completely. There's lots of great stuff under the hood, that Indexing seems to kill the performance of when more than a few tens of thousands of QGraphicsItems are present in the scene. So an option is offered to turn indexing off, but no option to reimplement where to repaint? It just seems like not a very big step to uncover some real performance flexibility.
What exactly is your usecase? How come do you think you know better what to repaint than the GV architecture? Could you explain this?
Bookmarks