#include </home/clem/local/src/opie/qmake/include/qptrcollection.h>
Inheritance diagram for QPtrCollection:

Public Types | |
| typedef void * | Item |
Public Member Functions | |
| bool | autoDelete () const |
| void | setAutoDelete (bool enable) |
| virtual uint | count () const =0 |
| virtual void | clear ()=0 |
Protected Member Functions | |
| QPtrCollection () | |
| QPtrCollection (const QPtrCollection &) | |
| virtual | ~QPtrCollection () |
| virtual Item | newItem (Item) |
| virtual void | deleteItem (Item)=0 |
Protected Attributes | |
| bool | del_item |
The QPtrCollection class is an abstract base class for the Qt collection classes QDict, QPtrList, etc. Qt also includes value based collections, e.g. QValueList, QMap, etc.
A QPtrCollection only knows about the number of objects in the collection and the deletion strategy (see setAutoDelete()).
A collection is implemented using the Item (generic collection item) type, which is a void*. The template classes that create the real collections cast the Item to the required type.
Definition at line 49 of file qptrcollection.h.
|
|
This type is the generic "item" in a QPtrCollection. Definition at line 58 of file qptrcollection.h. |
|
|
Constructs a collection. The constructor is protected because QPtrCollection is an abstract class. Definition at line 61 of file qptrcollection.h. References FALSE. |
|
|
Constructs a copy of source with autoDelete() set to FALSE. The constructor is protected because QPtrCollection is an abstract class. Note that if source has autoDelete turned on, copying it will risk memory leaks, reading freed memory, or both. Definition at line 62 of file qptrcollection.h. References FALSE. |
|
|
Destroys the collection. The destructor is protected because QPtrCollection is an abstract class. Definition at line 63 of file qptrcollection.h. |
|
|
Returns the setting of the auto-delete option. The default is FALSE.
Definition at line 52 of file qptrcollection.h. |
|
|
|
|
|
Virtual function that creates a copy of an object that is about to be inserted into the collection. The default implementation returns the d pointer, i.e. no copy is made. This function is seldom reimplemented in the collection template classes. It is not common practice to make a copy of something that is being inserted.
Definition at line 177 of file qptrcollection.cpp. Referenced by QGList::append(), QGVector::insert(), QGCache::insert_other(), QGCache::insert_string(), QGList::insertAt(), QGDict::look_ascii(), QGDict::look_int(), QGDict::look_ptr(), QGDict::look_string(), QGVector::operator=(), QGList::prepend(), QGVector::QGVector(), and QGList::replaceAt(). |
|
|
|
Definition at line 65 of file qptrcollection.h. Referenced by QCDict::deleteItem(), QPtrVector< type >::deleteItem(), QPtrList< type >::deleteItem(), QIntDict< type >::deleteItem(), QDict< type >::deleteItem(), QCache< type >::deleteItem(), QAsciiDict< type >::deleteItem(), and QStrList::operator=(). |
1.4.2