QObjectCleanupHandler Class Reference |
QObjectCleanupHandler () | |
~QObjectCleanupHandler () | |
QObject * | add ( QObject * object ) |
void | clear () |
bool | isEmpty () const |
void | remove ( QObject * object ) |
The QObjectCleanupHandler class watches the lifetime of multiple QObjects.
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.
To keep track of some QObjects, create a QObjectCleanupHandler, and add() the objects you are interested in. If you are no longer interested in tracking a particular object, use remove() to remove it from the cleanup handler. If an object being tracked by the cleanup handler gets deleted by someone else it will automatically be removed from the cleanup handler. You can delete all the objects in the cleanup handler with clear(), or by destroying the cleanup handler. isEmpty() returns true if the QObjectCleanupHandler has no objects to keep track of.
See also QPointer.
Constructs an empty QObjectCleanupHandler.
Destroys the cleanup handler. All objects in this cleanup handler will be deleted.
See also clear().
Adds object to this cleanup handler and returns the pointer to the object.
See also remove().
Deletes all objects in this cleanup handler. The cleanup handler becomes empty.
See also isEmpty().
Returns true if this cleanup handler is empty or if all objects in this cleanup handler have been destroyed; otherwise return false.
See also add(), remove(), and clear().
Removes the object from this cleanup handler. The object will not be destroyed.
See also add().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com