Eneboo - Documentación para desarrolladores
Métodos públicos
Referencia de la Clase CustomWidgetFactory

#include <widgetfactory.h>

Diagrama de herencias de CustomWidgetFactory
QWidgetFactory

Lista de todos los miembros.

Métodos públicos

 CustomWidgetFactory ()
QWidgetcreateWidget (const QString &className, QWidget *parent, const char *name) const

Documentación del constructor y destructor

CustomWidgetFactory::CustomWidgetFactory ( )

Documentación de las funciones miembro

QWidget * CustomWidgetFactory::createWidget ( const QString className,
QWidget parent,
const char *  name 
) const [virtual]

Creates a widget of the type className passing parent and name to its constructor.

If className is a widget in the Qt library, it is directly created by this function. If the widget isn't in the Qt library, each of the installed widget plugins is asked, in turn, to create the widget. As soon as a plugin says it can create the widget it is asked to do so. It may occur that none of the plugins can create the widget, in which case each installed widget factory is asked to create the widget (see addWidgetFactory()). If the widget cannot be created by any of these means, 0 is returned.

If you have a custom widget, and want it to be created using the widget factory, there are two approaches you can use:

1

Write a widget plugin. This allows you to use the widget in {Qt Designer} and in this QWidgetFactory. See the widget plugin documentation for further details. (See the "Creating Custom Widgets with Plugins" section of the Qt Designer manual for an example.

Subclass QWidgetFactory. Then reimplement this function to create and return an instance of your custom widget if className equals the name of your widget, otherwise return 0. Then at the beginning of your program where you want to use the widget factory to create widgets do a:

    QWidgetFactory::addWidgetFactory( new MyWidgetFactory );

where MyWidgetFactory is your QWidgetFactory subclass.

Reimplementado de QWidgetFactory.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'