summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qobjectcleanuphandler.3qt
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:24:15 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:24:15 -0500
commitbd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch)
tree7a520322212d48ebcb9fbe1087e7fca28b76185c /doc/man/man3/qobjectcleanuphandler.3qt
downloadqt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz
qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip
Add Qt3 development HEAD version
Diffstat (limited to 'doc/man/man3/qobjectcleanuphandler.3qt')
-rw-r--r--doc/man/man3/qobjectcleanuphandler.3qt152
1 files changed, 152 insertions, 0 deletions
diff --git a/doc/man/man3/qobjectcleanuphandler.3qt b/doc/man/man3/qobjectcleanuphandler.3qt
new file mode 100644
index 0000000..0698efb
--- /dev/null
+++ b/doc/man/man3/qobjectcleanuphandler.3qt
@@ -0,0 +1,152 @@
+'\" t
+.TH QObjectCleanupHandler 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
+.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
+.\" license file included in the distribution for a complete license
+.\" statement.
+.\"
+.ad l
+.nh
+.SH NAME
+QObjectCleanupHandler \- Watches the lifetime of multiple QObjects
+.SH SYNOPSIS
+\fC#include <qobjectcleanuphandler.h>\fR
+.PP
+Inherits QObject.
+.PP
+.SS "Public Members"
+.in +1c
+.ti -1c
+.BI "\fBQObjectCleanupHandler\fR ()"
+.br
+.ti -1c
+.BI "\fB~QObjectCleanupHandler\fR ()"
+.br
+.ti -1c
+.BI "QObject * \fBadd\fR ( QObject * object )"
+.br
+.ti -1c
+.BI "void \fBremove\fR ( QObject * object )"
+.br
+.ti -1c
+.BI "bool \fBisEmpty\fR () const"
+.br
+.ti -1c
+.BI "void \fBclear\fR ()"
+.br
+.in -1c
+.SH DESCRIPTION
+The QObjectCleanupHandler class watches the lifetime of multiple QObjects.
+.PP
+A QObjectCleanupHandler is useful whenever you need to know when a number of QObjects that are owned by someone else have been deleted. This is important, for example, when referencing memory in an application that has been allocated in a shared library.
+.PP
+Example:
+.PP
+.nf
+.br
+ class FactoryComponent : public FactoryInterface, public QLibraryInterface
+.br
+ {
+.br
+ public:
+.br
+ ...
+.br
+.br
+ QObject *createObject();
+.br
+.br
+ bool init();
+.br
+ void cleanup();
+.br
+ bool canUnload() const;
+.br
+.br
+ private:
+.br
+ QObjectCleanupHandler objects;
+.br
+ };
+.br
+.br
+ // allocate a new object, and add it to the cleanup handler
+.br
+ QObject *FactoryComponent::createObject()
+.br
+ {
+.br
+ return objects.add( new QObject() );
+.br
+ }
+.br
+.br
+ // QLibraryInterface implementation
+.br
+ bool FactoryComponent::init()
+.br
+ {
+.br
+ return TRUE;
+.br
+ }
+.br
+.br
+ void FactoryComponent::cleanup()
+.br
+ {
+.br
+ }
+.br
+.br
+ // it is only safe to unload the library when all QObject's have been destroyed
+.br
+ bool FactoryComponent::canUnload() const
+.br
+ {
+.br
+ return objects.isEmpty();
+.br
+ }
+.br
+.fi
+.PP
+See also Object Model.
+.SH MEMBER FUNCTION DOCUMENTATION
+.SH "QObjectCleanupHandler::QObjectCleanupHandler ()"
+Constructs an empty QObjectCleanupHandler.
+.SH "QObjectCleanupHandler::~QObjectCleanupHandler ()"
+Destroys the cleanup handler. All objects in this cleanup handler will be deleted.
+.SH "QObject * QObjectCleanupHandler::add ( QObject * object )"
+Adds \fIobject\fR to this cleanup handler and returns the pointer to the object.
+.SH "void QObjectCleanupHandler::clear ()"
+Deletes all objects in this cleanup handler. The cleanup handler becomes empty.
+.SH "bool QObjectCleanupHandler::isEmpty () const"
+Returns TRUE if this cleanup handler is empty or if all objects in this cleanup handler have been destroyed; otherwise return FALSE.
+.SH "void QObjectCleanupHandler::remove ( QObject * object )"
+Removes the \fIobject\fR from this cleanup handler. The object will
+not be destroyed.
+
+.SH "SEE ALSO"
+.BR http://doc.trolltech.com/qobjectcleanuphandler.html
+.BR http://www.trolltech.com/faq/tech.html
+.SH COPYRIGHT
+Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
+license file included in the distribution for a complete license
+statement.
+.SH AUTHOR
+Generated automatically from the source code.
+.SH BUGS
+If you find a bug in Qt, please report it as described in
+.BR http://doc.trolltech.com/bughowto.html .
+Good bug reports help us to help you. Thank you.
+.P
+The definitive Qt documentation is provided in HTML format; it is
+located at $QTDIR/doc/html and can be read using Qt Assistant or with
+a web browser. This man page is provided as a convenience for those
+users who prefer man pages, although this format is not officially
+supported by Trolltech.
+.P
+If you find errors in this manual page, please report them to
+.BR qt-bugs@trolltech.com .
+Please include the name of the manual page (qobjectcleanuphandler.3qt) and the Qt
+version (3.3.8).