The QCollection class is the base class of all Qt collections. More...
#include <qcollection.h>
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 | |
QCollection () | |
QCollection (const QCollection &) | |
virtual | ~QCollection () |
virtual Item | newItem (Item) |
virtual void | deleteItem (Item) |
Protected Attributes | |
bool | del_item |
The QCollection class is the base class of all Qt collections.
The QCollection class is an abstract base class for the Qt collection classes QDict, QList etc. via QGDict, QGList etc.
A QCollection knows only 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 51 of file qcollection.h.
typedef void* QCollection::Item |
Definition at line 60 of file qcollection.h.
|
inlineprotected |
Constructs a collection. The constructor is protected because QCollection is an abstract class.
Definition at line 63 of file qcollection.h.
|
inlineprotected |
Constructs a copy of source with autoDelete() set to FALSE. The constructor is protected because QCollection is an abstract class.
Note that if source has autoDelete turned on, copying it is a good way to get memory leaks, reading freed memory, or both.
Definition at line 64 of file qcollection.h.
|
inlineprotectedvirtual |
Destroys the collection. The destructor is protected because QCollection is an abstract class.
Definition at line 65 of file qcollection.h.
|
inline |
Returns the setting of the auto-delete option (default is FALSE).
Definition at line 54 of file qcollection.h.
|
pure virtual |
Removes all objects from the collection. The objects will be deleted if auto-delete has been enabled.
Implemented in QGDict, QGList, QCache< type >, QCache< LookupInfo >, QList< type >, QList< PyVariableContext::Scope >, QList< PyCallContext::Ctx >, QList< MemberName >, QList< MemberNameInfo >, QList< PageDef >, QList< DocNode >, QList< TagFileInfo >, QList< Grouping >, QList< ListItemInfo >, QList< QCString >, QList< Definition >, QList< MemberDef >, QList< TagPackageInfo >, QList< SectionHandler >, QList< DirRelation >, QList< MemberReference >, QList< DotNode >, QList< HtmlAttrib >, QList< TagPageInfo >, QList< VariableContext::Scope >, QList< IndexIntf >, QList< Entry >, QList< MemberGroup >, QList< DiagramItem >, QList< DotGroupCollaboration::Link >, QList< TagDirInfo >, QList< EntryNav >, QList< IncludeInfo >, QList< QString >, QList< RelatedCompound >, QList< DotFilePatcher >, QList< tcl_scan >, QList< ParameterItemHandler >, QList< VariableListEntryHandler >, QList< TagNamespaceInfo >, QList< NodeHandler >, QList< EntryHandler >, QList< TemplateVariant >, QList< MemberInfo >, QList< TagGroupInfo >, QList< ChildNodeHandler >, QList< DotWorkerThread >, QList< ExprAst >, QList< TemplateNode >, QList< NamespaceDef >, QList< T >, QList< void >, QList< ParamHandler >, QList< OutputGenerator >, QList< QDict< TemplateVariant > >, QList< GroupDef >, QList< IndexField >, QList< ListElem >, QList< DocSets::NodeDef >, QList< CallContext::Ctx >, QList< DotConstString >, QList< RowHandler >, QList< TemplateEngine::Private::IncludeEntry >, QList< DotRunner::CleanupItem >, QList< Formula >, QList< TemplateToken >, QList< GenericsCollection >, QList< DotGroupCollaboration::Edge >, QList< Statistics::stat >, QList< TagIncludeInfo >, QList< ActiveRowSpan >, QList< FilePair >, QList< ClassDef >, QList< Define >, QList< BaseClassDef >, QList< EdgeInfo >, QList< IncludeHandler >, QList< TemplateNodeIf::GuardedNodes >, QList< TagMemberInfo >, QList< TemplateNodeWith::Mapping >, QList< DotRunner >, QList< RefItem >, QList< FileName >, QList< SearchDocEntry >, QList< FlowChart >, QList< SearchDefinitionList >, QList< SectionInfo >, QList< CodeLineHandler >, QList< TemplateNodeIndexEntry::Mapping >, QList< DocPara >, QList< Input * >, QList< EdgeLabelHandler >, QList< LayoutNavEntry >, QList< ConfigOption >, QList< uint >, QList< AlphaIndexTableCell >, QList< UseEntry >, QList< DefineName >, QList< DirEntry >, QList< ParameterHandler >, QList< MemberList >, QList< LayoutDocEntry >, QList< CompoundEntry >, QList< Argument >, QList< TagAnchorInfo >, QList< FileList >, QList< FileDef >, QList< TagClassInfo >, QList< MemberHandler >, QList< DotFilePatcher::Map >, QList< DocImpl >, QList< ArgumentList >, QList< FTVNode >, QList< BaseInfo >, QList< TagEnumValueInfo >, QList< LinkedTextImpl >, QList< SearchIndexList >, QList< DiagramRow >, QList< AlphaIndexTableRows >, QList< NavIndexEntry >, QList< Example >, QList< DirDef >, QGVector, QInternalList< type >, QInternalList< QGDictIterator >, QInternalList< QWaitConditionEvent >, QInternalList< QCacheItem >, QGCache, QAsciiDict< type >, QAsciiDict< Entry >, QIntDict< type >, QPtrDict< type >, QIntDict< MemberDef >, QIntDict< Definition >, QIntDict< MemberGroup >, QIntDict< T >, QIntDict< MemberGroupInfo >, QIntDict< URL >, QIntDict< URLInfo >, QIntDict< ClassDef >, QIntDict< RefItem >, QIntDict< char >, QIntDict< uint >, QIntDict< SearchIndexList >, QVector< type >, QVector< QList< IndexWord > >, QQueue< type >, QStack< type >, QQueue< DotRunner >, QStack< DocNode >, QStack< PerlModOutputStream >, QStack< LatexDocVisitor::TableState >, QStack< bool >, QStack< DocStyleChange >, and QStack< State >.
|
pure virtual |
Returns the number of objects in the collection.
Implemented in QGDict, QCache< type >, QCache< LookupInfo >, QGList, QGCache, QGVector, QList< type >, QList< PyVariableContext::Scope >, QList< PyCallContext::Ctx >, QList< MemberName >, QList< MemberNameInfo >, QList< PageDef >, QList< DocNode >, QList< TagFileInfo >, QList< Grouping >, QList< ListItemInfo >, QList< QCString >, QList< Definition >, QList< MemberDef >, QList< TagPackageInfo >, QList< SectionHandler >, QList< DirRelation >, QList< MemberReference >, QList< DotNode >, QList< HtmlAttrib >, QList< TagPageInfo >, QList< VariableContext::Scope >, QList< IndexIntf >, QList< Entry >, QList< MemberGroup >, QList< DiagramItem >, QList< DotGroupCollaboration::Link >, QList< TagDirInfo >, QList< EntryNav >, QList< IncludeInfo >, QList< QString >, QList< RelatedCompound >, QList< DotFilePatcher >, QList< tcl_scan >, QList< ParameterItemHandler >, QList< VariableListEntryHandler >, QList< TagNamespaceInfo >, QList< NodeHandler >, QList< EntryHandler >, QList< TemplateVariant >, QList< MemberInfo >, QList< TagGroupInfo >, QList< ChildNodeHandler >, QList< DotWorkerThread >, QList< ExprAst >, QList< TemplateNode >, QList< NamespaceDef >, QList< T >, QList< void >, QList< ParamHandler >, QList< OutputGenerator >, QList< QDict< TemplateVariant > >, QList< GroupDef >, QList< IndexField >, QList< ListElem >, QList< DocSets::NodeDef >, QList< CallContext::Ctx >, QList< DotConstString >, QList< RowHandler >, QList< TemplateEngine::Private::IncludeEntry >, QList< DotRunner::CleanupItem >, QList< Formula >, QList< TemplateToken >, QList< GenericsCollection >, QList< DotGroupCollaboration::Edge >, QList< Statistics::stat >, QList< TagIncludeInfo >, QList< ActiveRowSpan >, QList< FilePair >, QList< ClassDef >, QList< Define >, QList< BaseClassDef >, QList< EdgeInfo >, QList< IncludeHandler >, QList< TemplateNodeIf::GuardedNodes >, QList< TagMemberInfo >, QList< TemplateNodeWith::Mapping >, QList< DotRunner >, QList< RefItem >, QList< FileName >, QList< SearchDocEntry >, QList< FlowChart >, QList< SearchDefinitionList >, QList< SectionInfo >, QList< CodeLineHandler >, QList< TemplateNodeIndexEntry::Mapping >, QList< DocPara >, QList< Input * >, QList< EdgeLabelHandler >, QList< LayoutNavEntry >, QList< ConfigOption >, QList< uint >, QList< AlphaIndexTableCell >, QList< UseEntry >, QList< DefineName >, QList< DirEntry >, QList< ParameterHandler >, QList< MemberList >, QList< LayoutDocEntry >, QList< CompoundEntry >, QList< Argument >, QList< TagAnchorInfo >, QList< FileList >, QList< FileDef >, QList< TagClassInfo >, QList< MemberHandler >, QList< DotFilePatcher::Map >, QList< DocImpl >, QList< ArgumentList >, QList< FTVNode >, QList< BaseInfo >, QList< TagEnumValueInfo >, QList< LinkedTextImpl >, QList< SearchIndexList >, QList< DiagramRow >, QList< AlphaIndexTableRows >, QList< NavIndexEntry >, QList< Example >, QList< DirDef >, QVector< type >, QVector< QList< IndexWord > >, QInternalList< type >, QQueue< type >, QStack< type >, QInternalList< QGDictIterator >, QInternalList< QWaitConditionEvent >, QInternalList< QCacheItem >, QQueue< DotRunner >, QStack< DocNode >, QStack< PerlModOutputStream >, QStack< LatexDocVisitor::TableState >, QStack< bool >, QStack< DocStyleChange >, QStack< State >, QAsciiDict< type >, QAsciiDict< Entry >, QIntDict< type >, QPtrDict< type >, QIntDict< MemberDef >, QIntDict< Definition >, QIntDict< MemberGroup >, QIntDict< T >, QIntDict< MemberGroupInfo >, QIntDict< URL >, QIntDict< URLInfo >, QIntDict< ClassDef >, QIntDict< RefItem >, QIntDict< char >, QIntDict< uint >, and QIntDict< SearchIndexList >.
|
protectedvirtual |
Virtual function that deletes an item that is about to be removed from the collection.
The default implementation deletes d pointer if and only if auto-delete has been enabled.
This function is always reimplemented in the collection template classes.
Reimplemented in QCache< type >, QCache< LookupInfo >, QList< type >, QList< PyVariableContext::Scope >, QList< PyCallContext::Ctx >, QList< MemberName >, QList< MemberNameInfo >, QList< PageDef >, QList< DocNode >, QList< TagFileInfo >, QList< Grouping >, QList< ListItemInfo >, QList< QCString >, QList< Definition >, QList< MemberDef >, QList< TagPackageInfo >, QList< SectionHandler >, QList< DirRelation >, QList< MemberReference >, QList< DotNode >, QList< HtmlAttrib >, QList< TagPageInfo >, QList< VariableContext::Scope >, QList< IndexIntf >, QList< Entry >, QList< MemberGroup >, QList< DiagramItem >, QList< DotGroupCollaboration::Link >, QList< TagDirInfo >, QList< EntryNav >, QList< IncludeInfo >, QList< QString >, QList< RelatedCompound >, QList< DotFilePatcher >, QList< tcl_scan >, QList< ParameterItemHandler >, QList< VariableListEntryHandler >, QList< TagNamespaceInfo >, QList< NodeHandler >, QList< EntryHandler >, QList< TemplateVariant >, QList< MemberInfo >, QList< TagGroupInfo >, QList< ChildNodeHandler >, QList< DotWorkerThread >, QList< ExprAst >, QList< TemplateNode >, QList< NamespaceDef >, QList< T >, QList< void >, QList< ParamHandler >, QList< OutputGenerator >, QList< QDict< TemplateVariant > >, QList< GroupDef >, QList< IndexField >, QList< ListElem >, QList< DocSets::NodeDef >, QList< CallContext::Ctx >, QList< DotConstString >, QList< RowHandler >, QList< TemplateEngine::Private::IncludeEntry >, QList< DotRunner::CleanupItem >, QList< Formula >, QList< TemplateToken >, QList< GenericsCollection >, QList< DotGroupCollaboration::Edge >, QList< Statistics::stat >, QList< TagIncludeInfo >, QList< ActiveRowSpan >, QList< FilePair >, QList< ClassDef >, QList< Define >, QList< BaseClassDef >, QList< EdgeInfo >, QList< IncludeHandler >, QList< TemplateNodeIf::GuardedNodes >, QList< TagMemberInfo >, QList< TemplateNodeWith::Mapping >, QList< DotRunner >, QList< RefItem >, QList< FileName >, QList< SearchDocEntry >, QList< FlowChart >, QList< SearchDefinitionList >, QList< SectionInfo >, QList< CodeLineHandler >, QList< TemplateNodeIndexEntry::Mapping >, QList< DocPara >, QList< Input * >, QList< EdgeLabelHandler >, QList< LayoutNavEntry >, QList< ConfigOption >, QList< uint >, QList< AlphaIndexTableCell >, QList< UseEntry >, QList< DefineName >, QList< DirEntry >, QList< ParameterHandler >, QList< MemberList >, QList< LayoutDocEntry >, QList< CompoundEntry >, QList< Argument >, QList< TagAnchorInfo >, QList< FileList >, QList< FileDef >, QList< TagClassInfo >, QList< MemberHandler >, QList< DotFilePatcher::Map >, QList< DocImpl >, QList< ArgumentList >, QList< FTVNode >, QList< BaseInfo >, QList< TagEnumValueInfo >, QList< LinkedTextImpl >, QList< SearchIndexList >, QList< DiagramRow >, QList< AlphaIndexTableRows >, QList< NavIndexEntry >, QList< Example >, QList< DirDef >, QInternalList< type >, QInternalList< type >, QInternalList< QGDictIterator >, QInternalList< QWaitConditionEvent >, QInternalList< QCacheItem >, QVector< type >, QVector< QList< IndexWord > >, QAsciiDict< type >, QIntDict< type >, QPtrDict< type >, QAsciiDict< type >, QAsciiDict< Entry >, QIntDict< type >, QPtrDict< type >, QIntDict< MemberDef >, QIntDict< Definition >, QIntDict< MemberGroup >, QIntDict< T >, QIntDict< MemberGroupInfo >, QIntDict< URL >, QIntDict< URLInfo >, QIntDict< ClassDef >, QIntDict< RefItem >, QIntDict< char >, QIntDict< uint >, QIntDict< SearchIndexList >, QStack< type >, QStrList, QStack< DocNode >, QStack< PerlModOutputStream >, QStack< LatexDocVisitor::TableState >, QStack< bool >, QStack< DocStyleChange >, QStack< State >, QQueue< type >, QQueue< DotRunner >, and QStrVec.
Definition at line 174 of file qcollection.cpp.
|
protectedvirtual |
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.
Reimplemented in QList< type >, QList< PyVariableContext::Scope >, QList< PyCallContext::Ctx >, QList< MemberName >, QList< MemberNameInfo >, QList< PageDef >, QList< DocNode >, QList< TagFileInfo >, QList< Grouping >, QList< ListItemInfo >, QList< QCString >, QList< Definition >, QList< MemberDef >, QList< TagPackageInfo >, QList< SectionHandler >, QList< DirRelation >, QList< MemberReference >, QList< DotNode >, QList< HtmlAttrib >, QList< TagPageInfo >, QList< VariableContext::Scope >, QList< IndexIntf >, QList< Entry >, QList< MemberGroup >, QList< DiagramItem >, QList< DotGroupCollaboration::Link >, QList< TagDirInfo >, QList< EntryNav >, QList< IncludeInfo >, QList< QString >, QList< RelatedCompound >, QList< DotFilePatcher >, QList< tcl_scan >, QList< ParameterItemHandler >, QList< VariableListEntryHandler >, QList< TagNamespaceInfo >, QList< NodeHandler >, QList< EntryHandler >, QList< TemplateVariant >, QList< MemberInfo >, QList< TagGroupInfo >, QList< ChildNodeHandler >, QList< DotWorkerThread >, QList< ExprAst >, QList< TemplateNode >, QList< NamespaceDef >, QList< T >, QList< void >, QList< ParamHandler >, QList< OutputGenerator >, QList< QDict< TemplateVariant > >, QList< GroupDef >, QList< IndexField >, QList< ListElem >, QList< DocSets::NodeDef >, QList< CallContext::Ctx >, QList< DotConstString >, QList< RowHandler >, QList< TemplateEngine::Private::IncludeEntry >, QList< DotRunner::CleanupItem >, QList< Formula >, QList< TemplateToken >, QList< GenericsCollection >, QList< DotGroupCollaboration::Edge >, QList< Statistics::stat >, QList< TagIncludeInfo >, QList< ActiveRowSpan >, QList< FilePair >, QList< ClassDef >, QList< Define >, QList< BaseClassDef >, QList< EdgeInfo >, QList< IncludeHandler >, QList< TemplateNodeIf::GuardedNodes >, QList< TagMemberInfo >, QList< TemplateNodeWith::Mapping >, QList< DotRunner >, QList< RefItem >, QList< FileName >, QList< SearchDocEntry >, QList< FlowChart >, QList< SearchDefinitionList >, QList< SectionInfo >, QList< CodeLineHandler >, QList< TemplateNodeIndexEntry::Mapping >, QList< DocPara >, QList< Input * >, QList< EdgeLabelHandler >, QList< LayoutNavEntry >, QList< ConfigOption >, QList< uint >, QList< AlphaIndexTableCell >, QList< UseEntry >, QList< DefineName >, QList< DirEntry >, QList< ParameterHandler >, QList< MemberList >, QList< LayoutDocEntry >, QList< CompoundEntry >, QList< Argument >, QList< TagAnchorInfo >, QList< FileList >, QList< FileDef >, QList< TagClassInfo >, QList< MemberHandler >, QList< DotFilePatcher::Map >, QList< DocImpl >, QList< ArgumentList >, QList< FTVNode >, QList< BaseInfo >, QList< TagEnumValueInfo >, QList< LinkedTextImpl >, QList< SearchIndexList >, QList< DiagramRow >, QList< AlphaIndexTableRows >, QList< NavIndexEntry >, QList< Example >, QList< DirDef >, QStrList, and QStrVec.
Definition at line 148 of file qcollection.cpp.
|
inline |
Sets the auto-delete option of the collection.
Enabling auto-delete (enable is TRUE) will delete objects that are removed from the collection. This can be useful if the collection has the only reference to the objects. (Note that the object can still be copied using the copy constructor - copying such objects is a good way to get memory leaks, reading freed memory or both.)
Disabling auto-delete (enable is FALSE) will not delete objects that are removed from the collection. This is useful if the objects are part of many collections.
The default setting is FALSE.
Definition at line 55 of file qcollection.h.
|
protected |
Definition at line 67 of file qcollection.h.