Quote Originally Posted by spawn9997 View Post
Hi all,

I am using a QGraphicsView to display anywhere from 1000 to 100,000+ items and I have figured out how to use QGraphicsItem::paint() to draw or not draw the items. This is pretty good except in the case of viewing the entire scene.
I have seen that even the chips example slows down when zoom is full. No problem, I have designed a pixmap that draws a simple representation of the items at a certain level.

Issue: Still slower (load, zoom, and pan wise) than I would like.

Setup: I have 2 QGraphicsItem's and they have children that are QGraphicsItems as well. These children are the ones being drawn. I have implemented that when the level of detail gets too low (zoomed out) the child items are not drawn but instead the parent items displays the aforementioned pixmap(s).

possible Problem: Child items must each call paint() which exits immediately. Still 100,000+ calls takes time.

Question: Is there anyway to, I don't know, maybe set the parent such that the child items paint() function is NOT called when it is not drawn?
-or- is it quicker to just hide them? (although I'd rather not hide them)


I have implemented cache of scene, item, pixmap, and view by which gave best performance.

thanx n advance,

JW
sw developer
You can also try setting QGraphicsView:ontSavePainterState on your view (of course you'll have to save/restore the painter state yourself in your paint() functions. But when you do not paint anything, you will save yourself some 100k calls to save/restore which should help.