The widget factory provides methods for the dynamic creation of widgets. More...
#include <WidgetFactory.h>
Public Member Functions | |
Gui::Dialog::PreferencePage * | createPreferencePage (const char *sName, QWidget *parent=0) const |
Creates a widget with the name sName which is a child of parent. More... | |
QWidget * | createPrefWidget (const char *sName, QWidget *parent, const char *sPref) |
Creates a preference widget with the name sName and the preference name sPref which is a child of parent. More... | |
QWidget * | createWidget (const char *sName, QWidget *parent=0) const |
Creates a widget with the name sName which is a child of parent. More... | |
Public Member Functions inherited from Base::Factory | |
void | AddProducer (const char *sClassName, AbstractProducer *pcProducer) |
Adds a new prducer instance. More... | |
std::list< std::string > | CanProduce () const |
returns a list of all registered producer More... | |
bool | CanProduce (const char *sClassName) const |
returns true if there is a producer for this class registered More... | |
Static Public Member Functions | |
static void | destruct () |
static WidgetFactoryInst & | instance () |
Additional Inherited Members | |
Protected Member Functions inherited from Base::Factory | |
Factory (void) | |
construction More... | |
void * | Produce (const char *sClassName) const |
produce a class with the given name More... | |
virtual | ~Factory () |
destruction More... | |
Detailed Description
The widget factory provides methods for the dynamic creation of widgets.
To create these widgets once they must be registered to the factory. To register them use WidgetProducer or any subclasses; to register a preference page use PrefPageProducer instead.
Member Function Documentation
◆ createPreferencePage()
Gui::Dialog::PreferencePage * WidgetFactoryInst::createPreferencePage | ( | const char * | sName, |
QWidget * | parent = 0 |
||
) | const |
Creates a widget with the name sName which is a child of parent.
To create an instance of this widget once it must has been registered. If there is no appropriate widget registered 0 is returned.
References Base::Console(), Base::ConsoleSingleton::Error(), Base::ConsoleSingleton::Log(), Base::Factory::Produce(), and Base::ConsoleSingleton::Warning().
◆ createPrefWidget()
QWidget * WidgetFactoryInst::createPrefWidget | ( | const char * | sName, |
QWidget * | parent, | ||
const char * | sPref | ||
) |
Creates a preference widget with the name sName and the preference name sPref which is a child of parent.
To create an instance of this widget once it must has been registered. If there is no appropriate widget registered 0 is returned. After creation of this widget its recent preferences are restored automatically.
References Base::Console(), createWidget(), Base::ConsoleSingleton::Error(), Gui::PrefWidget::restorePreferences(), and Gui::PrefWidget::setEntryName().
◆ createWidget()
Creates a widget with the name sName which is a child of parent.
To create an instance of this widget once it must has been registered. If there is no appropriate widget registered 0 is returned.
References Base::Console(), Base::ConsoleSingleton::Error(), Base::ConsoleSingleton::Log(), Base::Factory::Produce(), and Base::ConsoleSingleton::Warning().
Referenced by createPrefWidget(), and Gui::UiLoader::createWidget().
◆ destruct()
|
static |
Referenced by Gui::WidgetFactorySupplier::destruct().
◆ instance()
|
static |
The documentation for this class was generated from the following files:
- src/Gui/WidgetFactory.h
- src/Gui/WidgetFactory.cpp