SHAPER  9.12.0
ModuleBase_WidgetCreatorFactory Class Reference

A class for creation of widgets instances in for property panel using XML deskription of a feature. More...

Public Member Functions

virtual ~ModuleBase_WidgetCreatorFactory ()
 Destructor. More...
 
void registerCreator (const WidgetCreatorPtr &theCreator)
 The creator is added to the internal container to be used when the createWidgetByType is called. More...
 
bool hasPanelWidget (const std::string &theType)
 Returns true if there is a creator, which can make a panel by the type. More...
 
QWidgetcreatePanelByType (const std::string &theType, QWidget *theParent, const FeaturePtr &theFeature, Config_WidgetAPI *theWidgetApi=0)
 Create panel by its type. More...
 
bool hasPageWidget (const std::string &theType)
 Returns true if there is a creator, which can make a page by the type. More...
 
ModuleBase_PageBasecreatePageByType (const std::string &theType, QWidget *theParent, Config_WidgetAPI *theWidgetApi)
 Create page by its type. More...
 
ModuleBase_ModelWidgetcreateWidgetByType (const std::string &theType, QWidget *theParent, Config_WidgetAPI *theWidgetApi, ModuleBase_IWorkshop *theWorkshop)
 Create widget by its type. More...
 

Static Public Member Functions

static std::shared_ptr< ModuleBase_WidgetCreatorFactoryget ()
 Returns an singular instance of the class if it exists or create it. More...
 

Detailed Description

A class for creation of widgets instances in for property panel using XML deskription of a feature.

Constructor & Destructor Documentation

◆ ~ModuleBase_WidgetCreatorFactory()

ModuleBase_WidgetCreatorFactory::~ModuleBase_WidgetCreatorFactory ( )
virtual

Destructor.

Member Function Documentation

◆ get()

std::shared_ptr< ModuleBase_WidgetCreatorFactory > ModuleBase_WidgetCreatorFactory::get ( )
static

Returns an singular instance of the class if it exists or create it.

◆ registerCreator()

void ModuleBase_WidgetCreatorFactory::registerCreator ( const WidgetCreatorPtr &  theCreator)

The creator is added to the internal container to be used when the createWidgetByType is called.

Parameters
theCreatora new widget creator

fill map of panels

fill map of widgets

fill map of pages

◆ hasPanelWidget()

bool ModuleBase_WidgetCreatorFactory::hasPanelWidget ( const std::string &  theType)

Returns true if there is a creator, which can make a panel by the type.

Parameters
theTypea type
Returns
a boolean value

◆ createPanelByType()

QWidget * ModuleBase_WidgetCreatorFactory::createPanelByType ( const std::string &  theType,
QWidget theParent,
const FeaturePtr &  theFeature,
Config_WidgetAPI theWidgetApi = 0 
)

Create panel by its type.

Parameters
theTypea type
theParenta parent widget
theFeaturea feature to fill the panel
theWidgetApithe widget configuration. The attribute of the model widget is obtained from XML
Returns
a created panel or null

◆ hasPageWidget()

bool ModuleBase_WidgetCreatorFactory::hasPageWidget ( const std::string &  theType)

Returns true if there is a creator, which can make a page by the type.

Parameters
theTypea type
Returns
a boolean value

◆ createPageByType()

ModuleBase_PageBase * ModuleBase_WidgetCreatorFactory::createPageByType ( const std::string &  theType,
QWidget theParent,
Config_WidgetAPI theWidgetApi 
)

Create page by its type.

Parameters
theTypea type
theParenta parent widget
theWidgetApithe widget configuration. The attribute of the model widget is obtained from XML
Returns
a created page or null

◆ createWidgetByType()

ModuleBase_ModelWidget * ModuleBase_WidgetCreatorFactory::createWidgetByType ( const std::string &  theType,
QWidget theParent,
Config_WidgetAPI theWidgetApi,
ModuleBase_IWorkshop theWorkshop 
)

Create widget by its type.

Parameters
theTypea type
theParenta parent widget
theWidgetApithe widget configuration. The attribute of the model widget is obtained from XML
theWorkshopa workshop object instance
Returns
a created widget or null