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

Implementation of WUITabbedWidget. More...

#include <WUIQtTabbedWidget.h>

+ Inheritance diagram for WUIQtTabbedWidget:
+ Collaboration diagram for WUIQtTabbedWidget:

Public Types

typedef std::shared_ptr< WUIQtTabbedWidgetSPtr
 Convenience typedef for a std::shared_ptr< WUIQtTabbedWidget >. More...
 
typedef std::shared_ptr< const WUIQtTabbedWidgetConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIQtTabbedWidget >. More...
 
- Public Types inherited from WUITabbedWidget
enum  TabPosition { North = 0 , South , West , East }
 Tab positions. More...
 
typedef std::shared_ptr< WUITabbedWidgetSPtr
 Convenience typedef for a std::shared_ptr< WUITabbedWidget >. More...
 
typedef std::shared_ptr< const WUITabbedWidgetConstSPtr
 Convenience typedef for a std::shared_ptr< const WUITabbedWidget >. More...
 
- Public Types inherited from WUIWidgetBase
typedef std::shared_ptr< WUIWidgetBaseSPtr
 Convenience typedef for a std::shared_ptr< WUIWidgetBase >. More...
 
typedef std::shared_ptr< const WUIWidgetBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIWidgetBase >. More...
 
- Public Types inherited from WUIQtWidgetBase
typedef std::shared_ptr< WUIQtWidgetBaseSPtr
 Convenience typedef for a std::shared_ptr< WUIQtWidgetBase >. More...
 
typedef std::shared_ptr< const WUIQtWidgetBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIQtWidgetBase >. More...
 

Public Member Functions

 WUIQtTabbedWidget (std::string title, WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent=WUIQtWidgetBase::SPtr())
 Default constructor. More...
 
virtual ~WUIQtTabbedWidget ()
 Destructor. More...
 
virtual QString getTitleQString () const
 Title as QString. More...
 
virtual void show ()
 Show this widget if not yet visible. More...
 
virtual void setVisible (bool visible=true)
 Hide/show this widget. More...
 
virtual bool isVisible () const
 Check if the widget is hidden or not. More...
 
virtual void close ()
 Handle shutdown. More...
 
virtual void setTabText (int index, const std::string &label)
 Set label of the tab with given index. More...
 
virtual void setActiveTab (int index)
 Set the given tab active. More...
 
virtual int getActiveTab () const
 Get the index of the currently active tab. More...
 
virtual int getNumTabs () const
 Query the number of tabs. More...
 
virtual void setTabToolTip (int index, const std::string &tip)
 Write some tool tip for a given tab. More...
 
virtual void setTabEnabled (int index, bool enable)
 Allows en/disabling a tab. More...
 
virtual void setTabPosition (TabPosition position)
 Specify where to place the tabs. More...
 
virtual void addAction (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addAction (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addAction (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
- Public Member Functions inherited from WUITabbedWidget
virtual ~WUITabbedWidget ()
 Destructor. More...
 
virtual bool allowNesting () const
 Tell the user whether this kind of widget can be used as parent. More...
 
virtual int addTab (WUIWidgetBase::SPtr widget, const std::string &label)
 Place the given widget in this tab widget in a new tab with a given label. More...
 
- Public Member Functions inherited from WUIWidgetBase
virtual ~WUIWidgetBase ()
 Destructor. More...
 
virtual std::string getTitle () const
 Get the title of the widget. More...
 
void close ()
 Close the widget. More...
 
bool isClosed () const
 Checks whether the widget was closed already. More...
 
WCondition::SPtr getCloseCondition () const
 Return the condition that fires when the widgets closes. More...
 
virtual WUIWidgetBase::SPtr getParent () const
 Get the parent widget of this widget if any. More...
 
- Public Member Functions inherited from WUIQtWidgetBase
 WUIQtWidgetBase (WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent)
 Default constructor. More...
 
virtual ~WUIQtWidgetBase ()
 Destructor. More...
 
virtual bool isReal ()
 The widget was created and can be used. More...
 
virtual void realize (WCondition::SPtr abortCondition=WCondition::SPtr())
 Realize the widget. More...
 
QWidget * getWidget () const
 Get the widget representation. More...
 
QWidget * getParentAsQtWidget () const
 Get the parent as Qt widget. More...
 
WUIQtWidgetBase::SPtr getQtParent () const
 Parent widget. More...
 

Protected Member Functions

virtual void realizeImpl ()
 Realize the widget. More...
 
virtual void closeImpl ()
 Close the widget. More...
 
virtual void cleanUpGT ()
 Cleanup the GUI. More...
 
virtual int addTabImpl (WUIWidgetBase::SPtr widget, std::string label)
 Place the given widget in this tab widget in a new tab with a given label. More...
 
- Protected Member Functions inherited from WUITabbedWidget
 WUITabbedWidget (std::string title)
 Default constructor. More...
 
- Protected Member Functions inherited from WUIWidgetBase
 WUIWidgetBase (std::string title)
 Default constructor. More...
 
virtual void setParent (WUIWidgetBase::SPtr parent)
 Set the parent of this WUI widget. More...
 
virtual void registerChild (WUIWidgetBase::SPtr child)
 Register widget as child. More...
 
ChildContainergetChildren ()
 Return the list of children. More...
 
const ChildContainergetChildren () const
 Return the list of children. More...
 
void closeChildren ()
 Comfortable function to recurse a close call. More...
 
- Protected Member Functions inherited from WUIQtWidgetBase
virtual void showGT ()
 Show this widget if not yet visible. More...
 
virtual void setVisibleGT (bool visible=true)
 Hide/show this widget. More...
 
virtual bool isVisibleGT () const
 Check if the widget is hidden or not. More...
 
virtual void closeGT ()
 Close the widget. More...
 
QWidget * getCompellingQParent () const
 Returns the parent to use for your implementation in realizeImpl. More...
 
bool hasUIParent () const
 Check if the widget is embedded into another WUI widget. More...
 
QWidget * embedContent (QWidget *content)
 This method can be used if you just create some QWidget and do not want to take care about embedding the content in a dock if there is no parent, setting size constraints and similar. More...
 
virtual void addActionGroupGT (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addActionTriggerGT (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addActionBoolGT (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 

Private Attributes

QTabWidget * m_tabWidget
 The tab widget used for managing child widgets. More...
 

Additional Inherited Members

- Protected Types inherited from WUIWidgetBase
typedef WSharedSequenceContainer< std::vector< WUIWidgetBase::SPtr > > ChildContainer
 Keep track of our child widgets. More...
 
- Protected Attributes inherited from WUIQtWidgetBase
WMainWindowm_mainWindow
 The main window instance. More...
 
QWidget * m_widget
 The widget representing this abstract UI element. More...
 
WUIQtWidgetBase::SPtr m_parent
 Parent widget. More...
 

Detailed Description

Implementation of WUITabbedWidget.

Definition at line 41 of file WUIQtTabbedWidget.h.

Member Typedef Documentation

◆ ConstSPtr

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

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

Definition at line 53 of file WUIQtTabbedWidget.h.

◆ SPtr

typedef std::shared_ptr< WUIQtTabbedWidget > WUIQtTabbedWidget::SPtr

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

Definition at line 48 of file WUIQtTabbedWidget.h.

Constructor & Destructor Documentation

◆ WUIQtTabbedWidget()

WUIQtTabbedWidget::WUIQtTabbedWidget ( std::string  title,
WMainWindow mainWindow,
WUIQtWidgetBase::SPtr  parent = WUIQtWidgetBase::SPtr() 
)

Default constructor.

Parameters
mainWindowthe main window instance
parentthe Qt parent. Can be NULL.
titlethe title of the widget

Definition at line 29 of file WUIQtTabbedWidget.cpp.

◆ ~WUIQtTabbedWidget()

WUIQtTabbedWidget::~WUIQtTabbedWidget ( )
virtual

Destructor.

Definition at line 39 of file WUIQtTabbedWidget.cpp.

Member Function Documentation

◆ addAction() [1/3]

virtual void WUIQtTabbedWidget::addAction ( WPropBool  toggle,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
inlinevirtual

Implement WUIWidgetBase::addAction.

Parameters
togglethe property to use.
iconthe icon to use. Consider a minimum size of 32x32.

Reimplemented from WUIQtWidgetBase.

Definition at line 184 of file WUIQtTabbedWidget.h.

References WUIQtWidgetBase::addAction().

+ Here is the call graph for this function:

◆ addAction() [2/3]

virtual void WUIQtTabbedWidget::addAction ( WPropGroup  group,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
inlinevirtual

Implement WUIWidgetBase::addAction.

Parameters
groupthe property to use.
iconthe icon to use. Consider a minimum size of 32x32.

Reimplemented from WUIQtWidgetBase.

Definition at line 162 of file WUIQtTabbedWidget.h.

References WUIQtWidgetBase::addAction().

+ Here is the call graph for this function:

◆ addAction() [3/3]

virtual void WUIQtTabbedWidget::addAction ( WPropTrigger  trigger,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
inlinevirtual

Implement WUIWidgetBase::addAction.

Parameters
triggerthe property to use.
iconthe icon to use. Consider a minimum size of 32x32.

Reimplemented from WUIQtWidgetBase.

Definition at line 173 of file WUIQtTabbedWidget.h.

References WUIQtWidgetBase::addAction().

+ Here is the call graph for this function:

◆ addTabImpl()

int WUIQtTabbedWidget::addTabImpl ( WUIWidgetBase::SPtr  widget,
std::string  label 
)
protectedvirtual

Place the given widget in this tab widget in a new tab with a given label.

The widget to be placed must be created with this tab widget as parent or an exception will be thrown.

Parameters
widgetthe widget
labelthe label of the tab
Returns
the index of the new tab

Implements WUITabbedWidget.

Definition at line 90 of file WUIQtTabbedWidget.cpp.

References WUIQtWidgetBase::getWidget(), and m_tabWidget.

+ Here is the call graph for this function:

◆ cleanUpGT()

void WUIQtTabbedWidget::cleanUpGT ( )
protectedvirtual

Cleanup the GUI.

Do not delete m_widget, or your content widget. This is done by WUIQtWidgetBase. This method allows you to free resources that are not automatically freed by the Qt delete mechanism.

Implements WUIQtWidgetBase.

Definition at line 64 of file WUIQtTabbedWidget.cpp.

◆ close()

void WUIQtTabbedWidget::close ( )
virtual

Handle shutdown.

This includes notification of the creating module and closing the widget. Can be called from any thread. Implement in your implementation.

Implements WUIQtWidgetBase.

Definition at line 69 of file WUIQtTabbedWidget.cpp.

References WUIWidgetBase::close().

+ Here is the call graph for this function:

◆ closeImpl()

void WUIQtTabbedWidget::closeImpl ( )
protectedvirtual

Close the widget.

When done, the widget can be safely deleted.

Reimplemented from WUIQtWidgetBase.

Definition at line 75 of file WUIQtTabbedWidget.cpp.

References WUIQtWidgetBase::closeImpl().

+ Here is the call graph for this function:

◆ getActiveTab()

int WUIQtTabbedWidget::getActiveTab ( ) const
virtual

Get the index of the currently active tab.

Returns
the index, or -1 if error

Implements WUITabbedWidget.

Definition at line 153 of file WUIQtTabbedWidget.cpp.

References m_tabWidget.

◆ getNumTabs()

int WUIQtTabbedWidget::getNumTabs ( ) const
virtual

Query the number of tabs.

Returns
the number of tabs, or -1 if error.

Implements WUITabbedWidget.

Definition at line 162 of file WUIQtTabbedWidget.cpp.

References m_tabWidget.

◆ getTitleQString()

QString WUIQtTabbedWidget::getTitleQString ( ) const
virtual

Title as QString.

Returns
the title

Implements WUIQtWidgetBase.

Definition at line 44 of file WUIQtTabbedWidget.cpp.

References WUIWidgetBase::getTitle().

+ Here is the call graph for this function:

◆ isVisible()

bool WUIQtTabbedWidget::isVisible ( ) const
virtual

Check if the widget is hidden or not.

Returns
true if visible.

Reimplemented from WUIQtWidgetBase.

Definition at line 59 of file WUIQtTabbedWidget.cpp.

References WUIQtWidgetBase::isVisible().

+ Here is the call graph for this function:

◆ realizeImpl()

void WUIQtTabbedWidget::realizeImpl ( )
protectedvirtual

Realize the widget.

This method blocks until the GUI thread created the widget. Called from within the GUI thread! So you can safely do Qt stuff.

Implements WUIQtWidgetBase.

Definition at line 81 of file WUIQtTabbedWidget.cpp.

References WUIQtWidgetBase::embedContent(), WUIQtWidgetBase::getCompellingQParent(), and m_tabWidget.

+ Here is the call graph for this function:

◆ setActiveTab()

void WUIQtTabbedWidget::setActiveTab ( int  index)
virtual

Set the given tab active.

If it not exists, the current tab stays active.

Parameters
indexthe index of the tab

Implements WUITabbedWidget.

Definition at line 119 of file WUIQtTabbedWidget.cpp.

References WQtGui::execInGUIThread(), and m_tabWidget.

+ Here is the call graph for this function:

◆ setTabEnabled()

void WUIQtTabbedWidget::setTabEnabled ( int  index,
bool  enable 
)
virtual

Allows en/disabling a tab.

If the index is invalid, nothing happens.

Parameters
indexthe index.
enabletrue to enable

Implements WUITabbedWidget.

Definition at line 136 of file WUIQtTabbedWidget.cpp.

References WQtGui::execInGUIThread(), and m_tabWidget.

+ Here is the call graph for this function:

◆ setTabPosition()

void WUIQtTabbedWidget::setTabPosition ( TabPosition  position)
virtual

Specify where to place the tabs.

Parameters
positionthe position

Implements WUITabbedWidget.

Definition at line 144 of file WUIQtTabbedWidget.cpp.

References WQtGui::execInGUIThread(), and m_tabWidget.

+ Here is the call graph for this function:

◆ setTabText()

void WUIQtTabbedWidget::setTabText ( int  index,
const std::string &  label 
)
virtual

Set label of the tab with given index.

If the tab does not exist, nothing happens.

Parameters
indexthe index of the tab
labelthe label of the tab

Implements WUITabbedWidget.

Definition at line 110 of file WUIQtTabbedWidget.cpp.

References WQtGui::execInGUIThread(), and m_tabWidget.

+ Here is the call graph for this function:

◆ setTabToolTip()

void WUIQtTabbedWidget::setTabToolTip ( int  index,
const std::string &  tip 
)
virtual

Write some tool tip for a given tab.

If the index is invalid, nothing happens.

Parameters
indexthe tab index
tipthe tooltip text

Implements WUITabbedWidget.

Definition at line 127 of file WUIQtTabbedWidget.cpp.

References WQtGui::execInGUIThread(), and m_tabWidget.

+ Here is the call graph for this function:

◆ setVisible()

void WUIQtTabbedWidget::setVisible ( bool  visible = true)
virtual

Hide/show this widget.

Unlike close(), you can show the widget again using show().

Parameters
visiblefalse to hide widget

Reimplemented from WUIQtWidgetBase.

Definition at line 54 of file WUIQtTabbedWidget.cpp.

References WUIQtWidgetBase::setVisible().

+ Here is the call graph for this function:

◆ show()

void WUIQtTabbedWidget::show ( )
virtual

Show this widget if not yet visible.

Reimplemented from WUIQtWidgetBase.

Definition at line 49 of file WUIQtTabbedWidget.cpp.

References WUIQtWidgetBase::show().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_tabWidget

QTabWidget* WUIQtTabbedWidget::m_tabWidget
private

The tab widget used for managing child widgets.

Definition at line 220 of file WUIQtTabbedWidget.h.

Referenced by addTabImpl(), getActiveTab(), getNumTabs(), realizeImpl(), setActiveTab(), setTabEnabled(), setTabPosition(), setTabText(), and setTabToolTip().


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