Qt:Документация 4.3.2/qobjectcleanuphandler

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QObjectCleanupHandler Class Reference
[модуль QtCore ]

The QObjectCleanupHandler class watches the lifetime of multiple QObjects. Далее...

 #include <QObjectCleanupHandler>

Inherits QObject.

[править] Открытые функции

  • 29 открытых функций, унаследованных от QObject

[править] Дополнительные унаследованные члены

  • 1 свойство, унаследованное от QObject
  • 1 открытый слот, унаследованный от QObject
  • 1 сигнал, унаследованный от QObject
  • 5 статических открытых членов, унаследованных от QObject
  • 7 защищенных функций, унаследованных от QObject

[править] Подробное описание

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.


[править] Описание функций-членов

[править]
QObjectCleanupHandler::QObjectCleanupHandler ()

Constructs an empty QObjectCleanupHandler.

[править]
QObjectCleanupHandler::~QObjectCleanupHandler ()

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

See also clear().

[править]
QObject * QObjectCleanupHandler::add ( QObject * object )

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

See also remove().

[править]
void QObjectCleanupHandler::clear ()

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

See also isEmpty().

[править]
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.

See also add(), remove(), and clear().

[править]
void QObjectCleanupHandler::remove ( QObject * object )

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

See also add().



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2