Seite 1 von 1

[gelöst] delete

Verfasst: 17. Januar 2012 08:11
von toba
Hi, ganz blöde Frage:

Wenn ich delete auf ein Objekt anwende, werden die Childs automatisch mitgelöscht oder muss ich im destruktor mit childitems mir die liste geben lassen und alle selbst löschen?
Hänge an ein QGraphicsRectItem ein Child von QGraphicsTextItem. z.B. über selectedItem rufe ich delete vom QGraphicsRectItem auf. (grob gesagt)

thx!

Re: delete

Verfasst: 17. Januar 2012 09:11
von franzf
Doku zum QGraphicsItem-Destruktor (QGraphicsItem::~QGraphicsItem()) steht alles wissenswerte :)

Re: delete

Verfasst: 17. Januar 2012 09:28
von toba
hmpf, danke!..
hatte wohl vorhin tomaten auf den augen..

Code: Alles auswählen

Destroys the QGraphicsItem and all its children. If this item is currently associated with a scene, the item will be removed from the scene before it is deleted.

Note: It is more efficient to remove the item from the QGraphicsScene before destroying the item.