Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QObject::deleteLater (  )  [slot, inherited]

Schedules this object for deletion.

The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started.

Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.

{Note:} It is safe to call this function more than once; when the first deferred deletion event is delivered, any pending events for the object are removed from the event queue.

See also:
destroyed(), QPointer

Definition at line 2051 of file qobject.cpp.

References QCoreApplication::postEvent().

Referenced by Q3Table::clearCellWidget(), QGraphicsWidget::close(), BrowserMainWindow::closeEvent(), QWidgetAction::deleteWidget(), DiagramScene::editorLostFocus(), FortuneServer::incomingConnection(), Server::sendFortune(), and QMainWindow::setMenuBar().

{
    QCoreApplication::postEvent(this, new QEvent(QEvent::DeferredDelete));
}


Generated by  Doxygen 1.6.0   Back to index