Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QLibraryInterface Class Reference

The QLibraryInterface class defines an interface to control loading and unloading of components. More...

#include <qcom.h>

Inherits QUnknownInterface.

List of all member functions.

Public Members


Detailed Description

The QLibraryInterface class defines an interface to control loading and unloading of components.

If the component exported by a component server implements this interface, QLibrary calls the function init() after loading the library, and the loading is stopped if this function call rerturns FALSE.

Before the component server is unloaded, QLibrary calls the cleanup() function so that the library can free all allocated resources. If the following call to canUnload() returns FALSE, the unloading will be cancelled.

See also Component Model.


Member Function Documentation

bool QLibraryInterface::canUnload () const [virtual]

When this function returns FALSE, the component implementing this interface will not be unloaded. QLibrary calls this function regularily to unload unused libraries, so the implementation of this function should be efficient.

This function should return FALSE when memory is still allocated by the library and referenced outside of the library. To watch the lifetime of allocated memory, use the QObject::destroyed() signal, or the QObjectCleanupHandler class. For more information, see the implementation of this interface in the style plugins that ship with Qt.

void QLibraryInterface::cleanup () [virtual]

This function is called by QLibrary while unloading the component server. Implement this function to free any resources allocated inside the component, e.g. memory, file handles or sockets.

bool QLibraryInterface::init () [virtual]

This function is called by QLibrary right after retrieving the component exported by a component server. When this function returns FALSE, the component server will not be loaded.


This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.


Copyright © 2001 TrolltechTrademarks
Qt version 3.0.0-beta5