0

I have a class which contains a QGraphicsScene. In some function I wish to "clear" this scene from all items (& then fill it up with new items).

I tried the following code, but that gave me an access violation:

NewScene->clear();

NewScene is defined as following:

private:
    std::unique_ptr<QGraphicsScene> NewScene;

What goes wrong, and how can I clear this scene?

Chris
  • 17,119
  • 5
  • 57
  • 60
paul23
  • 8,799
  • 12
  • 66
  • 149
  • Have you allocated memory for `NewScene`? i.e. in ctor `NewScene(new QGraphicsScene)`? – Naveen May 14 '12 at 15:27
  • @Naveen: ... Went through the constructors once again and found that I only allocated NewScene in the default constructor -.-. Solved now – paul23 May 14 '12 at 15:34

0 Answers0