OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
WUIQtWidgetFactory Class Reference

Implementation of WUIWidgetFactory. More...

#include <WUIQtWidgetFactory.h>

+ Inheritance diagram for WUIQtWidgetFactory:
+ Collaboration diagram for WUIQtWidgetFactory:

Public Types

typedef std::shared_ptr< WUIQtWidgetFactorySPtr
 Convenience typedef for a std::shared_ptr< WUIQtWidgetFactory >. More...
 
typedef std::shared_ptr< const WUIQtWidgetFactoryConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIQtWidgetFactory >. More...
 
- Public Types inherited from WUIWidgetFactory
typedef std::shared_ptr< WUIWidgetFactorySPtr
 Convenience typedef for a std::shared_ptr< WUIWidgetFactory >. More...
 
typedef std::shared_ptr< const WUIWidgetFactoryConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIWidgetFactory >. More...
 

Public Member Functions

 WUIQtWidgetFactory (WMainWindow *mainWindow)
 Default constructor. More...
 
virtual ~WUIQtWidgetFactory ()
 Destructor. More...
 
virtual bool implementsUI () const
 Query whether the WUI instance supports the WUI Widget interface properly as UIs can simply ignore the WUIWidgetFactory calls done in modules. More...
 
- Public Member Functions inherited from WUIWidgetFactory
virtual WUIGridWidget::SPtr createGridWidget (const std::string &title, WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Create a grid widget. More...
 
virtual WUITabbedWidget::SPtr createTabbedWidget (const std::string &title, WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Create a tabed widget. More...
 
virtual WUIPropertyGroupWidget::SPtr createPropertyGroupWidget (const std::string &title, WPropGroup properties, WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Create a property widget. More...
 
virtual WUIViewWidget::SPtr createViewWidget (std::string title, WGECamera::ProjectionMode projectionMode, std::shared_ptr< WCondition > abordCondition=WCondition::SPtr(), WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Instruct to open a new view widget. More...
 
virtual ~WUIWidgetFactory ()
 Destructor. More...
 

Static Public Member Functions

static std::shared_ptr< WUIQtWidgetBasegetAsQtWidgetBase (WUIWidgetBase::SPtr widget)
 Convert the given WUIWidgetBase to the corresponding WUIQtWidgetBase. More...
 

Protected Member Functions

virtual WUIGridWidget::SPtr createGridWidgetImpl (const std::string &title, WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Create a grid widget. More...
 
virtual WUITabbedWidget::SPtr createTabbedWidgetImpl (const std::string &title, WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Implementation of createTabbedWidget. More...
 
virtual WUIPropertyGroupWidget::SPtr createPropertyGroupWidgetImpl (const std::string &title, WPropGroup properties, WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Create a property widget. More...
 
virtual WUIViewWidget::SPtr createViewWidgetImpl (std::string title, WGECamera::ProjectionMode projectionMode, std::shared_ptr< WCondition > abordCondition=WCondition::SPtr(), WUIWidgetBase::SPtr parent=WUIWidgetBase::SPtr()) const
 Instruct to open a new view widget. More...
 
- Protected Member Functions inherited from WUIWidgetFactory
void setParent (WUIWidgetBase::SPtr widget, WUIWidgetBase::SPtr parent) const
 Set the parent of a widget and notify parent about new child widget. More...
 

Private Attributes

WMainWindowm_mainWindow
 The main window instance. More...
 

Detailed Description

Implementation of WUIWidgetFactory.

Definition at line 41 of file WUIQtWidgetFactory.h.

Member Typedef Documentation

◆ ConstSPtr

typedef std::shared_ptr< const WUIQtWidgetFactory > WUIQtWidgetFactory::ConstSPtr

Convenience typedef for a std::shared_ptr< const WUIQtWidgetFactory >.

Definition at line 52 of file WUIQtWidgetFactory.h.

◆ SPtr

typedef std::shared_ptr< WUIQtWidgetFactory > WUIQtWidgetFactory::SPtr

Convenience typedef for a std::shared_ptr< WUIQtWidgetFactory >.

Definition at line 47 of file WUIQtWidgetFactory.h.

Constructor & Destructor Documentation

◆ WUIQtWidgetFactory()

WUIQtWidgetFactory::WUIQtWidgetFactory ( WMainWindow mainWindow)
explicit

Default constructor.

Parameters
mainWindowthe main window instance

Definition at line 37 of file WUIQtWidgetFactory.cpp.

◆ ~WUIQtWidgetFactory()

WUIQtWidgetFactory::~WUIQtWidgetFactory ( )
virtual

Destructor.

Definition at line 44 of file WUIQtWidgetFactory.cpp.

Member Function Documentation

◆ createGridWidgetImpl()

WUIGridWidget::SPtr WUIQtWidgetFactory::createGridWidgetImpl ( const std::string &  title,
WUIWidgetBase::SPtr  parent = WUIWidgetBase::SPtr() 
) const
protectedvirtual

Create a grid widget.

This kind of widget is basically empty. Add others to it. The widgets are initially invisible. Use WUIWidgetBase::show() to make them visible. If a widget with this name already exists, it will be returned.

Note
this function blocks until the widget was created. Check the resulting pointer for NULL.
Parameters
titlethe title
parentthe parent widget which will contain this widget. Can be NULL.
Returns
the widget. Might be NULL if something goes wrong.

Implements WUIWidgetFactory.

Definition at line 60 of file WUIQtWidgetFactory.cpp.

References getAsQtWidgetBase(), m_mainWindow, and WUIWidgetFactory::setParent().

+ Here is the call graph for this function:

◆ createPropertyGroupWidgetImpl()

WUIPropertyGroupWidget::SPtr WUIQtWidgetFactory::createPropertyGroupWidgetImpl ( const std::string &  title,
WPropGroup  properties,
WUIWidgetBase::SPtr  parent = WUIWidgetBase::SPtr() 
) const
protectedvirtual

Create a property widget.

Parentless widgets are initially invisible. Use WUIWidgetBase::show() to make them visible.

Note
this function blocks until the widget was created. Check the resulting pointer for NULL.
Parameters
titlethe title
propertiesthe property group
parentthe parent widget which will contain this widget. Can be NULL.
Returns
the widget. Might be NULL if something goes wrong.

Implements WUIWidgetFactory.

Definition at line 76 of file WUIQtWidgetFactory.cpp.

References getAsQtWidgetBase(), m_mainWindow, and WUIWidgetFactory::setParent().

+ Here is the call graph for this function:

◆ createTabbedWidgetImpl()

WUITabbedWidget::SPtr WUIQtWidgetFactory::createTabbedWidgetImpl ( const std::string &  title,
WUIWidgetBase::SPtr  parent = WUIWidgetBase::SPtr() 
) const
protectedvirtual

Implementation of createTabbedWidget.

Parameters
titlethe title
parentthe parent widget which will contain this widget. Can be NULL.
Returns
the widget. Might be NULL if something goes wrong.

Implements WUIWidgetFactory.

Definition at line 68 of file WUIQtWidgetFactory.cpp.

References getAsQtWidgetBase(), m_mainWindow, and WUIWidgetFactory::setParent().

+ Here is the call graph for this function:

◆ createViewWidgetImpl()

WUIViewWidget::SPtr WUIQtWidgetFactory::createViewWidgetImpl ( std::string  title,
WGECamera::ProjectionMode  projectionMode,
std::shared_ptr< WCondition abordCondition = WCondition::SPtr(),
WUIWidgetBase::SPtr  parent = WUIWidgetBase::SPtr() 
) const
protectedvirtual

Instruct to open a new view widget.

The specified condition should be the shutdown condition of the module, as the function returns only if the widget was created. To ensure that the creation is aborted properly if the module shuts down in the meantime, this condition is used. The widgets are initially invisible. Use WUIWidgetBase::show() to make them visible. If a widget with this name already exists, it will be returned.

Note
this function blocks until the widget was created. Check the resulting pointer for NULL.
Parameters
titlethe title of the widget
projectionModethe kind of projection which should be used
abordConditiona condition enforcing abort of widget creation. Can be NULL
parentthe parent widget which will contain this widget. Can be NULL.
Returns
the created widget

Implements WUIWidgetFactory.

Definition at line 85 of file WUIQtWidgetFactory.cpp.

References getAsQtWidgetBase(), m_mainWindow, and WUIWidgetFactory::setParent().

+ Here is the call graph for this function:

◆ getAsQtWidgetBase()

WUIQtWidgetBase::SPtr WUIQtWidgetFactory::getAsQtWidgetBase ( WUIWidgetBase::SPtr  widget)
static

Convert the given WUIWidgetBase to the corresponding WUIQtWidgetBase.

Parameters
widgetthe widget to convert
Returns
the converted widget.

Definition at line 54 of file WUIQtWidgetFactory.cpp.

Referenced by createGridWidgetImpl(), createPropertyGroupWidgetImpl(), createTabbedWidgetImpl(), and createViewWidgetImpl().

+ Here is the caller graph for this function:

◆ implementsUI()

bool WUIQtWidgetFactory::implementsUI ( ) const
virtual

Query whether the WUI instance supports the WUI Widget interface properly as UIs can simply ignore the WUIWidgetFactory calls done in modules.

This is used mainly by WUIRequirement.

Returns
always true. QtGui supports the WUI widget interface

Implements WUIWidgetFactory.

Definition at line 49 of file WUIQtWidgetFactory.cpp.

Member Data Documentation

◆ m_mainWindow

WMainWindow* WUIQtWidgetFactory::m_mainWindow
private

The main window instance.

Definition at line 145 of file WUIQtWidgetFactory.h.

Referenced by createGridWidgetImpl(), createPropertyGroupWidgetImpl(), createTabbedWidgetImpl(), and createViewWidgetImpl().


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