tags:

views:

33

answers:

1

QGraphicsView is often hooked up to a QGraphicsScene. What if I want to swap that QGraphicsScene for a new one? How can I accomplish this? Doing it right now is just drawing over the old one.

A: 

To swap the scene just call your view's setScene() again with a different QGraphicsScene object.

Luper Rouch
I'm currently doing this and it draws the new scene overtop of the old scene. In my example, it's just some lines and rectangles, so tihs is obvious. It does repaint it though, just not clearing it beforehand.
Mark
Can you post the complete code surrounding setScene() ? There must be a problem somewhere else, I do this in my own code and the setScene() call suffices, the scenes dont't overlap.
Luper Rouch