CanvasCV: canvascv::WidgetFactory Class Reference
CanvasCV  1.0.0
canvascv::WidgetFactory Class Reference

The WidgetFactory class. More...

#include <widgetfactory.h>

Inheritance diagram for canvascv::WidgetFactory:
canvascv::WidgetFactoryT< T >

Static Public Member Functions

static std::shared_ptr< WidgetnewWidget (std::string type, Layout &layoutVal, const cv::Point &pos)
 newWidget More...
 

Detailed Description

Widget prototypes are added to this class with the help of the WidgetFactoryT class. You can create widgets with newWidget() of this class, but if you supply a wrong name you'll get back a null pointer.

Examples:
example_add_widget.cpp.

Member Function Documentation

static std::shared_ptr<Widget> canvascv::WidgetFactory::newWidget ( std::string  type,
Layout layoutVal,
const cv::Point &  pos 
)
static

Use this to create widgets by name.

Parameters
typeis the name of the concrete Widget sub type.
layoutValis the parent layout
posis an intial location for the Widget on the Layout (if the layout supports specific positions).
Returns
a pointer to a newly allocated widget of type 'type' or nullptr if 'type' doesn't exist.

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