![]() |
| ||
Classes - Annotated - Tree - Functions - Home - Structure |
The QComponentFactory class provides static functions to create and register components. More...
#include <qcomponentfactory.h>
The component factory provides convenience functions that can be used both by applications to instantiate components, and by component servers to register components.
The createInstance() function is used to obtain a pointer to an interface.
Use registerServer() to load a shared library which provides the QComponentServerInterface and register its components. Use unregisterServer() to unregister a shared library's components.
registerComponent() and unregisterComponent() register and unregister single components from the global component database, and can be used by implementations of the QComponentServerInterface.
See also QComponentServerInterface and QComponentFactoryInterface.
The parameter outer is a pointer to the outer interface used for containment and aggregation and is propagated to the createInstance implementation of the QComponentFactoryInterface in the component server if provided.
Returns QS_OK if the interface was successfully instantiated, QE_NOINTERFACE if the component does not provide an interface iid, or QE_NOCOMPONENT if there was an error loading the component.
Example:
MyInterface *iface; if ( QComponentFactory::createInstance( IID_MyInterface, CID_MyComponent, (QUnknownInterface**)&iface ) == QS_OK ) ... iface->release(); }
Call this function for each component in an implementation of registerComponents.
See also unregisterComponent() and registerServer().
Returns TRUE if the interface is found and successfully registered, otherwise returns FALSE.
Call this function for each component in an implementation of unregisterComponents.
See also registerComponent() and unregisterServer().
Returns TRUE if the interface is found and successfully unregistered, otherwise returns FALSE.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks | Qt version 3.0.0-beta2
|