From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- doc/html/qobjectcleanuphandler.html | 139 ++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 doc/html/qobjectcleanuphandler.html (limited to 'doc/html/qobjectcleanuphandler.html') diff --git a/doc/html/qobjectcleanuphandler.html b/doc/html/qobjectcleanuphandler.html new file mode 100644 index 000000000..462421307 --- /dev/null +++ b/doc/html/qobjectcleanuphandler.html @@ -0,0 +1,139 @@ + + + + + +TQObjectCleanupHandler Class + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

TQObjectCleanupHandler Class Reference

+ +

The TQObjectCleanupHandler class watches the lifetime of multiple TQObjects. +More... +

#include <qobjectcleanuphandler.h> +

Inherits TQObject. +

List of all member functions. +

Public Members

+ +

Detailed Description

+ + +The TQObjectCleanupHandler class watches the lifetime of multiple TQObjects. +

+

A TQObjectCleanupHandler is useful whenever you need to know when a +number of TQObjects 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. +

Example: +

+    class FactoryComponent : public FactoryInterface, public TQLibraryInterface
+    {
+    public:
+        ...
+
+        TQObject *createObject();
+
+        bool init();
+        void cleanup();
+        bool canUnload() const;
+
+    private:
+        TQObjectCleanupHandler objects;
+    };
+
+    // allocate a new object, and add it to the cleanup handler
+    TQObject *FactoryComponent::createObject()
+    {
+        return objects.add( new TQObject() );
+    }
+
+    // TQLibraryInterface implementation
+    bool FactoryComponent::init()
+    {
+        return TRUE;
+    }
+
+    void FactoryComponent::cleanup()
+    {
+    }
+
+    // it is only safe to unload the library when all TQObject's have been destroyed
+    bool FactoryComponent::canUnload() const
+    {
+        return objects.isEmpty();
+    }
+    
+ +

See also Object Model. + +


Member Function Documentation

+

TQObjectCleanupHandler::TQObjectCleanupHandler () +

+Constructs an empty TQObjectCleanupHandler. + +

TQObjectCleanupHandler::~TQObjectCleanupHandler () +

+Destroys the cleanup handler. All objects in this cleanup handler +will be deleted. + +

TQObject * TQObjectCleanupHandler::add ( TQObject * object ) +

+Adds object to this cleanup handler and returns the pointer to +the object. + +

void TQObjectCleanupHandler::clear () +

+Deletes all objects in this cleanup handler. The cleanup handler +becomes empty. + +

bool TQObjectCleanupHandler::isEmpty () const +

+Returns TRUE if this cleanup handler is empty or if all objects in +this cleanup handler have been destroyed; otherwise return FALSE. + +

void TQObjectCleanupHandler::remove ( TQObject * object ) +

+Removes the object from this cleanup handler. The object will +not be destroyed. + + +

+This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


+ +
Copyright © 2007 +TrolltechTrademarks +
TQt 3.3.8
+
+ -- cgit v1.2.1