⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qcollection.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QCollection 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQCollection \- The base class of all Qt collections.SH SYNOPSIS.br.PP\fC#include <qcollection.h>\fR.PPInherited by QGCache, QGDict, QGList and QGVector..PP.SS "Public Members".in +1c.ti -1c.BI "bool \fBautoDelete\fR () const".br.ti -1c.BI "void \fBsetAutoDelete\fR ( bool enable ) ".br.ti -1c.BI "virtual uint \fBcount\fR () const".br.ti -1c.BI "virtual void \fBclear\fR () ".br.ti -1c.BI "typedef void* \fBItem\fR".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "\fBQCollection\fR () ".br.ti -1c.BI "\fBQCollection\fR ( const QCollection & ) ".br.ti -1c.BI "virtual \fB~QCollection\fR () ".br.ti -1c.BI "virtual Item \fBnewItem\fR ( Item ) ".br.ti -1c.BI "virtual void \fBdeleteItem\fR ( Item ) ".br.in -1c.SH DESCRIPTIONThe QCollection class is the base class of all Qt collections..PPThe QCollection class is an abstract base class for the Qt collection classes QDict, QList etc. via QGDict, QGList etc..PPA QCollection knows only about the number of objects in the collection and the deletion strategy (see setAutoDelete())..PPA collection is implemented using the \fCItem\fR (generic collection item) type, which is a \fCvoid*.\fR The template classes that create the real collections cast the \fCItem\fR to the required type..PPSee also Collection Classes.SS "Member Type Documentation".SH "QCollection::Item"This type is the generic "item" in a QCollection..SH MEMBER FUNCTION DOCUMENTATION.SH "QCollection::QCollection () \fC[protected]\fR"Constructs a collection. The constructor is protected because QCollection is an abstract class..SH "QCollection::QCollection ( const QCollection & source ) \fC[protected]\fR"Constructs a copy of \fIsource\fR with autoDelete() set to FALSE. The constructor is protected because QCollection is an abstract class..PPNote that if \fIsource\fR has autoDelete turned on, copying it is a good way to get memory leaks, reading freed memory, or both..SH "QCollection::~QCollection () \fC[virtual protected]\fR"Destroys the collection. The destructor is protected because QCollection is an abstract class..SH "bool QCollection::autoDelete () const"Returns the setting of the auto-delete option (default is FALSE)..PPSee also setAutoDelete()..SH "virtual void QCollection::clear () \fC[virtual]\fR"Removes all objects from the collection. The objects will be deleted if auto-delete has been enabled..PPSee also setAutoDelete()..PPReimplemented in QGCache, QIntDict, QDict, QPtrDict, QAsciiDict, QQueue, QGVector, QAsciiCache, QStack, QVector, QList, QGDict, QGList, QIntCache and QCache..SH "virtual uint QCollection::count () const \fC[virtual]\fR"Returns the number of objects in the collection..PPReimplemented in QGDict, QGList, QAsciiCache, QGCache, QVector, QPtrDict, QIntCache, QDict, QAsciiDict, QCache, QQueue, QGVector, QIntDict, QList and QStack..SH "void QCollection::deleteItem ( Item d ) \fC[protected]\fR"Virtual function that deletes an item that is about to be removed from the collection..PPThe default implementation deletes \fId\fR pointer if and only if auto-delete has been enabled..PPThis function is always reimplemented in the collection template classes..PP\fBWarning:\fR If you reimplement this function you must also reimplement the destructor and call the virtual function clear() from your destructor. This is due to the way virtual functions and destructors work in C++: virtual functions in derived classes cannot be called from a destructor. If you do not do this your deleteItem() function will not be called when the container is destructed..PPSee also newItem() and setAutoDelete()..SH "QCollection::Item QCollection::newItem( Item d ) \fC[protected]\fR"Virtual function that creates a copy of an object that is about to be inserted into the collection..PPThe default implementation returns the \fId\fR pointer, i.e. no copy is made..PPThis function is seldom reimplemented in the collection template classes. It is not common practice to make a copy of something that is being inserted..PPSee also deleteItem()..SH "void QCollection::setAutoDelete ( bool enable )"Sets the auto-delete option of the collection..PPEnabling auto-delete (\fIenable\fR 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.).PPDisabling auto-delete (\fIenable\fR is FALSE) will \fInot\fR delete objects that are removed from the collection. This is useful if the objects are part of many collections..PPThe default setting is FALSE..PPSee also autoDelete()..PPExamples:.(lgrapher/grapher.cpp.)l.SH "SEE ALSO".BR http://doc.trolltech.com/qcollection.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -