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=nullptr) 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=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 WidgetFactoryInst & | instance () |
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... | |
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.
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().
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().
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().
|
static |
Referenced by Gui::WidgetFactorySupplier::destruct().
|
static |