I've got a widget with a QGraphicsView and a QGraphicsScene, shown below.
I want to delete all items from the scene and create new ones, so I'm trying to delete the scene and create a new one.

myGraphicsWidget Constructor:
Qt Code:
  1. myGraphicsWidget::myGraphicsWidget(QWidget *parent)
  2. : QWidget(parent)
  3. {
  4. //Create a new scene
  5. myScene = new QGraphicsScene(this);
  6. myScene->setSceneRect(0, 0, 300.0, 300.0 );
  7.  
  8. //Creates items in scene myScene
  9. populateScene(myScene);
  10.  
  11. myView = new QGraphicsView(myScene);
  12. myView->setRenderHints(QPainter::Antialiasing);
  13.  
  14. QVBoxLayout *myLayout = new QVBoxLayout;
  15. myLayout->addWidget(myView);
  16. setLayout(myLayout);
  17. }
To copy to clipboard, switch view to plain text mode 

newScene:
Qt Code:
  1. void myGraphicsWidget::newScene(void)
  2. {
  3. //Delete previous scene
  4. delete myScene;
  5.  
  6. //Create a new scene
  7. myScene = new QGraphicsScene(this);
  8.  
  9. //Creates items in scene myScene
  10. populateScene(myScene);
  11.  
  12. //Code here to update the widget/view???? <-- Need code here
  13. }
To copy to clipboard, switch view to plain text mode 

When I try to run newScene(), I get a blank Widget.
Is there some code I need to insert at the end of newScene() to get it to update in the QGraphicsView and widget, or is this technique of deleting, creating and repopulating the scene not going to work?
Should I be deleting the individual items from the scene instead of deleting the whole scene?