Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void Q3PtrCollection::setAutoDelete ( bool  enable  )  [inline]

Sets the collection to auto-delete its contents if enable is true and to never delete them if enable is false.

If auto-deleting is turned on, all the items in a collection are deleted when the collection itself is deleted. This is convenient if the collection has the only pointer to the items.

The default setting is false, for safety. If you turn it on, be careful about copying the collection - you might find yourself with two collections deleting the same items.

Note that the auto-delete setting may also affect other functions in subclasses. For example, a subclass that has a remove() function will remove the item from its data structure, and if auto-delete is enabled, will also delete the item.

See also:
autoDelete()

Definition at line 61 of file q3ptrcollection.h.

{ del_item = enable; }


Generated by  Doxygen 1.6.0   Back to index