Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QComponentFactory class provides static functions to create and register components. More...
#include <qcomponentfactory.h>
The component factory provides static convenience functions that can be used both by applications to instantiate components, and by component servers to register components.
The createInstance() function provides a pointer to an interface implemented in a specific component.
Use registerServer() to load a component server and register its components, and unregisterServer() to unregsiter the components. The component exported by the component server has to implement the QComponentRegistrationInterface. registerComponent() and unregisterComponent() register and unregister single components from the system component registry, and should be used by implementations of the QComponentServerInterface.
See also QComponentRegistrationInterface, QComponentFactoryInterface and Component Model.
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.
The function 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.
This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks | Qt version 3.0.0-beta5
|