Gui::WidgetFactoryInst Class Reference

The widget factory provides methods for the dynamic creation of widgets. More...

#include <WidgetFactory.h>

Public Member Functions

Gui::Dialog::PreferencePagecreatePreferencePage (const char *sName, QWidget *parent=nullptr) const
 Creates a widget with the name sName which is a child of parent. More...
 
QWidgetcreatePrefWidget (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...
 
QWidgetcreateWidget (const char *sName, QWidget *parent=nullptr) 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 WidgetFactoryInstinstance ()
 

Additional Inherited Members

- Protected Member Functions inherited from Base::Factory
 Factory ()
 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.

Author
Werner Mayer

Member Function Documentation

◆ createPreferencePage()

Gui::Dialog::PreferencePage * WidgetFactoryInst::createPreferencePage ( const char *  sName,
QWidget parent = nullptr 
) 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 nullptr 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 nullptr 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()

QWidget * WidgetFactoryInst::createWidget ( const char *  sName,
QWidget parent = nullptr 
) 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 nullptr is returned.

References Base::Console(), Base::ConsoleSingleton::Error(), Base::ConsoleSingleton::Log(), Base::Factory::Produce(), and Base::ConsoleSingleton::Warning().

Referenced by createPrefWidget().

◆ destruct()

void WidgetFactoryInst::destruct ( void  )
static

◆ instance()


The documentation for this class was generated from the following files: