QGraphicsView draw items not visible in view...
-
Hey
I have a graph with some lines. Some of the lines are very large, and the bounding box extend pass the screen, Sadly at that point QGraphicsView decides to not draw item & my line dissapears.
Say if i Have a rect item at 500/500, and inside that item I have a path that stretches all the way to 0,0. But my view only show 100x100 rect. So the rect far away + path of it does not render.
How can I "force" qgraphicsView to draw items regardless of their visibility on screen?
TIA
-
@Dariusz
I admit I have not tried it, but it would seem very strange to me if "Sadly at that point QGraphicsView decides to not draw item & my line dissapears.". I would expect it merely to clip whatever there is to the visible view area; if it omitted it completelyQGraphicsView
would surely be unusable.Say if i Have a rect item at 500/500, and inside that item I have a path that stretches all the way to 0,0.
What do you mean by this? Are you putting further line items on top of a rect item as children? The vital thing is that you must not draw outside a
QGraphicsItem::boundingRect()
andQGraphicsItem::childrenBoundingRect()
. If you do, the view will misdraw. You can overrideQGraphicsItem::boundingRect()
for your items if you need to. Is this perhaps your situation?