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

Advanced QDockWidget. More...

#include <WQtDockWidget.h>

+ Inheritance diagram for WQtDockWidget:
+ Collaboration diagram for WQtDockWidget:

Public Slots

void showHelp ()
 Show help. More...
 

Public Member Functions

 WQtDockWidget (const QString &title, QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
 Construct dock widget with title. More...
 
 WQtDockWidget (QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
 Construct dock widget. More...
 
virtual ~WQtDockWidget ()
 Destructor. More...
 
virtual void addTitleProperty (WPropTrigger prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleProperty (WPropBool prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleProperty (WPropGroup prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleAction (QAction *action, bool instantPopup=false)
 Add the given action to the titlebar. More...
 
virtual void addTitleButton (QToolButton *button)
 Add the given tool button to the titlebar. More...
 
virtual void removeTitleAction (QAction *action)
 Remove the given action from the list. More...
 
virtual void addTitleSeperator ()
 Add a separator. More...
 
virtual void addTitleWidget (QWidget *widget)
 Add an arbitrary widget. More...
 
virtual void removeTitleWidget (QWidget *widget)
 Remove the specified widget from the title bar. More...
 
virtual void setHelpContext (const QString &id)
 Set a string which identifies help material for this dock. More...
 
virtual const QString & getHelpContext ()
 Return the help context id. More...
 
virtual void saveSettings ()
 Save settings. More...
 
virtual void restoreSettings ()
 Restore settings. More...
 
void disableCloseButton (bool disable=true)
 Disable close button? Might come in handy when embedding these widgets into others. More...
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
 Called whenever a close event is received. More...
 

Private Attributes

WQtDockTitleWidgetm_titleBar
 Title widget. More...
 
QString m_helpContextId
 The ID for the help context associated with this dock. More...
 

Detailed Description

Advanced QDockWidget.

This class allows you to add actions to the titlebar of the dock widget

Definition at line 49 of file WQtDockWidget.h.

Constructor & Destructor Documentation

◆ WQtDockWidget() [1/2]

WQtDockWidget::WQtDockWidget ( const QString &  title,
QWidget *  parent = 0,
Qt::WindowFlags  flags = Qt::WindowFlags() 
)

Construct dock widget with title.

Parameters
titlethe title of the widget
parentthe parent widget
flagsoptional window flags

Definition at line 44 of file WQtDockWidget.cpp.

References m_titleBar, and WQtDockTitleWidget::updateHelp().

Referenced by WQtControlPanel::WQtControlPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WQtDockWidget() [2/2]

WQtDockWidget::WQtDockWidget ( QWidget *  parent = 0,
Qt::WindowFlags  flags = Qt::WindowFlags() 
)

Construct dock widget.

Parameters
parentthe parent widget
flagsoptional window flags

Definition at line 59 of file WQtDockWidget.cpp.

References m_titleBar, and WQtDockTitleWidget::updateHelp().

+ Here is the call graph for this function:

◆ ~WQtDockWidget()

WQtDockWidget::~WQtDockWidget ( )
virtual

Destructor.

Definition at line 72 of file WQtDockWidget.cpp.

Member Function Documentation

◆ addTitleAction()

void WQtDockWidget::addTitleAction ( QAction action,
bool  instantPopup = false 
)
virtual

Add the given action to the titlebar.

It gets added after the previously added ones.

Parameters
actionthe action to add.
instantPopupif true, the button does not trigger an action. Instead, it directly opens the menu.

Definition at line 77 of file WQtDockWidget.cpp.

References WQtDockTitleWidget::addTitleAction(), and m_titleBar.

Referenced by addTitleProperty(), WMainWindow::setupGUI(), WQtColormapper::WQtColormapper(), WQtControlPanel::WQtControlPanel(), and WQtMessageDock::WQtMessageDock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTitleButton()

void WQtDockWidget::addTitleButton ( QToolButton *  button)
virtual

Add the given tool button to the titlebar.

It gets added after the previously added ones.

Parameters
buttonthe action to add.

Definition at line 82 of file WQtDockWidget.cpp.

References WQtDockTitleWidget::addTitleButton(), and m_titleBar.

Referenced by addTitleProperty(), and WQtGLDockWidget::WQtGLDockWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTitleProperty() [1/3]

void WQtDockWidget::addTitleProperty ( WPropBool  prop,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
virtual

Add a property to the title of this dock.

Image should be specified but is optional.

Parameters
propthe property
iconthe icon to use.

Definition at line 160 of file WQtDockWidget.cpp.

References addTitleAction(), WIconManager::convertToIcon(), and WQtGui::getMainWindow().

+ Here is the call graph for this function:

◆ addTitleProperty() [2/3]

void WQtDockWidget::addTitleProperty ( WPropGroup  prop,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
virtual

Add a property to the title of this dock.

Image should be specified but is optional.

Parameters
propthe property
iconthe icon to use.

Definition at line 175 of file WQtDockWidget.cpp.

References addTitleButton(), WIconManager::convertToIcon(), WQtPropertyGroupWidget::createPropertyGroupBox(), WQtPropertyGroupWidget::createPropertyGroupWidget(), and WQtGui::getMainWindow().

+ Here is the call graph for this function:

◆ addTitleProperty() [3/3]

void WQtDockWidget::addTitleProperty ( WPropTrigger  prop,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
virtual

Add a property to the title of this dock.

Image should be specified but is optional.

Parameters
propthe property
iconthe icon to use.

Definition at line 145 of file WQtDockWidget.cpp.

References addTitleAction(), WIconManager::convertToIcon(), and WQtGui::getMainWindow().

Referenced by WUIQtWidgetBase::addActionBoolGT(), WUIQtWidgetBase::addActionGroupGT(), WUIQtWidgetBase::addActionTriggerGT(), and WQtGLDockWidget::WQtGLDockWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTitleSeperator()

void WQtDockWidget::addTitleSeperator ( )
virtual

Add a separator.

Definition at line 92 of file WQtDockWidget.cpp.

References WQtDockTitleWidget::addTitleSeperator(), and m_titleBar.

Referenced by WMainWindow::setupGUI(), and WQtControlPanel::WQtControlPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTitleWidget()

void WQtDockWidget::addTitleWidget ( QWidget *  widget)
virtual

Add an arbitrary widget.

Please take care of its size! This method sets a size policy and a fixed height.

Parameters
widgetthe widget to add

Definition at line 97 of file WQtDockWidget.cpp.

References WQtDockTitleWidget::addTitleWidget(), and m_titleBar.

Referenced by WQtMessageDock::WQtMessageDock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeEvent()

void WQtDockWidget::closeEvent ( QCloseEvent *  event)
protectedvirtual

Called whenever a close event is received.

Parameters
eventthe event.

Reimplemented in WQtGLDockWidget.

Definition at line 134 of file WQtDockWidget.cpp.

References saveSettings().

Referenced by WQtGLDockWidget::closeEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ disableCloseButton()

void WQtDockWidget::disableCloseButton ( bool  disable = true)

Disable close button? Might come in handy when embedding these widgets into others.

Parameters
disabletrue to disable

Definition at line 140 of file WQtDockWidget.cpp.

References WQtDockTitleWidget::disableCloseButton(), and m_titleBar.

Referenced by WUIQtViewWidget::realizeImpl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHelpContext()

const QString & WQtDockWidget::getHelpContext ( )
virtual

Return the help context id.

Returns
the id.

Definition at line 113 of file WQtDockWidget.cpp.

References m_helpContextId.

Referenced by WQtDockTitleWidget::updateHelp().

+ Here is the caller graph for this function:

◆ removeTitleAction()

void WQtDockWidget::removeTitleAction ( QAction action)
virtual

Remove the given action from the list.

Parameters
actionthe action to add

Definition at line 87 of file WQtDockWidget.cpp.

References m_titleBar, and WQtDockTitleWidget::removeTitleAction().

+ Here is the call graph for this function:

◆ removeTitleWidget()

void WQtDockWidget::removeTitleWidget ( QWidget *  widget)
virtual

Remove the specified widget from the title bar.

Parameters
widgetthe widget to remove

Definition at line 102 of file WQtDockWidget.cpp.

References m_titleBar, and WQtDockTitleWidget::removeTitleWidget().

+ Here is the call graph for this function:

◆ restoreSettings()

void WQtDockWidget::restoreSettings ( )
virtual

Restore settings.

Reimplemented in WQtGLDockWidget.

Definition at line 128 of file WQtDockWidget.cpp.

References WQtGui::getSettings().

Referenced by WQtGLDockWidget::restoreSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

void WQtDockWidget::saveSettings ( )
virtual

Save settings.

Reimplemented in WQtMessageDock, and WQtGLDockWidget.

Definition at line 123 of file WQtDockWidget.cpp.

References WQtGui::getSettings().

Referenced by closeEvent(), and WQtGLDockWidget::saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHelpContext()

void WQtDockWidget::setHelpContext ( const QString &  id)
virtual

Set a string which identifies help material for this dock.

If you specify a help ID which then leads to multiple help documents, a help menu is shown instead of a simple help button. If no help context id was specified, the help button is not show.

Parameters
idthe help context id for this dock

Definition at line 107 of file WQtDockWidget.cpp.

References m_helpContextId, m_titleBar, and WQtDockTitleWidget::updateHelp().

+ Here is the call graph for this function:

◆ showHelp

void WQtDockWidget::showHelp ( )
slot

Show help.

Definition at line 118 of file WQtDockWidget.cpp.

Member Data Documentation

◆ m_helpContextId

QString WQtDockWidget::m_helpContextId
private

The ID for the help context associated with this dock.

Definition at line 195 of file WQtDockWidget.h.

Referenced by getHelpContext(), and setHelpContext().

◆ m_titleBar

WQtDockTitleWidget* WQtDockWidget::m_titleBar
private

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