Hi.

I'm newbie on programming and have a doubt about the memory leaks.

I have a QGraphicsScene with a parent, this is ok, it will be erased when the app closes or the parent is distroyed, but i want to add QGraphicsPixmapItem.
Qt Code:
  1. void eMain::load_art() {
  2.  
  3. QGraphicsPixmapItem *pItem = new QGraphicsPixamItem();
  4. pItem->setPixmap(QPixmap(strToPixmapPath));
  5. myScene->setSceneRect(0, 0, QPixmap(strToPixmapPath).width(), QPixmap(strToPixmapPath).height());
  6. myScene->addItem(pItem);
  7. }
To copy to clipboard, switch view to plain text mode 

That QGraphicsPixmapItem is a memory leak, right? Could i set a parent QGraphicsItem or something?

Thanks and sotty if is a stupid question.