PDA

View Full Version : Garbled marks when moving items in QGraphicsScene



extralucas
4th December 2010, 10:34
I have a class which inherits from QGraphicsScene. I use it to display diagrams (inheriting from QGraphicsPolygonItem) and arrows joining the diagrams (inheriting from QGraphicsLineItem). When I move the diagrams, the arrows leave some garbled marks. What should I do? Is there some better, proper word to name the phenomenon?

I attach a photo portraying nature of the problem.

Lykurg
4th December 2010, 11:07
this is most likely caused when you do custom painting and do not exactly respect the bounding rect of the item. Make sure you don't paint outside the bounding rect and "play" with the scenes update mode.

marcvanriet
4th December 2010, 22:23
Hi,

I have a similar problem when using the standard graphicsview items (QGraphicsTextItem) and when their size changes. There is a prepareGeometryChange() method that I think may be related, but haven't figured it out quite yet.

Best regards,
Marc