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.
views:
33answers:
1
A:
To swap the scene just call your view's setScene()
again with a different QGraphicsScene
object.
Luper Rouch
2010-02-03 19:43:21
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
2010-02-03 19:53:25
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
2010-02-03 22:58:44