Hello,

I unsure about where I should place the thread, so please move if it's in the wrong section.

So, now to my problem.
In my Qt program I have a stackedWidget and one page of the widget has a QGraphicsView in it.
Before I enter the QGraphicsView I call a function which sets up my QGraphicsScene and loads a QML file:
Qt Code:
  1. stackScene = new MyScene(); //inherits from QGraphicsScene
  2. engine = new QDeclarativeEngine();
  3. stackData = new MyData(); // contains several Vectors
  4. engine->rootContext()->setContextProperty("stackData", stackData);
  5. QDeclarativeComponent component(engine, QUrl(QString::fromUtf8("qrc:QML/stackSceneQML.qml")));
  6. //qDebug() << component.errors() << endl;
  7. object = qobject_cast<QGraphicsObject *>(component.create());
  8. stackScene->addItem(object);
  9.  
  10. // process to QGraphicsView
To copy to clipboard, switch view to plain text mode 

It works fine and all and I free all memory allocated with new from above when I leave the QGraphicsView:
Qt Code:
  1. delete stackScene;
  2. stackScene = NULL;
  3. // delete engine; commented, because it gives me segmention fault...
  4. // delete object; well same as above
  5. delete stackData;
  6. stackData = NULL;
To copy to clipboard, switch view to plain text mode 

Now the behaviour I can not explain:
The memory used is about 10 MB when I launch my program, entering the stackWidget with QGraphicsView
adds a few kB - but leaving it doesn't remove even one kB instead I stays and adds more kB when I switch to it again.
I stopped at 20MB...

I hope someone may have a clue about what's going wrong here.

It's really annoying.