PDA

View Full Version : GraphicsView Framework



RY
10th September 2008, 03:02
I know this is probably a stupid question, but if you put say two QGraphicsPixmapItems into a scene and you view it with QGraphicsView, how do you keep the Items from overlapping?

*Sorry, just noticed I posted my other one in the wrong thread...

wysota
10th September 2008, 08:03
If you want to force items not to overlap, reimplement QGraphicsItem::itemChange() for them - detect a collision and move the item so that it doesn't overlap.There is an example in the docs how to do it (only that in the example it makes sure not to move the item outside current scene bounds).